vibe-coding-master 0.4.10 → 0.4.12

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 Z0=Object.defineProperty;var J0=(n,r,s)=>r in n?Z0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var am=(n,r,s)=>J0(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const _ of d)if(_.type==="childList")for(const f of _.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const _={};return d.integrity&&(_.integrity=d.integrity),d.referrerPolicy&&(_.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?_.credentials="include":d.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(d){if(d.ep)return;d.ep=!0;const _=s(d);fetch(d.href,_)}})();function Tg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yu={exports:{}},gl={};/**
1
+ var Z0=Object.defineProperty;var J0=(n,r,s)=>r in n?Z0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var am=(n,r,s)=>J0(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const _ of d)if(_.type==="childList")for(const f of _.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const _={};return d.integrity&&(_.integrity=d.integrity),d.referrerPolicy&&(_.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?_.credentials="include":d.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(d){if(d.ep)return;d.ep=!0;const _=s(d);fetch(d.href,_)}})();function Tg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yu={exports:{}},_l={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ var Z0=Object.defineProperty;var J0=(n,r,s)=>r in n?Z0(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 om;function e1(){if(om)return gl;om=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,_){var f=null;if(_!==void 0&&(f=""+_),d.key!==void 0&&(f=""+d.key),"key"in d){_={};for(var a in d)a!=="key"&&(_[a]=d[a])}else _=d;return d=_.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:_}}return gl.Fragment=r,gl.jsx=s,gl.jsxs=s,gl}var cm;function t1(){return cm||(cm=1,yu.exports=e1()),yu.exports}var T=t1(),Su={exports:{}},He={};/**
9
+ */var om;function e1(){if(om)return _l;om=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,_){var f=null;if(_!==void 0&&(f=""+_),d.key!==void 0&&(f=""+d.key),"key"in d){_={};for(var a in d)a!=="key"&&(_[a]=d[a])}else _=d;return d=_.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:_}}return _l.Fragment=r,_l.jsx=s,_l.jsxs=s,_l}var cm;function t1(){return cm||(cm=1,yu.exports=e1()),yu.exports}var T=t1(),Su={exports:{}},He={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ var Z0=Object.defineProperty;var J0=(n,r,s)=>r in n?Z0(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 um;function n1(){if(um)return He;um=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),b=Symbol.iterator;function C(H){return H===null||typeof H!="object"?null:(H=b&&H[b]||H["@@iterator"],typeof H=="function"?H:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function v(H,G,N){this.props=H,this.context=G,this.refs=y,this.updater=N||A}v.prototype.isReactComponent={},v.prototype.setState=function(H,G){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,G,"setState")},v.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function m(){}m.prototype=v.prototype;function S(H,G,N){this.props=H,this.context=G,this.refs=y,this.updater=N||A}var k=S.prototype=new m;k.constructor=S,x(k,v.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function L(H,G,N){var Z=N.ref;return{$$typeof:n,type:H,key:G,ref:Z!==void 0?Z:null,props:N}}function O(H,G){return L(H.type,G,H.props)}function I(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function F(H){var G={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(N){return G[N]})}var U=/\/+/g;function W(H,G){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):G.toString(36)}function Y(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(R,R):(H.status="pending",H.then(function(G){H.status==="pending"&&(H.status="fulfilled",H.value=G)},function(G){H.status==="pending"&&(H.status="rejected",H.reason=G)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function V(H,G,N,Z,ue){var ve=typeof H;(ve==="undefined"||ve==="boolean")&&(H=null);var X=!1;if(H===null)X=!0;else switch(ve){case"bigint":case"string":case"number":X=!0;break;case"object":switch(H.$$typeof){case n:case r:X=!0;break;case g:return X=H._init,V(X(H._payload),G,N,Z,ue)}}if(X)return ue=ue(H),X=Z===""?"."+W(H,0):Z,M(ue)?(N="",X!=null&&(N=X.replace(U,"$&/")+"/"),V(ue,G,N,"",function(ce){return ce})):ue!=null&&(I(ue)&&(ue=O(ue,N+(ue.key==null||H&&H.key===ue.key?"":(""+ue.key).replace(U,"$&/")+"/")+X)),G.push(ue)),1;X=0;var q=Z===""?".":Z+":";if(M(H))for(var fe=0;fe<H.length;fe++)Z=H[fe],ve=q+W(Z,fe),X+=V(Z,G,N,ve,ue);else if(fe=C(H),typeof fe=="function")for(H=fe.call(H),fe=0;!(Z=H.next()).done;)Z=Z.value,ve=q+W(Z,fe++),X+=V(Z,G,N,ve,ue);else if(ve==="object"){if(typeof H.then=="function")return V(Y(H),G,N,Z,ue);throw G=String(H),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return X}function K(H,G,N){if(H==null)return H;var Z=[],ue=0;return V(H,Z,"","",function(ve){return G.call(N,ve,ue++)}),Z}function J(H){if(H._status===-1){var G=H._result;G=G(),G.then(function(N){(H._status===0||H._status===-1)&&(H._status=1,H._result=N)},function(N){(H._status===0||H._status===-1)&&(H._status=2,H._result=N)}),H._status===-1&&(H._status=0,H._result=G)}if(H._status===1)return H._result.default;throw H._result}var z=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},j={map:K,forEach:function(H,G,N){K(H,function(){G.apply(this,arguments)},N)},count:function(H){var G=0;return K(H,function(){G++}),G},toArray:function(H){return K(H,function(G){return G})||[]},only:function(H){if(!I(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return He.Activity=u,He.Children=j,He.Component=v,He.Fragment=s,He.Profiler=d,He.PureComponent=S,He.StrictMode=o,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(H){return D.H.useMemoCache(H)}},He.cache=function(H){return function(){return H.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(H,G,N){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Z=x({},H.props),ue=H.key;if(G!=null)for(ve in G.key!==void 0&&(ue=""+G.key),G)!E.call(G,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&G.ref===void 0||(Z[ve]=G[ve]);var ve=arguments.length-2;if(ve===1)Z.children=N;else if(1<ve){for(var X=Array(ve),q=0;q<ve;q++)X[q]=arguments[q+2];Z.children=X}return L(H.type,ue,Z)},He.createContext=function(H){return H={$$typeof:f,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:_,_context:H},H},He.createElement=function(H,G,N){var Z,ue={},ve=null;if(G!=null)for(Z in G.key!==void 0&&(ve=""+G.key),G)E.call(G,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ue[Z]=G[Z]);var X=arguments.length-2;if(X===1)ue.children=N;else if(1<X){for(var q=Array(X),fe=0;fe<X;fe++)q[fe]=arguments[fe+2];ue.children=q}if(H&&H.defaultProps)for(Z in X=H.defaultProps,X)ue[Z]===void 0&&(ue[Z]=X[Z]);return L(H,ve,ue)},He.createRef=function(){return{current:null}},He.forwardRef=function(H){return{$$typeof:a,render:H}},He.isValidElement=I,He.lazy=function(H){return{$$typeof:g,_payload:{_status:-1,_result:H},_init:J}},He.memo=function(H,G){return{$$typeof:h,type:H,compare:G===void 0?null:G}},He.startTransition=function(H){var G=D.T,N={};D.T=N;try{var Z=H(),ue=D.S;ue!==null&&ue(N,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,z)}catch(ve){z(ve)}finally{G!==null&&N.types!==null&&(G.types=N.types),D.T=G}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(H){return D.H.use(H)},He.useActionState=function(H,G,N){return D.H.useActionState(H,G,N)},He.useCallback=function(H,G){return D.H.useCallback(H,G)},He.useContext=function(H){return D.H.useContext(H)},He.useDebugValue=function(){},He.useDeferredValue=function(H,G){return D.H.useDeferredValue(H,G)},He.useEffect=function(H,G){return D.H.useEffect(H,G)},He.useEffectEvent=function(H){return D.H.useEffectEvent(H)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(H,G,N){return D.H.useImperativeHandle(H,G,N)},He.useInsertionEffect=function(H,G){return D.H.useInsertionEffect(H,G)},He.useLayoutEffect=function(H,G){return D.H.useLayoutEffect(H,G)},He.useMemo=function(H,G){return D.H.useMemo(H,G)},He.useOptimistic=function(H,G){return D.H.useOptimistic(H,G)},He.useReducer=function(H,G,N){return D.H.useReducer(H,G,N)},He.useRef=function(H){return D.H.useRef(H)},He.useState=function(H){return D.H.useState(H)},He.useSyncExternalStore=function(H,G,N){return D.H.useSyncExternalStore(H,G,N)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.6",He}var hm;function rh(){return hm||(hm=1,Su.exports=n1()),Su.exports}var ne=rh(),bu={exports:{}},_l={},Cu={exports:{}},wu={};/**
17
+ */var um;function n1(){if(um)return He;um=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),b=Symbol.iterator;function C(H){return H===null||typeof H!="object"?null:(H=b&&H[b]||H["@@iterator"],typeof H=="function"?H:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function v(H,G,N){this.props=H,this.context=G,this.refs=y,this.updater=N||A}v.prototype.isReactComponent={},v.prototype.setState=function(H,G){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,G,"setState")},v.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function m(){}m.prototype=v.prototype;function S(H,G,N){this.props=H,this.context=G,this.refs=y,this.updater=N||A}var k=S.prototype=new m;k.constructor=S,x(k,v.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function L(H,G,N){var Z=N.ref;return{$$typeof:n,type:H,key:G,ref:Z!==void 0?Z:null,props:N}}function O(H,G){return L(H.type,G,H.props)}function I(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function F(H){var G={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(N){return G[N]})}var U=/\/+/g;function W(H,G){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):G.toString(36)}function Y(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(R,R):(H.status="pending",H.then(function(G){H.status==="pending"&&(H.status="fulfilled",H.value=G)},function(G){H.status==="pending"&&(H.status="rejected",H.reason=G)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function V(H,G,N,Z,ue){var ve=typeof H;(ve==="undefined"||ve==="boolean")&&(H=null);var X=!1;if(H===null)X=!0;else switch(ve){case"bigint":case"string":case"number":X=!0;break;case"object":switch(H.$$typeof){case n:case r:X=!0;break;case g:return X=H._init,V(X(H._payload),G,N,Z,ue)}}if(X)return ue=ue(H),X=Z===""?"."+W(H,0):Z,M(ue)?(N="",X!=null&&(N=X.replace(U,"$&/")+"/"),V(ue,G,N,"",function(ce){return ce})):ue!=null&&(I(ue)&&(ue=O(ue,N+(ue.key==null||H&&H.key===ue.key?"":(""+ue.key).replace(U,"$&/")+"/")+X)),G.push(ue)),1;X=0;var q=Z===""?".":Z+":";if(M(H))for(var fe=0;fe<H.length;fe++)Z=H[fe],ve=q+W(Z,fe),X+=V(Z,G,N,ve,ue);else if(fe=C(H),typeof fe=="function")for(H=fe.call(H),fe=0;!(Z=H.next()).done;)Z=Z.value,ve=q+W(Z,fe++),X+=V(Z,G,N,ve,ue);else if(ve==="object"){if(typeof H.then=="function")return V(Y(H),G,N,Z,ue);throw G=String(H),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return X}function K(H,G,N){if(H==null)return H;var Z=[],ue=0;return V(H,Z,"","",function(ve){return G.call(N,ve,ue++)}),Z}function J(H){if(H._status===-1){var G=H._result;G=G(),G.then(function(N){(H._status===0||H._status===-1)&&(H._status=1,H._result=N)},function(N){(H._status===0||H._status===-1)&&(H._status=2,H._result=N)}),H._status===-1&&(H._status=0,H._result=G)}if(H._status===1)return H._result.default;throw H._result}var z=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},j={map:K,forEach:function(H,G,N){K(H,function(){G.apply(this,arguments)},N)},count:function(H){var G=0;return K(H,function(){G++}),G},toArray:function(H){return K(H,function(G){return G})||[]},only:function(H){if(!I(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return He.Activity=u,He.Children=j,He.Component=v,He.Fragment=s,He.Profiler=d,He.PureComponent=S,He.StrictMode=o,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(H){return D.H.useMemoCache(H)}},He.cache=function(H){return function(){return H.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(H,G,N){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Z=x({},H.props),ue=H.key;if(G!=null)for(ve in G.key!==void 0&&(ue=""+G.key),G)!E.call(G,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&G.ref===void 0||(Z[ve]=G[ve]);var ve=arguments.length-2;if(ve===1)Z.children=N;else if(1<ve){for(var X=Array(ve),q=0;q<ve;q++)X[q]=arguments[q+2];Z.children=X}return L(H.type,ue,Z)},He.createContext=function(H){return H={$$typeof:f,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:_,_context:H},H},He.createElement=function(H,G,N){var Z,ue={},ve=null;if(G!=null)for(Z in G.key!==void 0&&(ve=""+G.key),G)E.call(G,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ue[Z]=G[Z]);var X=arguments.length-2;if(X===1)ue.children=N;else if(1<X){for(var q=Array(X),fe=0;fe<X;fe++)q[fe]=arguments[fe+2];ue.children=q}if(H&&H.defaultProps)for(Z in X=H.defaultProps,X)ue[Z]===void 0&&(ue[Z]=X[Z]);return L(H,ve,ue)},He.createRef=function(){return{current:null}},He.forwardRef=function(H){return{$$typeof:a,render:H}},He.isValidElement=I,He.lazy=function(H){return{$$typeof:g,_payload:{_status:-1,_result:H},_init:J}},He.memo=function(H,G){return{$$typeof:h,type:H,compare:G===void 0?null:G}},He.startTransition=function(H){var G=D.T,N={};D.T=N;try{var Z=H(),ue=D.S;ue!==null&&ue(N,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,z)}catch(ve){z(ve)}finally{G!==null&&N.types!==null&&(G.types=N.types),D.T=G}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(H){return D.H.use(H)},He.useActionState=function(H,G,N){return D.H.useActionState(H,G,N)},He.useCallback=function(H,G){return D.H.useCallback(H,G)},He.useContext=function(H){return D.H.useContext(H)},He.useDebugValue=function(){},He.useDeferredValue=function(H,G){return D.H.useDeferredValue(H,G)},He.useEffect=function(H,G){return D.H.useEffect(H,G)},He.useEffectEvent=function(H){return D.H.useEffectEvent(H)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(H,G,N){return D.H.useImperativeHandle(H,G,N)},He.useInsertionEffect=function(H,G){return D.H.useInsertionEffect(H,G)},He.useLayoutEffect=function(H,G){return D.H.useLayoutEffect(H,G)},He.useMemo=function(H,G){return D.H.useMemo(H,G)},He.useOptimistic=function(H,G){return D.H.useOptimistic(H,G)},He.useReducer=function(H,G,N){return D.H.useReducer(H,G,N)},He.useRef=function(H){return D.H.useRef(H)},He.useState=function(H){return D.H.useState(H)},He.useSyncExternalStore=function(H,G,N){return D.H.useSyncExternalStore(H,G,N)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.6",He}var hm;function rh(){return hm||(hm=1,Su.exports=n1()),Su.exports}var ie=rh(),bu={exports:{}},vl={},Cu={exports:{}},wu={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -38,40 +38,40 @@ var Z0=Object.defineProperty;var J0=(n,r,s)=>r in n?Z0(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 gm;function a1(){if(gm)return _l;gm=1;var n=r1(),r=rh(),s=l1();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function a(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(_(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,l=t;;){var p=i.return;if(p===null)break;var w=p.alternate;if(w===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===w.child){for(w=p.child;w;){if(w===i)return c(p),e;if(w===l)return c(p),t;w=w.sibling}throw Error(o(188))}if(i.return!==l.return)i=p,l=w;else{for(var B=!1,P=p.child;P;){if(P===i){B=!0,i=p,l=w;break}if(P===l){B=!0,l=p,i=w;break}P=P.sibling}if(!B){for(P=w.child;P;){if(P===i){B=!0,i=w,l=p;break}if(P===l){B=!0,l=w,i=p;break}P=P.sibling}if(!B)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,b=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case S:return e.displayName||"Context";case m:return(e._context.displayName||"Context")+".Consumer";case k:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var Y=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,J={pending:!1,data:null,method:null,action:null},z=[],j=-1;function H(e){return{current:e}}function G(e){0>j||(e.current=z[j],z[j]=null,j--)}function N(e,t){j++,z[j]=e.current,e.current=t}var Z=H(null),ue=H(null),ve=H(null),X=H(null);function q(e,t){switch(N(ve,t),N(ue,e),N(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Mp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(Z),N(Z,e)}function fe(){G(Z),G(ue),G(ve)}function ce(e){e.memoizedState!==null&&N(X,e);var t=Z.current,i=Mp(t,e.type);t!==i&&(N(ue,e),N(Z,i))}function de(e){ue.current===e&&(G(Z),G(ue)),X.current===e&&(G(X),fl._currentValue=J)}var re,Ce;function Ee(e){if(re===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||"",Ce=-1<i.stack.indexOf(`
41
+ */var gm;function a1(){if(gm)return vl;gm=1;var n=r1(),r=rh(),s=l1();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function a(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(_(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,l=t;;){var p=i.return;if(p===null)break;var w=p.alternate;if(w===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===w.child){for(w=p.child;w;){if(w===i)return c(p),e;if(w===l)return c(p),t;w=w.sibling}throw Error(o(188))}if(i.return!==l.return)i=p,l=w;else{for(var B=!1,P=p.child;P;){if(P===i){B=!0,i=p,l=w;break}if(P===l){B=!0,l=p,i=w;break}P=P.sibling}if(!B){for(P=w.child;P;){if(P===i){B=!0,i=w,l=p;break}if(P===l){B=!0,l=w,i=p;break}P=P.sibling}if(!B)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,b=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case S:return e.displayName||"Context";case m:return(e._context.displayName||"Context")+".Consumer";case k:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var Y=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,J={pending:!1,data:null,method:null,action:null},z=[],j=-1;function H(e){return{current:e}}function G(e){0>j||(e.current=z[j],z[j]=null,j--)}function N(e,t){j++,z[j]=e.current,e.current=t}var Z=H(null),ue=H(null),ve=H(null),X=H(null);function q(e,t){switch(N(ve,t),N(ue,e),N(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Mp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(Z),N(Z,e)}function fe(){G(Z),G(ue),G(ve)}function ce(e){e.memoizedState!==null&&N(X,e);var t=Z.current,i=Mp(t,e.type);t!==i&&(N(ue,e),N(Z,i))}function de(e){ue.current===e&&(G(Z),G(ue)),X.current===e&&(G(X),dl._currentValue=J)}var se,Ce;function ke(e){if(se===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||"",Ce=-1<i.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+re+e+Ce}var xe=!1;function dt(e,t){if(!e||xe)return"";xe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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(he){var oe=he}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(he){oe=he}e.call(_e.prototype)}}else{try{throw Error()}catch(he){oe=he}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(he){if(he&&oe&&typeof he.stack=="string")return[he.stack,oe.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),B=w[0],P=w[1];if(B&&P){var Q=B.split(`
43
+ `+se+e+Ce}var Ee=!1;function ht(e,t){if(!e||Ee)return"";Ee=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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(he){var oe=he}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(he){oe=he}e.call(_e.prototype)}}else{try{throw Error()}catch(he){oe=he}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(he){if(he&&oe&&typeof he.stack=="string")return[he.stack,oe.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),B=w[0],P=w[1];if(B&&P){var Q=B.split(`
44
44
  `),ae=P.split(`
45
- `);for(p=l=0;l<Q.length&&!Q[l].includes("DetermineComponentFrameRoot");)l++;for(;p<ae.length&&!ae[p].includes("DetermineComponentFrameRoot");)p++;if(l===Q.length||p===ae.length)for(l=Q.length-1,p=ae.length-1;1<=l&&0<=p&&Q[l]!==ae[p];)p--;for(;1<=l&&0<=p;l--,p--)if(Q[l]!==ae[p]){if(l!==1||p!==1)do if(l--,p--,0>p||Q[l]!==ae[p]){var me=`
46
- `+Q[l].replace(" at new "," at ");return e.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",e.displayName)),me}while(1<=l&&0<=p);break}}}finally{xe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ee(i):""}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==t&&t!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return dt(e.type,!1);case 11:return dt(e.type.render,!1);case 1:return dt(e.type,!0);case 31:return Ee("Activity");default:return""}}function en(e){try{var t="",i=null;do t+=Re(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
45
+ `);for(p=l=0;l<Q.length&&!Q[l].includes("DetermineComponentFrameRoot");)l++;for(;p<ae.length&&!ae[p].includes("DetermineComponentFrameRoot");)p++;if(l===Q.length||p===ae.length)for(l=Q.length-1,p=ae.length-1;1<=l&&0<=p&&Q[l]!==ae[p];)p--;for(;1<=l&&0<=p;l--,p--)if(Q[l]!==ae[p]){if(l!==1||p!==1)do if(l--,p--,0>p||Q[l]!==ae[p]){var pe=`
46
+ `+Q[l].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=l&&0<=p);break}}}finally{Ee=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ke(i):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return ht(e.type,!1);case 11:return ht(e.type.render,!1);case 1:return ht(e.type,!0);case 31:return ke("Activity");default:return""}}function tn(e){try{var t="",i=null;do t+=De(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
47
47
  Error generating stack: `+l.message+`
48
- `+l.stack}}var qt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,tn=n.unstable_cancelCallback,wn=n.unstable_shouldYield,wt=n.unstable_requestPaint,pt=n.unstable_now,At=n.unstable_getCurrentPriorityLevel,se=n.unstable_ImmediatePriority,ye=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,Be=n.unstable_LowPriority,je=n.unstable_IdlePriority,mt=n.log,Ue=n.unstable_setDisableYieldValue,et=null,Me=null;function ht(e){if(typeof mt=="function"&&Ue(e),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(et,e)}catch{}}var qe=Math.clz32?Math.clz32:Yt,nn=Math.log,Tt=Math.LN2;function Yt(e){return e>>>=0,e===0?32:31-(nn(e)/Tt|0)|0}var On=256,ze=262144,qn=4194304;function Zn(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 Jn(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var p=0,w=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var P=l&134217727;return P!==0?(l=P&~w,l!==0?p=Zn(l):(B&=P,B!==0?p=Zn(B):i||(i=P&~e,i!==0&&(p=Zn(i))))):(P=l&~w,P!==0?p=Zn(P):B!==0?p=Zn(B):i||(i=l&~e,i!==0&&(p=Zn(i)))),p===0?0:t!==0&&t!==p&&(t&w)===0&&(w=p&-p,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:p}function rr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mo(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 Ll(){var e=qn;return qn<<=1,(qn&62914560)===0&&(qn=4194304),e}function Rr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Gn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ol(e,t,i,l,p,w){var B=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var P=e.entanglements,Q=e.expirationTimes,ae=e.hiddenUpdates;for(i=B&~i;0<i;){var me=31-qe(i),_e=1<<me;P[me]=0,Q[me]=-1;var oe=ae[me];if(oe!==null)for(ae[me]=null,me=0;me<oe.length;me++){var he=oe[me];he!==null&&(he.lane&=-536870913)}i&=~_e}l!==0&&Bl(e,l,0),w!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=w&~(B&~t))}function Bl(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-qe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function sr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-qe(i),p=1<<l;p&t|e[l]&t&&(e[l]|=t),i&=~p}}function ys(e,t){var i=t&-t;return i=(i&42)!==0?1:Dr(i),(i&(e.suspendedLanes|t))!==0?0:i}function Dr(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 St(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ss(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:em(e.type))}function Bn(e,t){var i=K.p;try{return K.p=e,t()}finally{K.p=i}}var rn=Math.random().toString(36).slice(2),yt="__reactFiber$"+rn,Rt="__reactProps$"+rn,jn="__reactContainer$"+rn,te="__reactEvents$"+rn,Xt="__reactListeners$"+rn,bs="__reactHandles$"+rn,Cs="__reactResources$"+rn,Nn="__reactMarker$"+rn;function lr(e){delete e[yt],delete e[Rt],delete e[te],delete e[Xt],delete e[bs]}function ei(e){var t=e[yt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[jn]||i[yt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=zp(e);e!==null;){if(i=e[yt])return i;e=zp(e)}return t}e=i,i=e.parentNode}return null}function bi(e){if(e=e[yt]||e[jn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ar(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Dt(e){var t=e[Cs];return t||(t=e[Cs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Nn]=!0}var ws=new Set,xs={};function Hn(e,t){Ci(e,t),Ci(e+"Capture",t)}function Ci(e,t){for(xs[e]=t,e=0;e<t.length;e++)ws.add(t[e])}var Mr=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]*$"),jl={},Nl={};function go(e){return qt.call(Nl,e)?!0:qt.call(jl,e)?!1:Mr.test(e)?Nl[e]=!0:(jl[e]=!0,!1)}function Lr(e,t,i){if(go(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Or(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 Qt(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}function Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wi(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Es(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,w=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return p.call(this)},set:function(B){i=""+B,w.call(this,B)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(B){i=""+B},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ks(e){if(!e._valueTracker){var t=wi(e)?"checked":"value";e._valueTracker=Es(e,t,""+e[t])}}function or(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=wi(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function xi(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 As=/[\n"\\]/g;function xt(e){return e.replace(As,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ei(e,t,i,l,p,w,B,P){e.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.type=B:e.removeAttribute("type"),t!=null?B==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),t!=null?zn(e,B,Ht(t)):i!=null?zn(e,B,Ht(i)):l!=null&&e.removeAttribute("value"),p==null&&w!=null&&(e.defaultChecked=!!w),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+Ht(P):e.removeAttribute("name")}function Vn(e,t,i,l,p,w,B,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.type=w),t!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||t!=null)){ks(e);return}i=i!=null?""+Ht(i):"",t=t!=null?""+Ht(t):i,P||t===e.value||(e.value=t),e.defaultValue=t}l=l??p,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=P?e.checked:!!l,e.defaultChecked=!!l,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(e.name=B),ks(e)}function zn(e,t,i){t==="number"&&xi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ki(e,t,i,l){if(e=e.options,t){t={};for(var p=0;p<i.length;p++)t["$"+i[p]]=!0;for(i=0;i<e.length;i++)p=t.hasOwnProperty("$"+e[i].value),e[i].selected!==p&&(e[i].selected=p),p&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ht(i),t=null,p=0;p<e.length;p++){if(e[p].value===i){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}t!==null||e[p].disabled||(t=e[p])}t!==null&&(t.selected=!0)}}function Ts(e,t,i){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ht(i):""}function Ne(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(o(92));if(Y(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=Ht(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),ks(e)}function Ai(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 Hl(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||_o.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function zl(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var p in t)l=t[p],t.hasOwnProperty(p)&&i[p]!==l&&Hl(e,p,l)}else for(var w in t)t.hasOwnProperty(w)&&Hl(e,w,t[w])}function cr(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 Il=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"]]),$=/^[\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 pe(e){return $.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function We(){}var st=null;function ti(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dn=null,Ti=null;function Th(e){var t=bi(e);if(t&&(e=t.stateNode)){var i=e[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ei(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="'+xt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var p=l[Rt]||null;if(!p)throw Error(o(90));Ei(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&or(l)}break e;case"textarea":Ts(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ki(e,!!i.multiple,t,!1)}}}var vo=!1;function Rh(e,t,i){if(vo)return e(t,i);vo=!0;try{var l=e(t);return l}finally{if(vo=!1,(dn!==null||Ti!==null)&&(ka(),dn&&(t=dn,e=Ti,Ti=dn=null,Th(t),e)))for(t=0;t<e.length;t++)Th(e[t])}}function Rs(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Rt]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yo=!1;if(ni)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){yo=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{yo=!1}var Ri=null,So=null,Ul=null;function Dh(){if(Ul)return Ul;var e,t=So,i=t.length,l,p="value"in Ri?Ri.value:Ri.textContent,w=p.length;for(e=0;e<i&&t[e]===p[e];e++);var B=i-e;for(l=1;l<=B&&t[i-l]===p[w-l];l++);return Ul=p.slice(e,1<l?1-l:void 0)}function Pl(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 Fl(){return!0}function Mh(){return!1}function sn(e){function t(i,l,p,w,B){this._reactName=i,this._targetInst=p,this.type=l,this.nativeEvent=w,this.target=B,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(i=e[P],this[P]=i?i(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Fl:Mh,this.isPropagationStopped=Mh,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=Fl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),t}var ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=sn(ur),Ms=u({},ur,{view:0,detail:0}),X_=sn(Ms),bo,Co,Ls,Gl=u({},Ms,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xo,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!==Ls&&(Ls&&e.type==="mousemove"?(bo=e.screenX-Ls.screenX,Co=e.screenY-Ls.screenY):Co=bo=0,Ls=e),bo)},movementY:function(e){return"movementY"in e?e.movementY:Co}}),Lh=sn(Gl),Q_=u({},Gl,{dataTransfer:0}),Z_=sn(Q_),J_=u({},Ms,{relatedTarget:0}),wo=sn(J_),ev=u({},ur,{animationName:0,elapsedTime:0,pseudoElement:0}),tv=sn(ev),nv=u({},ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),iv=sn(nv),rv=u({},ur,{data:0}),Oh=sn(rv),sv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lv={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"},av={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ov(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=av[e])?!!t[e]:!1}function xo(){return ov}var cv=u({},Ms,{key:function(e){if(e.key){var t=sv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xo,charCode:function(e){return e.type==="keypress"?Pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uv=sn(cv),hv=u({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bh=sn(hv),fv=u({},Ms,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xo}),dv=sn(fv),pv=u({},ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),mv=sn(pv),gv=u({},Gl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_v=sn(gv),vv=u({},ur,{newState:0,oldState:0}),yv=sn(vv),Sv=[9,13,27,32],Eo=ni&&"CompositionEvent"in window,Os=null;ni&&"documentMode"in document&&(Os=document.documentMode);var bv=ni&&"TextEvent"in window&&!Os,jh=ni&&(!Eo||Os&&8<Os&&11>=Os),Nh=" ",Hh=!1;function zh(e,t){switch(e){case"keyup":return Sv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ih(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function Cv(e,t){switch(e){case"compositionend":return Ih(t);case"keypress":return t.which!==32?null:(Hh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Hh?null:e;default:return null}}function wv(e,t){if(Br)return e==="compositionend"||!Eo&&zh(e,t)?(e=Dh(),Ul=So=Ri=null,Br=!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 jh&&t.locale!=="ko"?null:t.data;default:return null}}var xv={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xv[e.type]:t==="textarea"}function Ph(e,t,i,l){dn?Ti?Ti.push(l):Ti=[l]:dn=l,t=Oa(t,"onChange"),0<t.length&&(i=new ql("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Bs=null,js=null;function Ev(e){xp(e,0)}function Vl(e){var t=ar(e);if(or(t))return e}function Fh(e,t){if(e==="change")return t}var qh=!1;if(ni){var ko;if(ni){var Ao="oninput"in document;if(!Ao){var Gh=document.createElement("div");Gh.setAttribute("oninput","return;"),Ao=typeof Gh.oninput=="function"}ko=Ao}else ko=!1;qh=ko&&(!document.documentMode||9<document.documentMode)}function Vh(){Bs&&(Bs.detachEvent("onpropertychange",$h),js=Bs=null)}function $h(e){if(e.propertyName==="value"&&Vl(js)){var t=[];Ph(t,js,e,ti(e)),Rh(Ev,t)}}function kv(e,t,i){e==="focusin"?(Vh(),Bs=t,js=i,Bs.attachEvent("onpropertychange",$h)):e==="focusout"&&Vh()}function Av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(js)}function Tv(e,t){if(e==="click")return Vl(t)}function Rv(e,t){if(e==="input"||e==="change")return Vl(t)}function Dv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pn=typeof Object.is=="function"?Object.is:Dv;function Ns(e,t){if(pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var p=i[l];if(!qt.call(t,p)||!pn(e[p],t[p]))return!1}return!0}function Wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kh(e,t){var i=Wh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wh(i)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xi(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=xi(e.document)}return t}function To(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 Mv=ni&&"documentMode"in document&&11>=document.documentMode,jr=null,Ro=null,Hs=null,Do=!1;function Qh(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Do||jr==null||jr!==xi(l)||(l=jr,"selectionStart"in l&&To(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Hs&&Ns(Hs,l)||(Hs=l,l=Oa(Ro,"onSelect"),0<l.length&&(t=new ql("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=jr)))}function hr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Nr={animationend:hr("Animation","AnimationEnd"),animationiteration:hr("Animation","AnimationIteration"),animationstart:hr("Animation","AnimationStart"),transitionrun:hr("Transition","TransitionRun"),transitionstart:hr("Transition","TransitionStart"),transitioncancel:hr("Transition","TransitionCancel"),transitionend:hr("Transition","TransitionEnd")},Mo={},Zh={};ni&&(Zh=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function fr(e){if(Mo[e])return Mo[e];if(!Nr[e])return e;var t=Nr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Zh)return Mo[e]=t[i];return e}var Jh=fr("animationend"),ef=fr("animationiteration"),tf=fr("animationstart"),Lv=fr("transitionrun"),Ov=fr("transitionstart"),Bv=fr("transitioncancel"),nf=fr("transitionend"),rf=new Map,Lo="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(" ");Lo.push("scrollEnd");function In(e,t){rf.set(e,t),Hn(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)},xn=[],Hr=0,Oo=0;function Wl(){for(var e=Hr,t=Oo=Hr=0;t<e;){var i=xn[t];xn[t++]=null;var l=xn[t];xn[t++]=null;var p=xn[t];xn[t++]=null;var w=xn[t];if(xn[t++]=null,l!==null&&p!==null){var B=l.pending;B===null?p.next=p:(p.next=B.next,B.next=p),l.pending=p}w!==0&&sf(i,p,w)}}function Kl(e,t,i,l){xn[Hr++]=e,xn[Hr++]=t,xn[Hr++]=i,xn[Hr++]=l,Oo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Bo(e,t,i,l){return Kl(e,t,i,l),Yl(e)}function dr(e,t){return Kl(e,null,null,t),Yl(e)}function sf(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var p=!1,w=e.return;w!==null;)w.childLanes|=i,l=w.alternate,l!==null&&(l.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(p=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,p&&t!==null&&(p=31-qe(i),e=w.hiddenUpdates,l=e[p],l===null?e[p]=[t]:l.push(t),t.lane=i|536870912),w):null}function Yl(e){if(50<sl)throw sl=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zr={};function jv(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,i,l){return new jv(e,t,i,l)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var i=e.alternate;return i===null?(i=mn(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 Xl(e,t,i,l,p,w){var B=0;if(l=e,typeof e=="function")jo(e)&&(B=1);else if(typeof e=="string")B=U0(e,i,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=mn(31,i,t,p),e.elementType=L,e.lanes=w,e;case x:return pr(i.children,p,w,t);case y:B=8,p|=24;break;case v:return e=mn(12,i,t,p|2),e.elementType=v,e.lanes=w,e;case M:return e=mn(13,i,t,p),e.elementType=M,e.lanes=w,e;case R:return e=mn(19,i,t,p),e.elementType=R,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:B=10;break e;case m:B=9;break e;case k:B=11;break e;case D:B=14;break e;case E:B=16,l=null;break e}B=29,i=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=mn(B,i,t,p),t.elementType=e,t.type=l,t.lanes=w,t}function pr(e,t,i,l){return e=mn(7,e,l,t),e.lanes=i,e}function No(e,t,i){return e=mn(6,e,null,t),e.lanes=i,e}function af(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function Ho(e,t,i){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function En(e,t){if(typeof e=="object"&&e!==null){var i=of.get(e);return i!==void 0?i:(t={value:e,source:t,stack:en(t)},of.set(e,t),t)}return{value:e,source:t,stack:en(t)}}var Ir=[],Ur=0,Ql=null,zs=0,kn=[],An=0,Di=null,$n=1,Wn="";function ri(e,t){Ir[Ur++]=zs,Ir[Ur++]=Ql,Ql=e,zs=t}function cf(e,t,i){kn[An++]=$n,kn[An++]=Wn,kn[An++]=Di,Di=e;var l=$n;e=Wn;var p=32-qe(l)-1;l&=~(1<<p),i+=1;var w=32-qe(t)+p;if(30<w){var B=p-p%5;w=(l&(1<<B)-1).toString(32),l>>=B,p-=B,$n=1<<32-qe(t)+p|i<<p|l,Wn=w+e}else $n=1<<w|i<<p|l,Wn=e}function zo(e){e.return!==null&&(ri(e,1),cf(e,1,0))}function Io(e){for(;e===Ql;)Ql=Ir[--Ur],Ir[Ur]=null,zs=Ir[--Ur],Ir[Ur]=null;for(;e===Di;)Di=kn[--An],kn[An]=null,Wn=kn[--An],kn[An]=null,$n=kn[--An],kn[An]=null}function uf(e,t){kn[An++]=$n,kn[An++]=Wn,kn[An++]=Di,$n=t.id,Wn=t.overflow,Di=e}var It=null,gt=null,Xe=!1,Mi=null,Tn=!1,Uo=Error(o(519));function Li(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Is(En(t,e)),Uo}function hf(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[yt]=e,t[Rt]=l,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<al.length;i++)Ve(al[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),Vn(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Ne(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||Tp(t.textContent,i)?(l.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),l.onScroll!=null&&Ve("scroll",t),l.onScrollEnd!=null&&Ve("scrollend",t),l.onClick!=null&&(t.onclick=We),t=!0):t=!1,t||Li(e,!0)}function ff(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:It=It.return}}function Pr(e){if(e!==It)return!1;if(!Xe)return ff(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")||ru(e.type,e.memoizedProps)),i=!i),i&&gt&&Li(e),ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));gt=Hp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));gt=Hp(e)}else t===27?(t=gt,$i(e.type)?(e=cu,cu=null,gt=e):gt=t):gt=It?Dn(e.stateNode.nextSibling):null;return!0}function mr(){gt=It=null,Xe=!1}function Po(){var e=Mi;return e!==null&&(cn===null?cn=e:cn.push.apply(cn,e),Mi=null),e}function Is(e){Mi===null?Mi=[e]:Mi.push(e)}var Fo=H(null),gr=null,si=null;function Oi(e,t,i){N(Fo,t._currentValue),t._currentValue=i}function li(e){e._currentValue=Fo.current,G(Fo)}function qo(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Go(e,t,i,l){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var w=p.dependencies;if(w!==null){var B=p.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=p;for(var Q=0;Q<t.length;Q++)if(P.context===t[Q]){w.lanes|=i,P=w.alternate,P!==null&&(P.lanes|=i),qo(w.return,i,e),l||(B=null);break e}w=P.next}}else if(p.tag===18){if(B=p.return,B===null)throw Error(o(341));B.lanes|=i,w=B.alternate,w!==null&&(w.lanes|=i),qo(B,i,e),B=null}else B=p.child;if(B!==null)B.return=p;else for(B=p;B!==null;){if(B===e){B=null;break}if(p=B.sibling,p!==null){p.return=B.return,B=p;break}B=B.return}p=B}}function Fr(e,t,i,l){e=null;for(var p=t,w=!1;p!==null;){if(!w){if((p.flags&524288)!==0)w=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var B=p.alternate;if(B===null)throw Error(o(387));if(B=B.memoizedProps,B!==null){var P=p.type;pn(p.pendingProps.value,B.value)||(e!==null?e.push(P):e=[P])}}else if(p===X.current){if(B=p.alternate,B===null)throw Error(o(387));B.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(fl):e=[fl])}p=p.return}e!==null&&Go(t,e,i,l),t.flags|=262144}function Zl(e){for(e=e.firstContext;e!==null;){if(!pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _r(e){gr=e,si=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return df(gr,e)}function Jl(e,t){return gr===null&&_r(e),df(e,t)}function df(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},si===null){if(e===null)throw Error(o(308));si=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else si=si.next=t;return i}var Nv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Hv=n.unstable_scheduleCallback,zv=n.unstable_NormalPriority,Mt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vo(){return{controller:new Nv,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&Hv(zv,function(){e.controller.abort()})}var Ps=null,$o=0,qr=0,Gr=null;function Iv(e,t){if(Ps===null){var i=Ps=[];$o=0,qr=Yc(),Gr={status:"pending",value:void 0,then:function(l){i.push(l)}}}return $o++,t.then(pf,pf),t}function pf(){if(--$o===0&&Ps!==null){Gr!==null&&(Gr.status="fulfilled");var e=Ps;Ps=null,qr=0,Gr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Uv(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var p=0;p<i.length;p++)(0,i[p])(t)},function(p){for(l.status="rejected",l.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),l}var mf=V.S;V.S=function(e,t){Zd=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Iv(e,t),mf!==null&&mf(e,t)};var vr=H(null);function Wo(){var e=vr.current;return e!==null?e:ct.pooledCache}function ea(e,t){t===null?N(vr,vr.current):N(vr,t.pool)}function gf(){var e=Wo();return e===null?null:{parent:Mt._currentValue,pool:e}}var Vr=Error(o(460)),Ko=Error(o(474)),ta=Error(o(542)),na={then:function(){}};function _f(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(We,We),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sf(e),e;default:if(typeof t.status=="string")t.then(We,We);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var p=t;p.status="fulfilled",p.value=l}},function(l){if(t.status==="pending"){var p=t;p.status="rejected",p.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sf(e),e}throw Sr=t,Vr}}function yr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Sr=i,Vr):i}}var Sr=null;function yf(){if(Sr===null)throw Error(o(459));var e=Sr;return Sr=null,e}function Sf(e){if(e===Vr||e===ta)throw Error(o(483))}var $r=null,Fs=0;function ia(e){var t=Fs;return Fs+=1,$r===null&&($r=[]),vf($r,e,t)}function qs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ra(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bf(e){function t(ie,ee){if(e){var le=ie.deletions;le===null?(ie.deletions=[ee],ie.flags|=16):le.push(ee)}}function i(ie,ee){if(!e)return null;for(;ee!==null;)t(ie,ee),ee=ee.sibling;return null}function l(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function p(ie,ee){return ie=ii(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,le){return ie.index=le,e?(le=ie.alternate,le!==null?(le=le.index,le<ee?(ie.flags|=67108866,ee):le):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function B(ie){return e&&ie.alternate===null&&(ie.flags|=67108866),ie}function P(ie,ee,le,ge){return ee===null||ee.tag!==6?(ee=No(le,ie.mode,ge),ee.return=ie,ee):(ee=p(ee,le),ee.return=ie,ee)}function Q(ie,ee,le,ge){var De=le.type;return De===x?me(ie,ee,le.props.children,ge,le.key):ee!==null&&(ee.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===E&&yr(De)===ee.type)?(ee=p(ee,le.props),qs(ee,le),ee.return=ie,ee):(ee=Xl(le.type,le.key,le.props,null,ie.mode,ge),qs(ee,le),ee.return=ie,ee)}function ae(ie,ee,le,ge){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==le.containerInfo||ee.stateNode.implementation!==le.implementation?(ee=Ho(le,ie.mode,ge),ee.return=ie,ee):(ee=p(ee,le.children||[]),ee.return=ie,ee)}function me(ie,ee,le,ge,De){return ee===null||ee.tag!==7?(ee=pr(le,ie.mode,ge,De),ee.return=ie,ee):(ee=p(ee,le),ee.return=ie,ee)}function _e(ie,ee,le){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=No(""+ee,ie.mode,le),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case C:return le=Xl(ee.type,ee.key,ee.props,null,ie.mode,le),qs(le,ee),le.return=ie,le;case A:return ee=Ho(ee,ie.mode,le),ee.return=ie,ee;case E:return ee=yr(ee),_e(ie,ee,le)}if(Y(ee)||F(ee))return ee=pr(ee,ie.mode,le,null),ee.return=ie,ee;if(typeof ee.then=="function")return _e(ie,ia(ee),le);if(ee.$$typeof===S)return _e(ie,Jl(ie,ee),le);ra(ie,ee)}return null}function oe(ie,ee,le,ge){var De=ee!==null?ee.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return De!==null?null:P(ie,ee,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===De?Q(ie,ee,le,ge):null;case A:return le.key===De?ae(ie,ee,le,ge):null;case E:return le=yr(le),oe(ie,ee,le,ge)}if(Y(le)||F(le))return De!==null?null:me(ie,ee,le,ge,null);if(typeof le.then=="function")return oe(ie,ee,ia(le),ge);if(le.$$typeof===S)return oe(ie,ee,Jl(ie,le),ge);ra(ie,le)}return null}function he(ie,ee,le,ge,De){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ie=ie.get(le)||null,P(ee,ie,""+ge,De);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case C:return ie=ie.get(ge.key===null?le:ge.key)||null,Q(ee,ie,ge,De);case A:return ie=ie.get(ge.key===null?le:ge.key)||null,ae(ee,ie,ge,De);case E:return ge=yr(ge),he(ie,ee,le,ge,De)}if(Y(ge)||F(ge))return ie=ie.get(le)||null,me(ee,ie,ge,De,null);if(typeof ge.then=="function")return he(ie,ee,le,ia(ge),De);if(ge.$$typeof===S)return he(ie,ee,le,Jl(ee,ge),De);ra(ee,ge)}return null}function Ae(ie,ee,le,ge){for(var De=null,Ze=null,Te=ee,Pe=ee=0,Ye=null;Te!==null&&Pe<le.length;Pe++){Te.index>Pe?(Ye=Te,Te=null):Ye=Te.sibling;var Je=oe(ie,Te,le[Pe],ge);if(Je===null){Te===null&&(Te=Ye);break}e&&Te&&Je.alternate===null&&t(ie,Te),ee=w(Je,ee,Pe),Ze===null?De=Je:Ze.sibling=Je,Ze=Je,Te=Ye}if(Pe===le.length)return i(ie,Te),Xe&&ri(ie,Pe),De;if(Te===null){for(;Pe<le.length;Pe++)Te=_e(ie,le[Pe],ge),Te!==null&&(ee=w(Te,ee,Pe),Ze===null?De=Te:Ze.sibling=Te,Ze=Te);return Xe&&ri(ie,Pe),De}for(Te=l(Te);Pe<le.length;Pe++)Ye=he(Te,ie,Pe,le[Pe],ge),Ye!==null&&(e&&Ye.alternate!==null&&Te.delete(Ye.key===null?Pe:Ye.key),ee=w(Ye,ee,Pe),Ze===null?De=Ye:Ze.sibling=Ye,Ze=Ye);return e&&Te.forEach(function(Qi){return t(ie,Qi)}),Xe&&ri(ie,Pe),De}function Oe(ie,ee,le,ge){if(le==null)throw Error(o(151));for(var De=null,Ze=null,Te=ee,Pe=ee=0,Ye=null,Je=le.next();Te!==null&&!Je.done;Pe++,Je=le.next()){Te.index>Pe?(Ye=Te,Te=null):Ye=Te.sibling;var Qi=oe(ie,Te,Je.value,ge);if(Qi===null){Te===null&&(Te=Ye);break}e&&Te&&Qi.alternate===null&&t(ie,Te),ee=w(Qi,ee,Pe),Ze===null?De=Qi:Ze.sibling=Qi,Ze=Qi,Te=Ye}if(Je.done)return i(ie,Te),Xe&&ri(ie,Pe),De;if(Te===null){for(;!Je.done;Pe++,Je=le.next())Je=_e(ie,Je.value,ge),Je!==null&&(ee=w(Je,ee,Pe),Ze===null?De=Je:Ze.sibling=Je,Ze=Je);return Xe&&ri(ie,Pe),De}for(Te=l(Te);!Je.done;Pe++,Je=le.next())Je=he(Te,ie,Pe,Je.value,ge),Je!==null&&(e&&Je.alternate!==null&&Te.delete(Je.key===null?Pe:Je.key),ee=w(Je,ee,Pe),Ze===null?De=Je:Ze.sibling=Je,Ze=Je);return e&&Te.forEach(function(Q0){return t(ie,Q0)}),Xe&&ri(ie,Pe),De}function ot(ie,ee,le,ge){if(typeof le=="object"&&le!==null&&le.type===x&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var De=le.key;ee!==null;){if(ee.key===De){if(De=le.type,De===x){if(ee.tag===7){i(ie,ee.sibling),ge=p(ee,le.props.children),ge.return=ie,ie=ge;break e}}else if(ee.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===E&&yr(De)===ee.type){i(ie,ee.sibling),ge=p(ee,le.props),qs(ge,le),ge.return=ie,ie=ge;break e}i(ie,ee);break}else t(ie,ee);ee=ee.sibling}le.type===x?(ge=pr(le.props.children,ie.mode,ge,le.key),ge.return=ie,ie=ge):(ge=Xl(le.type,le.key,le.props,null,ie.mode,ge),qs(ge,le),ge.return=ie,ie=ge)}return B(ie);case A:e:{for(De=le.key;ee!==null;){if(ee.key===De)if(ee.tag===4&&ee.stateNode.containerInfo===le.containerInfo&&ee.stateNode.implementation===le.implementation){i(ie,ee.sibling),ge=p(ee,le.children||[]),ge.return=ie,ie=ge;break e}else{i(ie,ee);break}else t(ie,ee);ee=ee.sibling}ge=Ho(le,ie.mode,ge),ge.return=ie,ie=ge}return B(ie);case E:return le=yr(le),ot(ie,ee,le,ge)}if(Y(le))return Ae(ie,ee,le,ge);if(F(le)){if(De=F(le),typeof De!="function")throw Error(o(150));return le=De.call(le),Oe(ie,ee,le,ge)}if(typeof le.then=="function")return ot(ie,ee,ia(le),ge);if(le.$$typeof===S)return ot(ie,ee,Jl(ie,le),ge);ra(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ee!==null&&ee.tag===6?(i(ie,ee.sibling),ge=p(ee,le),ge.return=ie,ie=ge):(i(ie,ee),ge=No(le,ie.mode,ge),ge.return=ie,ie=ge),B(ie)):i(ie,ee)}return function(ie,ee,le,ge){try{Fs=0;var De=ot(ie,ee,le,ge);return $r=null,De}catch(Te){if(Te===Vr||Te===ta)throw Te;var Ze=mn(29,Te,null,ie.mode);return Ze.lanes=ge,Ze.return=ie,Ze}finally{}}}var br=bf(!0),Cf=bf(!1),Bi=!1;function Yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xo(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 ji(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ni(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(tt&2)!==0){var p=l.pending;return p===null?t.next=t:(t.next=p.next,p.next=t),l.pending=t,t=Yl(e),sf(e,null,i),t}return Kl(e,l,t,i),Yl(e)}function Gs(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,sr(e,i)}}function Qo(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var p=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var B={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?p=w=B:w=w.next=B,i=i.next}while(i!==null);w===null?p=w=t:w=w.next=t}else p=w=t;i={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Zo=!1;function Vs(){if(Zo){var e=Gr;if(e!==null)throw e}}function $s(e,t,i,l){Zo=!1;var p=e.updateQueue;Bi=!1;var w=p.firstBaseUpdate,B=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var Q=P,ae=Q.next;Q.next=null,B===null?w=ae:B.next=ae,B=Q;var me=e.alternate;me!==null&&(me=me.updateQueue,P=me.lastBaseUpdate,P!==B&&(P===null?me.firstBaseUpdate=ae:P.next=ae,me.lastBaseUpdate=Q))}if(w!==null){var _e=p.baseState;B=0,me=ae=Q=null,P=w;do{var oe=P.lane&-536870913,he=oe!==P.lane;if(he?(Ke&oe)===oe:(l&oe)===oe){oe!==0&&oe===qr&&(Zo=!0),me!==null&&(me=me.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ae=e,Oe=P;oe=t;var ot=i;switch(Oe.tag){case 1:if(Ae=Oe.payload,typeof Ae=="function"){_e=Ae.call(ot,_e,oe);break e}_e=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Oe.payload,oe=typeof Ae=="function"?Ae.call(ot,_e,oe):Ae,oe==null)break e;_e=u({},_e,oe);break e;case 2:Bi=!0}}oe=P.callback,oe!==null&&(e.flags|=64,he&&(e.flags|=8192),he=p.callbacks,he===null?p.callbacks=[oe]:he.push(oe))}else he={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},me===null?(ae=me=he,Q=_e):me=me.next=he,B|=oe;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;he=P,P=he.next,he.next=null,p.lastBaseUpdate=he,p.shared.pending=null}}while(!0);me===null&&(Q=_e),p.baseState=Q,p.firstBaseUpdate=ae,p.lastBaseUpdate=me,w===null&&(p.shared.lanes=0),Pi|=B,e.lanes=B,e.memoizedState=_e}}function wf(e,t){if(typeof e!="function")throw Error(o(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++)wf(i[e],t)}var Wr=H(null),sa=H(0);function Ef(e,t){e=mi,N(sa,e),N(Wr,t),mi=e|t.baseLanes}function Jo(){N(sa,mi),N(Wr,Wr.current)}function ec(){mi=sa.current,G(Wr),G(sa)}var gn=H(null),Rn=null;function Hi(e){var t=e.alternate;N(Et,Et.current&1),N(gn,e),Rn===null&&(t===null||Wr.current!==null||t.memoizedState!==null)&&(Rn=e)}function tc(e){N(Et,Et.current),N(gn,e),Rn===null&&(Rn=e)}function kf(e){e.tag===22?(N(Et,Et.current),N(gn,e),Rn===null&&(Rn=e)):zi()}function zi(){N(Et,Et.current),N(gn,gn.current)}function _n(e){G(gn),Rn===e&&(Rn=null),G(Et)}var Et=H(0);function la(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||au(i)||ou(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,lt=null,Lt=null,aa=!1,Kr=!1,Cr=!1,oa=0,Ws=0,Yr=null,Pv=0;function bt(){throw Error(o(321))}function nc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!pn(e[i],t[i]))return!1;return!0}function ic(e,t,i,l,p,w){return ai=w,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?cd:vc,Cr=!1,w=i(l,p),Cr=!1,Kr&&(w=Tf(t,i,l,p)),Af(e),w}function Af(e){V.H=Xs;var t=lt!==null&&lt.next!==null;if(ai=0,Lt=lt=Ie=null,aa=!1,Ws=0,Yr=null,t)throw Error(o(300));e===null||Ot||(e=e.dependencies,e!==null&&Zl(e)&&(Ot=!0))}function Tf(e,t,i,l){Ie=e;var p=0;do{if(Kr&&(Yr=null),Ws=0,Kr=!1,25<=p)throw Error(o(301));if(p+=1,Lt=lt=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}V.H=ud,w=t(i,l)}while(Kr);return w}function Fv(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?Ks(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Ie.flags|=1024),t}function rc(){var e=oa!==0;return oa=0,e}function sc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function lc(e){if(aa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}aa=!1}ai=0,Lt=lt=Ie=null,Kr=!1,Ws=oa=0,Yr=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?Ie.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function kt(){if(lt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Lt===null?Ie.memoizedState:Lt.next;if(t!==null)Lt=t,lt=e;else{if(e===null)throw Ie.alternate===null?Error(o(467)):Error(o(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Lt===null?Ie.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function ca(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(e){var t=Ws;return Ws+=1,Yr===null&&(Yr=[]),e=vf(Yr,e,t),t=Ie,(Lt===null?t.memoizedState:Lt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?cd:vc),e}function ua(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ks(e);if(e.$$typeof===S)return Ut(e)}throw Error(o(438,String(e)))}function ac(e){var t=null,i=Ie.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=Ie.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(p){return p.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=ca(),Ie.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=O;return t.index++,i}function oi(e,t){return typeof t=="function"?t(e):t}function ha(e){var t=kt();return oc(t,lt,e)}function oc(e,t,i){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var p=e.baseQueue,w=l.pending;if(w!==null){if(p!==null){var B=p.next;p.next=w.next,w.next=B}t.baseQueue=p=w,l.pending=null}if(w=e.baseState,p===null)e.memoizedState=w;else{t=p.next;var P=B=null,Q=null,ae=t,me=!1;do{var _e=ae.lane&-536870913;if(_e!==ae.lane?(Ke&_e)===_e:(ai&_e)===_e){var oe=ae.revertLane;if(oe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),_e===qr&&(me=!0);else if((ai&oe)===oe){ae=ae.next,oe===qr&&(me=!0);continue}else _e={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=_e,B=w):Q=Q.next=_e,Ie.lanes|=oe,Pi|=oe;_e=ae.action,Cr&&i(w,_e),w=ae.hasEagerState?ae.eagerState:i(w,_e)}else oe={lane:_e,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=oe,B=w):Q=Q.next=oe,Ie.lanes|=_e,Pi|=_e;ae=ae.next}while(ae!==null&&ae!==t);if(Q===null?B=w:Q.next=P,!pn(w,e.memoizedState)&&(Ot=!0,me&&(i=Gr,i!==null)))throw i;e.memoizedState=w,e.baseState=B,e.baseQueue=Q,l.lastRenderedState=w}return p===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function cc(e){var t=kt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,p=i.pending,w=t.memoizedState;if(p!==null){i.pending=null;var B=p=p.next;do w=e(w,B.action),B=B.next;while(B!==p);pn(w,t.memoizedState)||(Ot=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,l]}function Rf(e,t,i){var l=Ie,p=kt(),w=Xe;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=t();var B=!pn((lt||p).memoizedState,i);if(B&&(p.memoizedState=i,Ot=!0),p=p.queue,fc(Lf.bind(null,l,p,e),[e]),p.getSnapshot!==t||B||Lt!==null&&Lt.memoizedState.tag&1){if(l.flags|=2048,Xr(9,{destroy:void 0},Mf.bind(null,l,p,i,t),null),ct===null)throw Error(o(349));w||(ai&127)!==0||Df(l,t,i)}return i}function Df(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ie.updateQueue,t===null?(t=ca(),Ie.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Mf(e,t,i,l){t.value=i,t.getSnapshot=l,Of(t)&&Bf(e)}function Lf(e,t,i){return i(function(){Of(t)&&Bf(e)})}function Of(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!pn(e,i)}catch{return!0}}function Bf(e){var t=dr(e,2);t!==null&&un(t,e,2)}function uc(e){var t=Zt();if(typeof e=="function"){var i=e;if(e=i(),Cr){ht(!0);try{i()}finally{ht(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:e},t}function jf(e,t,i,l){return e.baseState=i,oc(e,lt,typeof l=="function"?l:oi)}function qv(e,t,i,l,p){if(pa(e))throw Error(o(485));if(e=t.action,e!==null){var w={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){w.listeners.push(B)}};V.T!==null?i(!0):w.isTransition=!1,l(w),i=t.pending,i===null?(w.next=t.pending=w,Nf(t,w)):(w.next=i.next,t.pending=i.next=w)}}function Nf(e,t){var i=t.action,l=t.payload,p=e.state;if(t.isTransition){var w=V.T,B={};V.T=B;try{var P=i(p,l),Q=V.S;Q!==null&&Q(B,P),Hf(e,t,P)}catch(ae){hc(e,t,ae)}finally{w!==null&&B.types!==null&&(w.types=B.types),V.T=w}}else try{w=i(p,l),Hf(e,t,w)}catch(ae){hc(e,t,ae)}}function Hf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){zf(e,t,l)},function(l){return hc(e,t,l)}):zf(e,t,i)}function zf(e,t,i){t.status="fulfilled",t.value=i,If(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Nf(e,i)))}function hc(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,If(t),t=t.next;while(t!==l)}e.action=null}function If(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uf(e,t){return t}function Pf(e,t){if(Xe){var i=ct.formState;if(i!==null){e:{var l=Ie;if(Xe){if(gt){t:{for(var p=gt,w=Tn;p.nodeType!==8;){if(!w){p=null;break t}if(p=Dn(p.nextSibling),p===null){p=null;break t}}w=p.data,p=w==="F!"||w==="F"?p:null}if(p){gt=Dn(p.nextSibling),l=p.data==="F!";break e}}Li(l)}l=!1}l&&(t=i[0])}}return i=Zt(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:t},i.queue=l,i=ld.bind(null,Ie,l),l.dispatch=i,l=uc(!1),w=_c.bind(null,Ie,!1,l.queue),l=Zt(),p={state:t,dispatch:null,action:e,pending:null},l.queue=p,i=qv.bind(null,Ie,p,w,i),p.dispatch=i,l.memoizedState=e,[t,i,!1]}function Ff(e){var t=kt();return qf(t,lt,e)}function qf(e,t,i){if(t=oc(e,t,Uf)[0],e=ha(oi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ks(t)}catch(B){throw B===Vr?ta:B}else l=t;t=kt();var p=t.queue,w=p.dispatch;return i!==t.memoizedState&&(Ie.flags|=2048,Xr(9,{destroy:void 0},Gv.bind(null,p,i),null)),[l,w,e]}function Gv(e,t){e.action=t}function Gf(e){var t=kt(),i=lt;if(i!==null)return qf(t,i,e);kt(),t=t.memoizedState,i=kt();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Xr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=Ie.updateQueue,t===null&&(t=ca(),Ie.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Vf(){return kt().memoizedState}function fa(e,t,i,l){var p=Zt();Ie.flags|=e,p.memoizedState=Xr(1|t,{destroy:void 0},i,l===void 0?null:l)}function da(e,t,i,l){var p=kt();l=l===void 0?null:l;var w=p.memoizedState.inst;lt!==null&&l!==null&&nc(l,lt.memoizedState.deps)?p.memoizedState=Xr(t,w,i,l):(Ie.flags|=e,p.memoizedState=Xr(1|t,w,i,l))}function $f(e,t){fa(8390656,8,e,t)}function fc(e,t){da(2048,8,e,t)}function Vv(e){Ie.flags|=4;var t=Ie.updateQueue;if(t===null)t=ca(),Ie.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Wf(e){var t=kt().memoizedState;return Vv({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Kf(e,t){return da(4,2,e,t)}function Yf(e,t){return da(4,4,e,t)}function Xf(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 Qf(e,t,i){i=i!=null?i.concat([e]):null,da(4,4,Xf.bind(null,t,e),i)}function dc(){}function Zf(e,t){var i=kt();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&nc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Jf(e,t){var i=kt();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&nc(t,l[1]))return l[0];if(l=e(),Cr){ht(!0);try{e()}finally{ht(!1)}}return i.memoizedState=[l,t],l}function pc(e,t,i){return i===void 0||(ai&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=ep(),Ie.lanes|=e,Pi|=e,i)}function ed(e,t,i,l){return pn(i,t)?i:Wr.current!==null?(e=pc(e,i,l),pn(e,t)||(Ot=!0),e):(ai&42)===0||(ai&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=i):(e=ep(),Ie.lanes|=e,Pi|=e,t)}function td(e,t,i,l,p){var w=K.p;K.p=w!==0&&8>w?w:8;var B=V.T,P={};V.T=P,_c(e,!1,t,i);try{var Q=p(),ae=V.S;if(ae!==null&&ae(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var me=Uv(Q,l);Ys(e,t,me,Sn(e))}else Ys(e,t,l,Sn(e))}catch(_e){Ys(e,t,{then:function(){},status:"rejected",reason:_e},Sn())}finally{K.p=w,B!==null&&P.types!==null&&(B.types=P.types),V.T=B}}function $v(){}function mc(e,t,i,l){if(e.tag!==5)throw Error(o(476));var p=nd(e).queue;td(e,p,t,J,i===null?$v:function(){return id(e),i(l)})}function nd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:J},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=nd(e);t.next===null&&(t=e.alternate.memoizedState),Ys(e,t.next.queue,{},Sn())}function gc(){return Ut(fl)}function rd(){return kt().memoizedState}function sd(){return kt().memoizedState}function Wv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Sn();e=ji(i);var l=Ni(t,e,i);l!==null&&(un(l,t,i),Gs(l,t,i)),t={cache:Vo()},e.payload=t;return}t=t.return}}function Kv(e,t,i){var l=Sn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pa(e)?ad(t,i):(i=Bo(e,t,i,l),i!==null&&(un(i,e,l),od(i,t,l)))}function ld(e,t,i){var l=Sn();Ys(e,t,i,l)}function Ys(e,t,i,l){var p={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pa(e))ad(t,p);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var B=t.lastRenderedState,P=w(B,i);if(p.hasEagerState=!0,p.eagerState=P,pn(P,B))return Kl(e,t,p,0),ct===null&&Wl(),!1}catch{}finally{}if(i=Bo(e,t,p,l),i!==null)return un(i,e,l),od(i,t,l),!0}return!1}function _c(e,t,i,l){if(l={lane:2,revertLane:Yc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pa(e)){if(t)throw Error(o(479))}else t=Bo(e,i,l,2),t!==null&&un(t,e,2)}function pa(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function ad(e,t){Kr=aa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function od(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,sr(e,i)}}var Xs={readContext:Ut,use:ua,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};Xs.useEffectEvent=bt;var cd={readContext:Ut,use:ua,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:$f,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,fa(4194308,4,Xf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return fa(4194308,4,e,t)},useInsertionEffect:function(e,t){fa(4,2,e,t)},useMemo:function(e,t){var i=Zt();t=t===void 0?null:t;var l=e();if(Cr){ht(!0);try{e()}finally{ht(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Zt();if(i!==void 0){var p=i(t);if(Cr){ht(!0);try{i(t)}finally{ht(!1)}}}else p=t;return l.memoizedState=l.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},l.queue=e,e=e.dispatch=Kv.bind(null,Ie,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=uc(e);var t=e.queue,i=ld.bind(null,Ie,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:dc,useDeferredValue:function(e,t){var i=Zt();return pc(i,e,t)},useTransition:function(){var e=uc(!1);return e=td.bind(null,Ie,e.queue,!0,!1),Zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=Ie,p=Zt();if(Xe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),ct===null)throw Error(o(349));(Ke&127)!==0||Df(l,t,i)}p.memoizedState=i;var w={value:i,getSnapshot:t};return p.queue=w,$f(Lf.bind(null,l,w,e),[e]),l.flags|=2048,Xr(9,{destroy:void 0},Mf.bind(null,l,w,i,t),null),i},useId:function(){var e=Zt(),t=ct.identifierPrefix;if(Xe){var i=Wn,l=$n;i=(l&~(1<<32-qe(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=oa++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Pv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:Pf,useActionState:Pf,useOptimistic:function(e){var t=Zt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=_c.bind(null,Ie,!0,i),i.dispatch=t,[e,t]},useMemoCache:ac,useCacheRefresh:function(){return Zt().memoizedState=Wv.bind(null,Ie)},useEffectEvent:function(e){var t=Zt(),i={impl:e};return t.memoizedState=i,function(){if((tt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},vc={readContext:Ut,use:ua,useCallback:Zf,useContext:Ut,useEffect:fc,useImperativeHandle:Qf,useInsertionEffect:Kf,useLayoutEffect:Yf,useMemo:Jf,useReducer:ha,useRef:Vf,useState:function(){return ha(oi)},useDebugValue:dc,useDeferredValue:function(e,t){var i=kt();return ed(i,lt.memoizedState,e,t)},useTransition:function(){var e=ha(oi)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:gc,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var i=kt();return jf(i,lt,e,t)},useMemoCache:ac,useCacheRefresh:sd};vc.useEffectEvent=Wf;var ud={readContext:Ut,use:ua,useCallback:Zf,useContext:Ut,useEffect:fc,useImperativeHandle:Qf,useInsertionEffect:Kf,useLayoutEffect:Yf,useMemo:Jf,useReducer:cc,useRef:Vf,useState:function(){return cc(oi)},useDebugValue:dc,useDeferredValue:function(e,t){var i=kt();return lt===null?pc(i,e,t):ed(i,lt.memoizedState,e,t)},useTransition:function(){var e=cc(oi)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:gc,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var i=kt();return lt!==null?jf(i,lt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ac,useCacheRefresh:sd};ud.useEffectEvent=Wf;function yc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Sc={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=Sn(),p=ji(l);p.payload=t,i!=null&&(p.callback=i),t=Ni(e,p,l),t!==null&&(un(t,e,l),Gs(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=Sn(),p=ji(l);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Ni(e,p,l),t!==null&&(un(t,e,l),Gs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Sn(),l=ji(i);l.tag=2,t!=null&&(l.callback=t),t=Ni(e,l,i),t!==null&&(un(t,e,i),Gs(t,e,i))}};function hd(e,t,i,l,p,w,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,w,B):t.prototype&&t.prototype.isPureReactComponent?!Ns(i,l)||!Ns(p,w):!0}function fd(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Sc.enqueueReplaceState(t,t.state,null)}function wr(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var p in e)i[p]===void 0&&(i[p]=e[p])}return i}function dd(e){$l(e)}function pd(e){console.error(e)}function md(e){$l(e)}function ma(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gd(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function bc(e,t,i){return i=ji(i),i.tag=3,i.payload={element:null},i.callback=function(){ma(e,t)},i}function _d(e){return e=ji(e),e.tag=3,e}function vd(e,t,i,l){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var w=l.value;e.payload=function(){return p(w)},e.callback=function(){gd(t,i,l)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){gd(t,i,l),typeof p!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function Yv(e,t,i,l,p){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&Fr(t,i,p,!0),i=gn.current,i!==null){switch(i.tag){case 31:case 13:return Rn===null?Aa():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=p,l===na?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),$c(e,l,p)),!1;case 22:return i.flags|=65536,l===na?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),$c(e,l,p)),!1}throw Error(o(435,i.tag))}return $c(e,l,p),Aa(),!1}if(Xe)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=p,l!==Uo&&(e=Error(o(422),{cause:l}),Is(En(e,i)))):(l!==Uo&&(t=Error(o(423),{cause:l}),Is(En(t,i))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,l=En(l,i),p=bc(e.stateNode,l,p),Qo(e,p),Ct!==4&&(Ct=2)),!1;var w=Error(o(520),{cause:l});if(w=En(w,i),rl===null?rl=[w]:rl.push(w),Ct!==4&&(Ct=2),t===null)return!0;l=En(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=p&-p,i.lanes|=e,e=bc(i.stateNode,l,e),Qo(i,e),!1;case 1:if(t=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Fi===null||!Fi.has(w))))return i.flags|=65536,p&=-p,i.lanes|=p,p=_d(p),vd(p,e,i,l),Qo(i,p),!1}i=i.return}while(i!==null);return!1}var Cc=Error(o(461)),Ot=!1;function Pt(e,t,i,l){t.child=e===null?Cf(t,null,i,l):br(t,e.child,i,l)}function yd(e,t,i,l,p){i=i.render;var w=t.ref;if("ref"in l){var B={};for(var P in l)P!=="ref"&&(B[P]=l[P])}else B=l;return _r(t),l=ic(e,t,i,B,w,p),P=rc(),e!==null&&!Ot?(sc(e,t,p),ci(e,t,p)):(Xe&&P&&zo(t),t.flags|=1,Pt(e,t,l,p),t.child)}function Sd(e,t,i,l,p){if(e===null){var w=i.type;return typeof w=="function"&&!jo(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,bd(e,t,w,l,p)):(e=Xl(i.type,null,l,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Dc(e,p)){var B=w.memoizedProps;if(i=i.compare,i=i!==null?i:Ns,i(B,l)&&e.ref===t.ref)return ci(e,t,p)}return t.flags|=1,e=ii(w,l),e.ref=t.ref,e.return=t,t.child=e}function bd(e,t,i,l,p){if(e!==null){var w=e.memoizedProps;if(Ns(w,l)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=l=w,Dc(e,p))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,ci(e,t,p)}return wc(e,t,i,l,p)}function Cd(e,t,i,l){var p=l.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(l=t.child=e.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~w}else l=0,t.child=null;return wd(e,t,w,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ea(t,w!==null?w.cachePool:null),w!==null?Ef(t,w):Jo(),kf(t);else return l=t.lanes=536870912,wd(e,t,w!==null?w.baseLanes|i:i,i,l)}else w!==null?(ea(t,w.cachePool),Ef(t,w),zi(),t.memoizedState=null):(e!==null&&ea(t,null),Jo(),zi());return Pt(e,t,p,i),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wd(e,t,i,l,p){var w=Wo();return w=w===null?null:{parent:Mt._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&ea(t,null),Jo(),kf(t),e!==null&&Fr(e,t,l,!0),t.childLanes=p,null}function ga(e,t){return t=va({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 br(t,e.child,null,i),e=ga(t,t.pendingProps),e.flags|=2,_n(t),t.memoizedState=null,e}function Xv(e,t,i){var l=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(l.mode==="hidden")return e=ga(t,l),t.lanes=536870912,Qs(null,e);if(tc(t),(e=gt)?(e=Np(e,Tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di!==null?{id:$n,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},i=af(e),i.return=t,t.child=i,It=t,gt=null)):e=null,e===null)throw Li(t);return t.lanes=536870912,null}return ga(t,l)}var w=e.memoizedState;if(w!==null){var B=w.dehydrated;if(tc(t),p)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(o(558));else if(Ot||Fr(e,t,i,!1),p=(i&e.childLanes)!==0,Ot||p){if(l=ct,l!==null&&(B=ys(l,i),B!==0&&B!==w.retryLane))throw w.retryLane=B,dr(e,B),un(l,e,B),Cc;Aa(),t=xd(e,t,i)}else e=w.treeContext,gt=Dn(B.nextSibling),It=t,Xe=!0,Mi=null,Tn=!1,e!==null&&uf(t,e),t=ga(t,l),t.flags|=4096;return t}return e=ii(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _a(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function wc(e,t,i,l,p){return _r(t),i=ic(e,t,i,l,void 0,p),l=rc(),e!==null&&!Ot?(sc(e,t,p),ci(e,t,p)):(Xe&&l&&zo(t),t.flags|=1,Pt(e,t,i,p),t.child)}function Ed(e,t,i,l,p,w){return _r(t),t.updateQueue=null,i=Tf(t,l,i,p),Af(e),l=rc(),e!==null&&!Ot?(sc(e,t,w),ci(e,t,w)):(Xe&&l&&zo(t),t.flags|=1,Pt(e,t,i,w),t.child)}function kd(e,t,i,l,p){if(_r(t),t.stateNode===null){var w=zr,B=i.contextType;typeof B=="object"&&B!==null&&(w=Ut(B)),w=new i(l,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Sc,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=l,w.state=t.memoizedState,w.refs={},Yo(t),B=i.contextType,w.context=typeof B=="object"&&B!==null?Ut(B):zr,w.state=t.memoizedState,B=i.getDerivedStateFromProps,typeof B=="function"&&(yc(t,i,B,l),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(B=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),B!==w.state&&Sc.enqueueReplaceState(w,w.state,null),$s(t,l,w,p),Vs(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){w=t.stateNode;var P=t.memoizedProps,Q=wr(i,P);w.props=Q;var ae=w.context,me=i.contextType;B=zr,typeof me=="object"&&me!==null&&(B=Ut(me));var _e=i.getDerivedStateFromProps;me=typeof _e=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,me||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||ae!==B)&&fd(t,w,l,B),Bi=!1;var oe=t.memoizedState;w.state=oe,$s(t,l,w,p),Vs(),ae=t.memoizedState,P||oe!==ae||Bi?(typeof _e=="function"&&(yc(t,i,_e,l),ae=t.memoizedState),(Q=Bi||hd(t,i,Q,l,oe,ae,B))?(me||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=ae),w.props=l,w.state=ae,w.context=B,l=Q):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{w=t.stateNode,Xo(e,t),B=t.memoizedProps,me=wr(i,B),w.props=me,_e=t.pendingProps,oe=w.context,ae=i.contextType,Q=zr,typeof ae=="object"&&ae!==null&&(Q=Ut(ae)),P=i.getDerivedStateFromProps,(ae=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(B!==_e||oe!==Q)&&fd(t,w,l,Q),Bi=!1,oe=t.memoizedState,w.state=oe,$s(t,l,w,p),Vs();var he=t.memoizedState;B!==_e||oe!==he||Bi||e!==null&&e.dependencies!==null&&Zl(e.dependencies)?(typeof P=="function"&&(yc(t,i,P,l),he=t.memoizedState),(me=Bi||hd(t,i,me,l,oe,he,Q)||e!==null&&e.dependencies!==null&&Zl(e.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,he,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,he,Q)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=he),w.props=l,w.state=he,w.context=Q,l=me):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),l=!1)}return w=l,_a(e,t),l=(t.flags&128)!==0,w||l?(w=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&l?(t.child=br(t,e.child,null,p),t.child=br(t,null,i,p)):Pt(e,t,i,p),t.memoizedState=w.state,e=t.child):e=ci(e,t,p),e}function Ad(e,t,i,l){return mr(),t.flags|=256,Pt(e,t,i,l),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:gf()}}function kc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=yn),e}function Td(e,t,i){var l=t.pendingProps,p=!1,w=(t.flags&128)!==0,B;if((B=w)||(B=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),B&&(p=!0,t.flags&=-129),B=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(p?Hi(t):zi(),(e=gt)?(e=Np(e,Tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di!==null?{id:$n,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},i=af(e),i.return=t,t.child=i,It=t,gt=null)):e=null,e===null)throw Li(t);return ou(e)?t.lanes=32:t.lanes=536870912,null}var P=l.children;return l=l.fallback,p?(zi(),p=t.mode,P=va({mode:"hidden",children:P},p),l=pr(l,p,i,null),P.return=t,l.return=t,P.sibling=l,t.child=P,l=t.child,l.memoizedState=Ec(i),l.childLanes=kc(e,B,i),t.memoizedState=xc,Qs(null,l)):(Hi(t),Ac(t,P))}var Q=e.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(w)t.flags&256?(Hi(t),t.flags&=-257,t=Tc(e,t,i)):t.memoizedState!==null?(zi(),t.child=e.child,t.flags|=128,t=null):(zi(),P=l.fallback,p=t.mode,l=va({mode:"visible",children:l.children},p),P=pr(P,p,i,null),P.flags|=2,l.return=t,P.return=t,l.sibling=P,t.child=l,br(t,e.child,null,i),l=t.child,l.memoizedState=Ec(i),l.childLanes=kc(e,B,i),t.memoizedState=xc,t=Qs(null,l));else if(Hi(t),ou(P)){if(B=P.nextSibling&&P.nextSibling.dataset,B)var ae=B.dgst;B=ae,l=Error(o(419)),l.stack="",l.digest=B,Is({value:l,source:null,stack:null}),t=Tc(e,t,i)}else if(Ot||Fr(e,t,i,!1),B=(i&e.childLanes)!==0,Ot||B){if(B=ct,B!==null&&(l=ys(B,i),l!==0&&l!==Q.retryLane))throw Q.retryLane=l,dr(e,l),un(B,e,l),Cc;au(P)||Aa(),t=Tc(e,t,i)}else au(P)?(t.flags|=192,t.child=e.child,t=null):(e=Q.treeContext,gt=Dn(P.nextSibling),It=t,Xe=!0,Mi=null,Tn=!1,e!==null&&uf(t,e),t=Ac(t,l.children),t.flags|=4096);return t}return p?(zi(),P=l.fallback,p=t.mode,Q=e.child,ae=Q.sibling,l=ii(Q,{mode:"hidden",children:l.children}),l.subtreeFlags=Q.subtreeFlags&65011712,ae!==null?P=ii(ae,P):(P=pr(P,p,i,null),P.flags|=2),P.return=t,l.return=t,l.sibling=P,t.child=l,Qs(null,l),l=t.child,P=e.child.memoizedState,P===null?P=Ec(i):(p=P.cachePool,p!==null?(Q=Mt._currentValue,p=p.parent!==Q?{parent:Q,pool:Q}:p):p=gf(),P={baseLanes:P.baseLanes|i,cachePool:p}),l.memoizedState=P,l.childLanes=kc(e,B,i),t.memoizedState=xc,Qs(e.child,l)):(Hi(t),i=e.child,e=i.sibling,i=ii(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(B=t.deletions,B===null?(t.deletions=[e],t.flags|=16):B.push(e)),t.child=i,t.memoizedState=null,i)}function Ac(e,t){return t=va({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function va(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Tc(e,t,i){return br(t,e.child,null,i),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rd(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),qo(e.return,t,i)}function Rc(e,t,i,l,p,w){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:p,treeForkCount:w}:(B.isBackwards=t,B.rendering=null,B.renderingStartTime=0,B.last=l,B.tail=i,B.tailMode=p,B.treeForkCount=w)}function Dd(e,t,i){var l=t.pendingProps,p=l.revealOrder,w=l.tail;l=l.children;var B=Et.current,P=(B&2)!==0;if(P?(B=B&1|2,t.flags|=128):B&=1,N(Et,B),Pt(e,t,l,i),l=Xe?zs:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,i,t);else if(e.tag===19)Rd(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(p){case"forwards":for(i=t.child,p=null;i!==null;)e=i.alternate,e!==null&&la(e)===null&&(p=i),i=i.sibling;i=p,i===null?(p=t.child,t.child=null):(p=i.sibling,i.sibling=null),Rc(t,!1,p,i,w,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&la(e)===null){t.child=p;break}e=p.sibling,p.sibling=i,i=p,p=e}Rc(t,!0,i,null,w,l);break;case"together":Rc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ci(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Pi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Fr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=ii(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ii(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zl(e)))}function Qv(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Oi(t,Mt,e.memoizedState.cache),mr();break;case 27:case 5:ce(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Oi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Hi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Td(e,t,i):(Hi(t),e=ci(e,t,i),e!==null?e.sibling:null);Hi(t);break;case 19:var p=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(Fr(e,t,i,!1),l=(i&t.childLanes)!==0),p){if(l)return Dd(e,t,i);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),N(Et,Et.current),l)break;return null;case 22:return t.lanes=0,Cd(e,t,i,t.pendingProps);case 24:Oi(t,Mt,e.memoizedState.cache)}return ci(e,t,i)}function Md(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Dc(e,i)&&(t.flags&128)===0)return Ot=!1,Qv(e,t,i);Ot=(e.flags&131072)!==0}else Ot=!1,Xe&&(t.flags&1048576)!==0&&cf(t,zs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=yr(t.elementType),t.type=e,typeof e=="function")jo(e)?(l=wr(e,l),t.tag=1,t=kd(null,t,e,l,i)):(t.tag=0,t=wc(null,t,e,l,i));else{if(e!=null){var p=e.$$typeof;if(p===k){t.tag=11,t=yd(null,t,e,l,i);break e}else if(p===D){t.tag=14,t=Sd(null,t,e,l,i);break e}}throw t=W(e)||e,Error(o(306,t,""))}}return t;case 0:return wc(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,p=wr(l,t.pendingProps),kd(e,t,l,p,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var w=t.memoizedState;p=w.element,Xo(e,t),$s(t,l,null,i);var B=t.memoizedState;if(l=B.cache,Oi(t,Mt,l),l!==w.cache&&Go(t,[Mt],i,!0),Vs(),l=B.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:B.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Ad(e,t,l,i);break e}else if(l!==p){p=En(Error(o(424)),t),Is(p),t=Ad(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(gt=Dn(e.firstChild),It=t,Xe=!0,Mi=null,Tn=!0,i=Cf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(mr(),l===p){t=ci(e,t,i);break e}Pt(e,t,l,i)}t=t.child}return t;case 26:return _a(e,t),e===null?(i=Fp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Xe||(i=t.type,e=t.pendingProps,l=Ba(ve.current).createElement(i),l[yt]=t,l[Rt]=e,Ft(l,i,e),nt(l),t.stateNode=l):t.memoizedState=Fp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Xe&&(l=t.stateNode=Ip(t.type,t.pendingProps,ve.current),It=t,Tn=!0,p=gt,$i(t.type)?(cu=p,gt=Dn(l.firstChild)):gt=p),Pt(e,t,t.pendingProps.children,i),_a(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((p=l=gt)&&(l=A0(l,t.type,t.pendingProps,Tn),l!==null?(t.stateNode=l,It=t,gt=Dn(l.firstChild),Tn=!1,p=!0):p=!1),p||Li(t)),ce(t),p=t.type,w=t.pendingProps,B=e!==null?e.memoizedProps:null,l=w.children,ru(p,w)?l=null:B!==null&&ru(p,B)&&(t.flags|=32),t.memoizedState!==null&&(p=ic(e,t,Fv,null,null,i),fl._currentValue=p),_a(e,t),Pt(e,t,l,i),t.child;case 6:return e===null&&Xe&&((e=i=gt)&&(i=T0(i,t.pendingProps,Tn),i!==null?(t.stateNode=i,It=t,gt=null,e=!0):e=!1),e||Li(t)),null;case 13:return Td(e,t,i);case 4:return q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=br(t,null,l,i):Pt(e,t,l,i),t.child;case 11:return yd(e,t,t.type,t.pendingProps,i);case 7:return Pt(e,t,t.pendingProps,i),t.child;case 8:return Pt(e,t,t.pendingProps.children,i),t.child;case 12:return Pt(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,Oi(t,t.type,l.value),Pt(e,t,l.children,i),t.child;case 9:return p=t.type._context,l=t.pendingProps.children,_r(t),p=Ut(p),l=l(p),t.flags|=1,Pt(e,t,l,i),t.child;case 14:return Sd(e,t,t.type,t.pendingProps,i);case 15:return bd(e,t,t.type,t.pendingProps,i);case 19:return Dd(e,t,i);case 31:return Xv(e,t,i);case 22:return Cd(e,t,i,t.pendingProps);case 24:return _r(t),l=Ut(Mt),e===null?(p=Wo(),p===null&&(p=ct,w=Vo(),p.pooledCache=w,w.refCount++,w!==null&&(p.pooledCacheLanes|=i),p=w),t.memoizedState={parent:l,cache:p},Yo(t),Oi(t,Mt,p)):((e.lanes&i)!==0&&(Xo(e,t),$s(t,null,null,i),Vs()),p=e.memoizedState,w=t.memoizedState,p.parent!==l?(p={parent:l,cache:l},t.memoizedState=p,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=p),Oi(t,Mt,l)):(l=w.cache,Oi(t,Mt,l),l!==p.cache&&Go(t,[Mt],i,!0))),Pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ui(e){e.flags|=4}function Mc(e,t,i,l,p){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(rp())e.flags|=8192;else throw Sr=na,Ko}else e.flags&=-16777217}function Ld(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wp(t))if(rp())e.flags|=8192;else throw Sr=na,Ko}function ya(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ll():536870912,e.lanes|=t,es|=t)}function Zs(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 l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Zv(e,t,i){var l=t.pendingProps;switch(Io(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,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),li(Mt),fe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Pr(t)?ui(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Po())),_t(t),null;case 26:var p=t.type,w=t.memoizedState;return e===null?(ui(t),w!==null?(_t(t),Ld(t,w)):(_t(t),Mc(t,p,null,l,i))):w?w!==e.memoizedState?(ui(t),_t(t),Ld(t,w)):(_t(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ui(t),_t(t),Mc(t,p,e,l,i)),null;case 27:if(de(t),i=ve.current,p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return _t(t),null}e=Z.current,Pr(t)?hf(t):(e=Ip(p,l,i),t.stateNode=e,ui(t))}return _t(t),null;case 5:if(de(t),p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return _t(t),null}if(w=Z.current,Pr(t))hf(t);else{var B=Ba(ve.current);switch(w){case 1:w=B.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:w=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":w=B.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":w=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":w=B.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?B.createElement("select",{is:l.is}):B.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?B.createElement(p,{is:l.is}):B.createElement(p)}}w[yt]=t,w[Rt]=l;e:for(B=t.child;B!==null;){if(B.tag===5||B.tag===6)w.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===t)break e;for(;B.sibling===null;){if(B.return===null||B.return===t)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}t.stateNode=w;e:switch(Ft(w,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ui(t)}}return _t(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ve.current,Pr(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,p=It,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}e[yt]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Tp(e.nodeValue,i)),e||Li(t,!0)}else e=Ba(e).createTextNode(l),e[yt]=t,t.stateNode=e}return _t(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pr(t),i!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[yt]=t}else mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),e=!1}else i=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_n(t),t):(_n(t),null);if((t.flags&128)!==0)throw Error(o(558))}return _t(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=Pr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[yt]=t}else mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),p=!1}else p=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(_n(t),t):(_n(t),null)}return _n(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==p&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ya(t,t.updateQueue),_t(t),null);case 4:return fe(),e===null&&Jc(t.stateNode.containerInfo),_t(t),null;case 10:return li(t.type),_t(t),null;case 19:if(G(Et),l=t.memoizedState,l===null)return _t(t),null;if(p=(t.flags&128)!==0,w=l.rendering,w===null)if(p)Zs(l,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=la(e),w!==null){for(t.flags|=128,Zs(l,!1),e=w.updateQueue,t.updateQueue=e,ya(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)lf(i,e),i=i.sibling;return N(Et,Et.current&1|2),Xe&&ri(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&pt()>xa&&(t.flags|=128,p=!0,Zs(l,!1),t.lanes=4194304)}else{if(!p)if(e=la(w),e!==null){if(t.flags|=128,p=!0,e=e.updateQueue,t.updateQueue=e,ya(t,e),Zs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!Xe)return _t(t),null}else 2*pt()-l.renderingStartTime>xa&&i!==536870912&&(t.flags|=128,p=!0,Zs(l,!1),t.lanes=4194304);l.isBackwards?(w.sibling=t.child,t.child=w):(e=l.last,e!==null?e.sibling=w:t.child=w,l.last=w)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=pt(),e.sibling=null,i=Et.current,N(Et,p?i&1|2:i&1),Xe&&ri(t,l.treeForkCount),e):(_t(t),null);case 22:case 23:return _n(t),ec(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),i=t.updateQueue,i!==null&&ya(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&G(vr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),li(Mt),_t(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Jv(e,t){switch(Io(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return li(Mt),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(_n(t),t.alternate===null)throw Error(o(340));mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_n(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Et),null;case 4:return fe(),null;case 10:return li(t.type),null;case 22:case 23:return _n(t),ec(),e!==null&&G(vr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return li(Mt),null;case 25:return null;default:return null}}function Od(e,t){switch(Io(t),t.tag){case 3:li(Mt),fe();break;case 26:case 27:case 5:de(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&_n(t);break;case 13:_n(t);break;case 19:G(Et);break;case 10:li(t.type);break;case 22:case 23:_n(t),ec(),e!==null&&G(vr);break;case 24:li(Mt)}}function Js(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var p=l.next;i=p;do{if((i.tag&e)===e){l=void 0;var w=i.create,B=i.inst;l=w(),B.destroy=l}i=i.next}while(i!==p)}}catch(P){rt(t,t.return,P)}}function Ii(e,t,i){try{var l=t.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var w=p.next;l=w;do{if((l.tag&e)===e){var B=l.inst,P=B.destroy;if(P!==void 0){B.destroy=void 0,p=t;var Q=i,ae=P;try{ae()}catch(me){rt(p,Q,me)}}}l=l.next}while(l!==w)}}catch(me){rt(t,t.return,me)}}function Bd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{xf(t,i)}catch(l){rt(e,e.return,l)}}}function jd(e,t,i){i.props=wr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){rt(e,t,l)}}function el(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(p){rt(e,t,p)}}function Kn(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(p){rt(e,t,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){rt(e,t,p)}else i.current=null}function Nd(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(p){rt(e,e.return,p)}}function Lc(e,t,i){try{var l=e.stateNode;b0(l,e.type,i,t),l[Rt]=t}catch(p){rt(e,e.return,p)}}function Hd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$i(e.type)||e.tag===4}function Oc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hd(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&&$i(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 Bc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=We));else if(l!==4&&(l===27&&$i(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Bc(e,t,i),e=e.sibling;e!==null;)Bc(e,t,i),e=e.sibling}function Sa(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&$i(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Sa(e,t,i),e=e.sibling;e!==null;)Sa(e,t,i),e=e.sibling}function zd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);Ft(t,l,i),t[yt]=e,t[Rt]=i}catch(w){rt(e,e.return,w)}}var hi=!1,Bt=!1,jc=!1,Id=typeof WeakSet=="function"?WeakSet:Set,zt=null;function e0(e,t){if(e=e.containerInfo,nu=Pa,e=Xh(e),To(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var p=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var B=0,P=-1,Q=-1,ae=0,me=0,_e=e,oe=null;t:for(;;){for(var he;_e!==i||p!==0&&_e.nodeType!==3||(P=B+p),_e!==w||l!==0&&_e.nodeType!==3||(Q=B+l),_e.nodeType===3&&(B+=_e.nodeValue.length),(he=_e.firstChild)!==null;)oe=_e,_e=he;for(;;){if(_e===e)break t;if(oe===i&&++ae===p&&(P=B),oe===w&&++me===l&&(Q=B),(he=_e.nextSibling)!==null)break;_e=oe,oe=_e.parentNode}_e=he}i=P===-1||Q===-1?null:{start:P,end:Q}}else i=null}i=i||{start:0,end:0}}else i=null;for(iu={focusedElem:e,selectionRange:i},Pa=!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,w=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)p=e[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,p=w.memoizedProps,w=w.memoizedState,l=i.stateNode;try{var Ae=wr(i.type,p);e=l.getSnapshotBeforeUpdate(Ae,w),l.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){rt(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)lu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":lu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function Ud(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:di(e,i),l&4&&Js(5,i);break;case 1:if(di(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(B){rt(i,i.return,B)}else{var p=wr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(B){rt(i,i.return,B)}}l&64&&Bd(i),l&512&&el(i,i.return);break;case 3:if(di(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{xf(e,t)}catch(B){rt(i,i.return,B)}}break;case 27:t===null&&l&4&&zd(i);case 26:case 5:di(e,i),t===null&&l&4&&Nd(i),l&512&&el(i,i.return);break;case 12:di(e,i);break;case 31:di(e,i),l&4&&qd(e,i);break;case 13:di(e,i),l&4&&Gd(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=c0.bind(null,i),R0(e,i))));break;case 22:if(l=i.memoizedState!==null||hi,!l){t=t!==null&&t.memoizedState!==null||Bt,p=hi;var w=Bt;hi=l,(Bt=t)&&!w?pi(e,i,(i.subtreeFlags&8772)!==0):di(e,i),hi=p,Bt=w}break;case 30:break;default:di(e,i)}}function Pd(e){var t=e.alternate;t!==null&&(e.alternate=null,Pd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lr(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,ln=!1;function fi(e,t,i){for(i=i.child;i!==null;)Fd(e,t,i),i=i.sibling}function Fd(e,t,i){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(et,i)}catch{}switch(i.tag){case 26:Bt||Kn(i,t),fi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Bt||Kn(i,t);var l=vt,p=ln;$i(i.type)&&(vt=i.stateNode,ln=!1),fi(e,t,i),cl(i.stateNode),vt=l,ln=p;break;case 5:Bt||Kn(i,t);case 6:if(l=vt,p=ln,vt=null,fi(e,t,i),vt=l,ln=p,vt!==null)if(ln)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(w){rt(i,t,w)}else try{vt.removeChild(i.stateNode)}catch(w){rt(i,t,w)}break;case 18:vt!==null&&(ln?(e=vt,Bp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),os(e)):Bp(vt,i.stateNode));break;case 4:l=vt,p=ln,vt=i.stateNode.containerInfo,ln=!0,fi(e,t,i),vt=l,ln=p;break;case 0:case 11:case 14:case 15:Ii(2,i,t),Bt||Ii(4,i,t),fi(e,t,i);break;case 1:Bt||(Kn(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&jd(i,t,l)),fi(e,t,i);break;case 21:fi(e,t,i);break;case 22:Bt=(l=Bt)||i.memoizedState!==null,fi(e,t,i),Bt=l;break;default:fi(e,t,i)}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{os(e)}catch(i){rt(t,t.return,i)}}}function Gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{os(e)}catch(i){rt(t,t.return,i)}}function t0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Id),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Id),t;default:throw Error(o(435,e.tag))}}function ba(e,t){var i=t0(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var p=u0.bind(null,e,l);l.then(p,p)}})}function an(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var p=i[l],w=e,B=t,P=B;e:for(;P!==null;){switch(P.tag){case 27:if($i(P.type)){vt=P.stateNode,ln=!1;break e}break;case 5:vt=P.stateNode,ln=!1;break e;case 3:case 4:vt=P.stateNode.containerInfo,ln=!0;break e}P=P.return}if(vt===null)throw Error(o(160));Fd(w,B,p),vt=null,ln=!1,w=p.alternate,w!==null&&(w.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vd(t,e),t=t.sibling}var Un=null;function Vd(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:an(t,e),on(e),l&4&&(Ii(3,e,e.return),Js(3,e),Ii(5,e,e.return));break;case 1:an(t,e),on(e),l&512&&(Bt||i===null||Kn(i,i.return)),l&64&&hi&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var p=Un;if(an(t,e),on(e),l&512&&(Bt||i===null||Kn(i,i.return)),l&4){var w=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,p=p.ownerDocument||p;t:switch(l){case"title":w=p.getElementsByTagName("title")[0],(!w||w[Nn]||w[yt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=p.createElement(l),p.head.insertBefore(w,p.querySelector("head > title"))),Ft(w,l,i),w[yt]=e,nt(w),l=w;break e;case"link":var B=Vp("link","href",p).get(l+(i.href||""));if(B){for(var P=0;P<B.length;P++)if(w=B[P],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){B.splice(P,1);break t}}w=p.createElement(l),Ft(w,l,i),p.head.appendChild(w);break;case"meta":if(B=Vp("meta","content",p).get(l+(i.content||""))){for(P=0;P<B.length;P++)if(w=B[P],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){B.splice(P,1);break t}}w=p.createElement(l),Ft(w,l,i),p.head.appendChild(w);break;default:throw Error(o(468,l))}w[yt]=e,nt(w),l=w}e.stateNode=l}else $p(p,e.type,e.stateNode);else e.stateNode=Gp(p,l,e.memoizedProps);else w!==l?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,l===null?$p(p,e.type,e.stateNode):Gp(p,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Lc(e,e.memoizedProps,i.memoizedProps)}break;case 27:an(t,e),on(e),l&512&&(Bt||i===null||Kn(i,i.return)),i!==null&&l&4&&Lc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(an(t,e),on(e),l&512&&(Bt||i===null||Kn(i,i.return)),e.flags&32){p=e.stateNode;try{Ai(p,"")}catch(Ae){rt(e,e.return,Ae)}}l&4&&e.stateNode!=null&&(p=e.memoizedProps,Lc(e,p,i!==null?i.memoizedProps:p)),l&1024&&(jc=!0);break;case 6:if(an(t,e),on(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ae){rt(e,e.return,Ae)}}break;case 3:if(Ha=null,p=Un,Un=ja(t.containerInfo),an(t,e),Un=p,on(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{os(t.containerInfo)}catch(Ae){rt(e,e.return,Ae)}jc&&(jc=!1,$d(e));break;case 4:l=Un,Un=ja(e.stateNode.containerInfo),an(t,e),on(e),Un=l;break;case 12:an(t,e),on(e);break;case 31:an(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 13:an(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(wa=pt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 22:p=e.memoizedState!==null;var Q=i!==null&&i.memoizedState!==null,ae=hi,me=Bt;if(hi=ae||p,Bt=me||Q,an(t,e),Bt=me,hi=ae,on(e),l&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(i===null||Q||hi||Bt||xr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Q=i=t;try{if(w=Q.stateNode,p)B=w.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{P=Q.stateNode;var _e=Q.memoizedProps.style,oe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ae){rt(Q,Q.return,Ae)}}}else if(t.tag===6){if(i===null){Q=t;try{Q.stateNode.nodeValue=p?"":Q.memoizedProps}catch(Ae){rt(Q,Q.return,Ae)}}}else if(t.tag===18){if(i===null){Q=t;try{var he=Q.stateNode;p?jp(he,!0):jp(Q.stateNode,!1)}catch(Ae){rt(Q,Q.return,Ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,ba(e,i))));break;case 19:an(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 30:break;case 21:break;default:an(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Hd(l)){i=l;break}l=l.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var p=i.stateNode,w=Oc(e);Sa(e,w,p);break;case 5:var B=i.stateNode;i.flags&32&&(Ai(B,""),i.flags&=-33);var P=Oc(e);Sa(e,P,B);break;case 3:case 4:var Q=i.stateNode.containerInfo,ae=Oc(e);Bc(e,ae,Q);break;default:throw Error(o(161))}}catch(me){rt(e,e.return,me)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $d(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;$d(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function di(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ud(e,t.alternate,t),t=t.sibling}function xr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ii(4,t,t.return),xr(t);break;case 1:Kn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&jd(t,t.return,i),xr(t);break;case 27:cl(t.stateNode);case 26:case 5:Kn(t,t.return),xr(t);break;case 22:t.memoizedState===null&&xr(t);break;case 30:xr(t);break;default:xr(t)}e=e.sibling}}function pi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,p=e,w=t,B=w.flags;switch(w.tag){case 0:case 11:case 15:pi(p,w,i),Js(4,w);break;case 1:if(pi(p,w,i),l=w,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ae){rt(l,l.return,ae)}if(l=w,p=l.updateQueue,p!==null){var P=l.stateNode;try{var Q=p.shared.hiddenCallbacks;if(Q!==null)for(p.shared.hiddenCallbacks=null,p=0;p<Q.length;p++)wf(Q[p],P)}catch(ae){rt(l,l.return,ae)}}i&&B&64&&Bd(w),el(w,w.return);break;case 27:zd(w);case 26:case 5:pi(p,w,i),i&&l===null&&B&4&&Nd(w),el(w,w.return);break;case 12:pi(p,w,i);break;case 31:pi(p,w,i),i&&B&4&&qd(p,w);break;case 13:pi(p,w,i),i&&B&4&&Gd(p,w);break;case 22:w.memoizedState===null&&pi(p,w,i),el(w,w.return);break;case 30:break;default:pi(p,w,i)}t=t.sibling}}function Nc(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&&Us(i))}function Hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function Pn(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wd(e,t,i,l),t=t.sibling}function Wd(e,t,i,l){var p=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,i,l),p&2048&&Js(9,t);break;case 1:Pn(e,t,i,l);break;case 3:Pn(e,t,i,l),p&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e)));break;case 12:if(p&2048){Pn(e,t,i,l),e=t.stateNode;try{var w=t.memoizedProps,B=w.id,P=w.onPostCommit;typeof P=="function"&&P(B,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Q){rt(t,t.return,Q)}}else Pn(e,t,i,l);break;case 31:Pn(e,t,i,l);break;case 13:Pn(e,t,i,l);break;case 23:break;case 22:w=t.stateNode,B=t.alternate,t.memoizedState!==null?w._visibility&2?Pn(e,t,i,l):tl(e,t):w._visibility&2?Pn(e,t,i,l):(w._visibility|=2,Qr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1)),p&2048&&Nc(B,t);break;case 24:Pn(e,t,i,l),p&2048&&Hc(t.alternate,t);break;default:Pn(e,t,i,l)}}function Qr(e,t,i,l,p){for(p=p&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,B=t,P=i,Q=l,ae=B.flags;switch(B.tag){case 0:case 11:case 15:Qr(w,B,P,Q,p),Js(8,B);break;case 23:break;case 22:var me=B.stateNode;B.memoizedState!==null?me._visibility&2?Qr(w,B,P,Q,p):tl(w,B):(me._visibility|=2,Qr(w,B,P,Q,p)),p&&ae&2048&&Nc(B.alternate,B);break;case 24:Qr(w,B,P,Q,p),p&&ae&2048&&Hc(B.alternate,B);break;default:Qr(w,B,P,Q,p)}t=t.sibling}}function tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,p=l.flags;switch(l.tag){case 22:tl(i,l),p&2048&&Nc(l.alternate,l);break;case 24:tl(i,l),p&2048&&Hc(l.alternate,l);break;default:tl(i,l)}t=t.sibling}}var nl=8192;function Zr(e,t,i){if(e.subtreeFlags&nl)for(e=e.child;e!==null;)Kd(e,t,i),e=e.sibling}function Kd(e,t,i){switch(e.tag){case 26:Zr(e,t,i),e.flags&nl&&e.memoizedState!==null&&P0(i,Un,e.memoizedState,e.memoizedProps);break;case 5:Zr(e,t,i);break;case 3:case 4:var l=Un;Un=ja(e.stateNode.containerInfo),Zr(e,t,i),Un=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=nl,nl=16777216,Zr(e,t,i),nl=l):Zr(e,t,i));break;default:Zr(e,t,i)}}function Yd(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 il(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];zt=l,Qd(l,e)}Yd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xd(e),e=e.sibling}function Xd(e){switch(e.tag){case 0:case 11:case 15:il(e),e.flags&2048&&Ii(9,e,e.return);break;case 3:il(e);break;case 12:il(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ca(e)):il(e);break;default:il(e)}}function Ca(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];zt=l,Qd(l,e)}Yd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ii(8,t,t.return),Ca(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ca(t));break;default:Ca(t)}e=e.sibling}}function Qd(e,t){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:Ii(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Us(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,zt=l;else e:for(i=e;zt!==null;){l=zt;var p=l.sibling,w=l.return;if(Pd(l),l===i){zt=null;break e}if(p!==null){p.return=w,zt=p;break e}zt=w}}}var n0={getCacheForType:function(e){var t=Ut(Mt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ut(Mt).controller.signal}},i0=typeof WeakMap=="function"?WeakMap:Map,tt=0,ct=null,Ge=null,Ke=0,it=0,vn=null,Ui=!1,Jr=!1,zc=!1,mi=0,Ct=0,Pi=0,Er=0,Ic=0,yn=0,es=0,rl=null,cn=null,Uc=!1,wa=0,Zd=0,xa=1/0,Ea=null,Fi=null,Nt=0,qi=null,ts=null,gi=0,Pc=0,Fc=null,Jd=null,sl=0,qc=null;function Sn(){return(tt&2)!==0&&Ke!==0?Ke&-Ke:V.T!==null?Yc():Ss()}function ep(){if(yn===0)if((Ke&536870912)===0||Xe){var e=ze;ze<<=1,(ze&3932160)===0&&(ze=262144),yn=e}else yn=536870912;return e=gn.current,e!==null&&(e.flags|=32),yn}function un(e,t,i){(e===ct&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(ns(e,0),Gi(e,Ke,yn,!1)),Gn(e,i),((tt&2)===0||e!==ct)&&(e===ct&&((tt&2)===0&&(Er|=i),Ct===4&&Gi(e,Ke,yn,!1)),Yn(e))}function tp(e,t,i){if((tt&6)!==0)throw Error(o(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||rr(e,t),p=l?l0(e,t):Vc(e,t,!0),w=l;do{if(p===0){Jr&&!l&&Gi(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!r0(i)){p=Vc(e,t,!1),w=!1;continue}if(p===2){if(w=t,e.errorRecoveryDisabledLanes&w)var B=0;else B=e.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){t=B;e:{var P=e;p=rl;var Q=P.current.memoizedState.isDehydrated;if(Q&&(ns(P,B).flags|=256),B=Vc(P,B,!1),B!==2){if(zc&&!Q){P.errorRecoveryDisabledLanes|=w,Er|=w,p=4;break e}w=cn,cn=p,w!==null&&(cn===null?cn=w:cn.push.apply(cn,w))}p=B}if(w=!1,p!==2)continue}}if(p===1){ns(e,0),Gi(e,t,0,!0);break}e:{switch(l=e,w=p,w){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Gi(l,t,yn,!Ui);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(p=wa+300-pt(),10<p)){if(Gi(l,t,yn,!Ui),Jn(l,0,!0)!==0)break e;gi=t,l.timeoutHandle=Lp(np.bind(null,l,i,cn,Ea,Uc,t,yn,Er,es,Ui,w,"Throttled",-0,0),p);break e}np(l,i,cn,Ea,Uc,t,yn,Er,es,Ui,w,null,-0,0)}}break}while(!0);Yn(e)}function np(e,t,i,l,p,w,B,P,Q,ae,me,_e,oe,he){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:We},Kd(t,w,_e);var Ae=(w&62914560)===w?wa-pt():(w&4194048)===w?Zd-pt():0;if(Ae=F0(_e,Ae),Ae!==null){gi=w,e.cancelPendingCommit=Ae(up.bind(null,e,t,w,i,l,p,B,P,Q,me,_e,null,oe,he)),Gi(e,w,B,!ae);return}}up(e,t,w,i,l,p,B,P,Q)}function r0(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var p=i[l],w=p.getSnapshot;p=p.value;try{if(!pn(w(),p))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gi(e,t,i,l){t&=~Ic,t&=~Er,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var p=t;0<p;){var w=31-qe(p),B=1<<w;l[w]=-1,p&=~B}i!==0&&Bl(e,i,t)}function ka(){return(tt&6)===0?(ll(0),!1):!0}function Gc(){if(Ge!==null){if(it===0)var e=Ge.return;else e=Ge,si=gr=null,lc(e),$r=null,Fs=0,e=Ge;for(;e!==null;)Od(e.alternate,e),e=e.return;Ge=null}}function ns(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,x0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),gi=0,Gc(),ct=e,Ge=i=ii(e.current,null),Ke=t,it=0,vn=null,Ui=!1,Jr=rr(e,t),zc=!1,es=yn=Ic=Er=Pi=Ct=0,cn=rl=null,Uc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var p=31-qe(l),w=1<<p;t|=e[p],l&=~w}return mi=t,Wl(),i}function ip(e,t){Ie=null,V.H=Xs,t===Vr||t===ta?(t=yf(),it=3):t===Ko?(t=yf(),it=4):it=t===Cc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vn=t,Ge===null&&(Ct=1,ma(e,En(t,e.current)))}function rp(){var e=gn.current;return e===null?!0:(Ke&4194048)===Ke?Rn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Rn:!1}function sp(){var e=V.H;return V.H=Xs,e===null?Xs:e}function lp(){var e=V.A;return V.A=n0,e}function Aa(){Ct=4,Ui||(Ke&4194048)!==Ke&&gn.current!==null||(Jr=!0),(Pi&134217727)===0&&(Er&134217727)===0||ct===null||Gi(ct,Ke,yn,!1)}function Vc(e,t,i){var l=tt;tt|=2;var p=sp(),w=lp();(ct!==e||Ke!==t)&&(Ea=null,ns(e,t)),t=!1;var B=Ct;e:do try{if(it!==0&&Ge!==null){var P=Ge,Q=vn;switch(it){case 8:Gc(),B=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var ae=it;if(it=0,vn=null,is(e,P,Q,ae),i&&Jr){B=0;break e}break;default:ae=it,it=0,vn=null,is(e,P,Q,ae)}}s0(),B=Ct;break}catch(me){ip(e,me)}while(!0);return t&&e.shellSuspendCounter++,si=gr=null,tt=l,V.H=p,V.A=w,Ge===null&&(ct=null,Ke=0,Wl()),B}function s0(){for(;Ge!==null;)ap(Ge)}function l0(e,t){var i=tt;tt|=2;var l=sp(),p=lp();ct!==e||Ke!==t?(Ea=null,xa=pt()+500,ns(e,t)):Jr=rr(e,t);e:do try{if(it!==0&&Ge!==null){t=Ge;var w=vn;t:switch(it){case 1:it=0,vn=null,is(e,t,w,1);break;case 2:case 9:if(_f(w)){it=0,vn=null,op(t);break}t=function(){it!==2&&it!==9||ct!==e||(it=7),Yn(e)},w.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:_f(w)?(it=0,vn=null,op(t)):(it=0,vn=null,is(e,t,w,7));break;case 5:var B=null;switch(Ge.tag){case 26:B=Ge.memoizedState;case 5:case 27:var P=Ge;if(B?Wp(B):P.stateNode.complete){it=0,vn=null;var Q=P.sibling;if(Q!==null)Ge=Q;else{var ae=P.return;ae!==null?(Ge=ae,Ta(ae)):Ge=null}break t}}it=0,vn=null,is(e,t,w,5);break;case 6:it=0,vn=null,is(e,t,w,6);break;case 8:Gc(),Ct=6;break e;default:throw Error(o(462))}}a0();break}catch(me){ip(e,me)}while(!0);return si=gr=null,V.H=l,V.A=p,tt=i,Ge!==null?0:(ct=null,Ke=0,Wl(),Ct)}function a0(){for(;Ge!==null&&!wn();)ap(Ge)}function ap(e){var t=Md(e.alternate,e,mi);e.memoizedProps=e.pendingProps,t===null?Ta(e):Ge=t}function op(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Ed(i,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Ed(i,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:lc(t);default:Od(i,t),t=Ge=lf(t,mi),t=Md(i,t,mi)}e.memoizedProps=e.pendingProps,t===null?Ta(e):Ge=t}function is(e,t,i,l){si=gr=null,lc(t),$r=null,Fs=0;var p=t.return;try{if(Yv(e,p,t,i,Ke)){Ct=1,ma(e,En(i,e.current)),Ge=null;return}}catch(w){if(p!==null)throw Ge=p,w;Ct=1,ma(e,En(i,e.current)),Ge=null;return}t.flags&32768?(Xe||l===1?e=!0:Jr||(Ke&536870912)!==0?e=!1:(Ui=e=!0,(l===2||l===9||l===3||l===6)&&(l=gn.current,l!==null&&l.tag===13&&(l.flags|=16384))),cp(t,e)):Ta(t)}function Ta(e){var t=e;do{if((t.flags&32768)!==0){cp(t,Ui);return}e=t.return;var i=Zv(t.alternate,t,mi);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 cp(e,t){do{var i=Jv(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 up(e,t,i,l,p,w,B,P,Q){e.cancelPendingCommit=null;do Ra();while(Nt!==0);if((tt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(w=t.lanes|t.childLanes,w|=Oo,Ol(e,i,w,B,P,Q),e===ct&&(Ge=ct=null,Ke=0),ts=t,qi=e,gi=i,Pc=w,Fc=p,Jd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,h0(ke,function(){return mp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=V.T,V.T=null,p=K.p,K.p=2,B=tt,tt|=4;try{e0(e,t,i)}finally{tt=B,K.p=p,V.T=l}}Nt=1,hp(),fp(),dp()}}function hp(){if(Nt===1){Nt=0;var e=qi,t=ts,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var l=K.p;K.p=2;var p=tt;tt|=4;try{Vd(t,e);var w=iu,B=Xh(e.containerInfo),P=w.focusedElem,Q=w.selectionRange;if(B!==P&&P&&P.ownerDocument&&Yh(P.ownerDocument.documentElement,P)){if(Q!==null&&To(P)){var ae=Q.start,me=Q.end;if(me===void 0&&(me=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(me,P.value.length);else{var _e=P.ownerDocument||document,oe=_e&&_e.defaultView||window;if(oe.getSelection){var he=oe.getSelection(),Ae=P.textContent.length,Oe=Math.min(Q.start,Ae),ot=Q.end===void 0?Oe:Math.min(Q.end,Ae);!he.extend&&Oe>ot&&(B=ot,ot=Oe,Oe=B);var ie=Kh(P,Oe),ee=Kh(P,ot);if(ie&&ee&&(he.rangeCount!==1||he.anchorNode!==ie.node||he.anchorOffset!==ie.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var le=_e.createRange();le.setStart(ie.node,ie.offset),he.removeAllRanges(),Oe>ot?(he.addRange(le),he.extend(ee.node,ee.offset)):(le.setEnd(ee.node,ee.offset),he.addRange(le))}}}}for(_e=[],he=P;he=he.parentNode;)he.nodeType===1&&_e.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<_e.length;P++){var ge=_e[P];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Pa=!!nu,iu=nu=null}finally{tt=p,K.p=l,V.T=i}}e.current=t,Nt=2}}function fp(){if(Nt===2){Nt=0;var e=qi,t=ts,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var l=K.p;K.p=2;var p=tt;tt|=4;try{Ud(e,t.alternate,t)}finally{tt=p,K.p=l,V.T=i}}Nt=3}}function dp(){if(Nt===4||Nt===3){Nt=0,wt();var e=qi,t=ts,i=gi,l=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,ts=qi=null,pp(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Fi=null),St(i),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(et,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=V.T,p=K.p,K.p=2,V.T=null;try{for(var w=e.onRecoverableError,B=0;B<l.length;B++){var P=l[B];w(P.value,{componentStack:P.stack})}}finally{V.T=t,K.p=p}}(gi&3)!==0&&Ra(),Yn(e),p=e.pendingLanes,(i&261930)!==0&&(p&42)!==0?e===qc?sl++:(sl=0,qc=e):sl=0,ll(0)}}function pp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function Ra(){return hp(),fp(),dp(),mp()}function mp(){if(Nt!==5)return!1;var e=qi,t=Pc;Pc=0;var i=St(gi),l=V.T,p=K.p;try{K.p=32>i?32:i,V.T=null,i=Fc,Fc=null;var w=qi,B=gi;if(Nt=0,ts=qi=null,gi=0,(tt&6)!==0)throw Error(o(331));var P=tt;if(tt|=4,Xd(w.current),Wd(w,w.current,B,i),tt=P,ll(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(et,w)}catch{}return!0}finally{K.p=p,V.T=l,pp(e,t)}}function gp(e,t,i){t=En(i,t),t=bc(e.stateNode,t,2),e=Ni(e,t,2),e!==null&&(Gn(e,2),Yn(e))}function rt(e,t,i){if(e.tag===3)gp(e,e,i);else for(;t!==null;){if(t.tag===3){gp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Fi===null||!Fi.has(l))){e=En(i,e),i=_d(2),l=Ni(t,i,2),l!==null&&(vd(i,l,t,e),Gn(l,2),Yn(l));break}}t=t.return}}function $c(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new i0;var p=new Set;l.set(t,p)}else p=l.get(t),p===void 0&&(p=new Set,l.set(t,p));p.has(i)||(zc=!0,p.add(i),e=o0.bind(null,e,t,i),t.then(e,e))}function o0(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Ke&i)===i&&(Ct===4||Ct===3&&(Ke&62914560)===Ke&&300>pt()-wa?(tt&2)===0&&ns(e,0):Ic|=i,es===Ke&&(es=0)),Yn(e)}function _p(e,t){t===0&&(t=Ll()),e=dr(e,t),e!==null&&(Gn(e,t),Yn(e))}function c0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),_p(e,i)}function u0(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(i=p.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),_p(e,i)}function h0(e,t){return Kt(e,t)}var Da=null,rs=null,Wc=!1,Ma=!1,Kc=!1,Vi=0;function Yn(e){e!==rs&&e.next===null&&(rs===null?Da=rs=e:rs=rs.next=e),Ma=!0,Wc||(Wc=!0,d0())}function ll(e,t){if(!Kc&&Ma){Kc=!0;do for(var i=!1,l=Da;l!==null;){if(e!==0){var p=l.pendingLanes;if(p===0)var w=0;else{var B=l.suspendedLanes,P=l.pingedLanes;w=(1<<31-qe(42|e)+1)-1,w&=p&~(B&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,bp(l,w))}else w=Ke,w=Jn(l,l===ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||rr(l,w)||(i=!0,bp(l,w));l=l.next}while(i);Kc=!1}}function f0(){vp()}function vp(){Ma=Wc=!1;var e=0;Vi!==0&&w0()&&(e=Vi);for(var t=pt(),i=null,l=Da;l!==null;){var p=l.next,w=yp(l,t);w===0?(l.next=null,i===null?Da=p:i.next=p,p===null&&(rs=i)):(i=l,(e!==0||(w&3)!==0)&&(Ma=!0)),l=p}Nt!==0&&Nt!==5||ll(e),Vi!==0&&(Vi=0)}function yp(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var B=31-qe(w),P=1<<B,Q=p[B];Q===-1?((P&i)===0||(P&l)!==0)&&(p[B]=mo(P,t)):Q<=t&&(e.expiredLanes|=P),w&=~P}if(t=ct,i=Ke,i=Jn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&tn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||rr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&tn(l),St(i)){case 2:case 8:i=ye;break;case 32:i=ke;break;case 268435456:i=je;break;default:i=ke}return l=Sp.bind(null,e),i=Kt(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&tn(l),e.callbackPriority=2,e.callbackNode=null,2}function Sp(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ra()&&e.callbackNode!==i)return null;var l=Ke;return l=Jn(e,e===ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tp(e,l,t),yp(e,pt()),e.callbackNode!=null&&e.callbackNode===i?Sp.bind(null,e):null)}function bp(e,t){if(Ra())return null;tp(e,t,!0)}function d0(){E0(function(){(tt&6)!==0?Kt(se,f0):vp()})}function Yc(){if(Vi===0){var e=qr;e===0&&(e=On,On<<=1,(On&261888)===0&&(On=256)),Vi=e}return Vi}function Cp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:pe(""+e)}function wp(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 p0(e,t,i,l,p){if(t==="submit"&&i&&i.stateNode===p){var w=Cp((p[Rt]||null).action),B=l.submitter;B&&(t=(t=B[Rt]||null)?Cp(t.formAction):B.getAttribute("formAction"),t!==null&&(w=t,B=null));var P=new ql("action","action",null,l,p);e.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Vi!==0){var Q=B?wp(p,B):new FormData(p);mc(i,{pending:!0,data:Q,method:p.method,action:w},null,Q)}}else typeof w=="function"&&(P.preventDefault(),Q=B?wp(p,B):new FormData(p),mc(i,{pending:!0,data:Q,method:p.method,action:w},w,Q))},currentTarget:p}]})}}for(var Xc=0;Xc<Lo.length;Xc++){var Qc=Lo[Xc],m0=Qc.toLowerCase(),g0=Qc[0].toUpperCase()+Qc.slice(1);In(m0,"on"+g0)}In(Jh,"onAnimationEnd"),In(ef,"onAnimationIteration"),In(tf,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Lv,"onTransitionRun"),In(Ov,"onTransitionStart"),In(Bv,"onTransitionCancel"),In(nf,"onTransitionEnd"),Ci("onMouseEnter",["mouseout","mouseover"]),Ci("onMouseLeave",["mouseout","mouseover"]),Ci("onPointerEnter",["pointerout","pointerover"]),Ci("onPointerLeave",["pointerout","pointerover"]),Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var al="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(" "),_0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(al));function xp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],p=l.event;l=l.listeners;e:{var w=void 0;if(t)for(var B=l.length-1;0<=B;B--){var P=l[B],Q=P.instance,ae=P.currentTarget;if(P=P.listener,Q!==w&&p.isPropagationStopped())break e;w=P,p.currentTarget=ae;try{w(p)}catch(me){$l(me)}p.currentTarget=null,w=Q}else for(B=0;B<l.length;B++){if(P=l[B],Q=P.instance,ae=P.currentTarget,P=P.listener,Q!==w&&p.isPropagationStopped())break e;w=P,p.currentTarget=ae;try{w(p)}catch(me){$l(me)}p.currentTarget=null,w=Q}}}}function Ve(e,t){var i=t[te];i===void 0&&(i=t[te]=new Set);var l=e+"__bubble";i.has(l)||(Ep(t,e,2,!1),i.add(l))}function Zc(e,t,i){var l=0;t&&(l|=4),Ep(i,e,l,t)}var La="_reactListening"+Math.random().toString(36).slice(2);function Jc(e){if(!e[La]){e[La]=!0,ws.forEach(function(i){i!=="selectionchange"&&(_0.has(i)||Zc(i,!1,e),Zc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[La]||(t[La]=!0,Zc("selectionchange",!1,t))}}function Ep(e,t,i,l){switch(em(t)){case 2:var p=V0;break;case 8:p=$0;break;default:p=pu}i=p.bind(null,t,i,e),p=void 0,!yo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(t,i,{capture:!0,passive:p}):e.addEventListener(t,i,!0):p!==void 0?e.addEventListener(t,i,{passive:p}):e.addEventListener(t,i,!1)}function eu(e,t,i,l,p){var w=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var B=l.tag;if(B===3||B===4){var P=l.stateNode.containerInfo;if(P===p)break;if(B===4)for(B=l.return;B!==null;){var Q=B.tag;if((Q===3||Q===4)&&B.stateNode.containerInfo===p)return;B=B.return}for(;P!==null;){if(B=ei(P),B===null)return;if(Q=B.tag,Q===5||Q===6||Q===26||Q===27){l=w=B;continue e}P=P.parentNode}}l=l.return}Rh(function(){var ae=w,me=ti(i),_e=[];e:{var oe=rf.get(e);if(oe!==void 0){var he=ql,Ae=e;switch(e){case"keypress":if(Pl(i)===0)break e;case"keydown":case"keyup":he=uv;break;case"focusin":Ae="focus",he=wo;break;case"focusout":Ae="blur",he=wo;break;case"beforeblur":case"afterblur":he=wo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Lh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Z_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=dv;break;case Jh:case ef:case tf:he=tv;break;case nf:he=mv;break;case"scroll":case"scrollend":he=X_;break;case"wheel":he=_v;break;case"copy":case"cut":case"paste":he=iv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Bh;break;case"toggle":case"beforetoggle":he=yv}var Oe=(t&4)!==0,ot=!Oe&&(e==="scroll"||e==="scrollend"),ie=Oe?oe!==null?oe+"Capture":null:oe;Oe=[];for(var ee=ae,le;ee!==null;){var ge=ee;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||ie===null||(ge=Rs(ee,ie),ge!=null&&Oe.push(ol(ee,ge,le))),ot)break;ee=ee.return}0<Oe.length&&(oe=new he(oe,Ae,null,i,me),_e.push({event:oe,listeners:Oe}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",oe&&i!==st&&(Ae=i.relatedTarget||i.fromElement)&&(ei(Ae)||Ae[jn]))break e;if((he||oe)&&(oe=me.window===me?me:(oe=me.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(Ae=i.relatedTarget||i.toElement,he=ae,Ae=Ae?ei(Ae):null,Ae!==null&&(ot=_(Ae),Oe=Ae.tag,Ae!==ot||Oe!==5&&Oe!==27&&Oe!==6)&&(Ae=null)):(he=null,Ae=ae),he!==Ae)){if(Oe=Lh,ge="onMouseLeave",ie="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=Bh,ge="onPointerLeave",ie="onPointerEnter",ee="pointer"),ot=he==null?oe:ar(he),le=Ae==null?oe:ar(Ae),oe=new Oe(ge,ee+"leave",he,i,me),oe.target=ot,oe.relatedTarget=le,ge=null,ei(me)===ae&&(Oe=new Oe(ie,ee+"enter",Ae,i,me),Oe.target=le,Oe.relatedTarget=ot,ge=Oe),ot=ge,he&&Ae)t:{for(Oe=v0,ie=he,ee=Ae,le=0,ge=ie;ge;ge=Oe(ge))le++;ge=0;for(var De=ee;De;De=Oe(De))ge++;for(;0<le-ge;)ie=Oe(ie),le--;for(;0<ge-le;)ee=Oe(ee),ge--;for(;le--;){if(ie===ee||ee!==null&&ie===ee.alternate){Oe=ie;break t}ie=Oe(ie),ee=Oe(ee)}Oe=null}else Oe=null;he!==null&&kp(_e,oe,he,Oe,!1),Ae!==null&&ot!==null&&kp(_e,ot,Ae,Oe,!0)}}e:{if(oe=ae?ar(ae):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Ze=Fh;else if(Uh(oe))if(qh)Ze=Rv;else{Ze=Av;var Te=kv}else he=oe.nodeName,!he||he.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&cr(ae.elementType)&&(Ze=Fh):Ze=Tv;if(Ze&&(Ze=Ze(e,ae))){Ph(_e,Ze,i,me);break e}Te&&Te(e,oe,ae),e==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&zn(oe,"number",oe.value)}switch(Te=ae?ar(ae):window,e){case"focusin":(Uh(Te)||Te.contentEditable==="true")&&(jr=Te,Ro=ae,Hs=null);break;case"focusout":Hs=Ro=jr=null;break;case"mousedown":Do=!0;break;case"contextmenu":case"mouseup":case"dragend":Do=!1,Qh(_e,i,me);break;case"selectionchange":if(Mv)break;case"keydown":case"keyup":Qh(_e,i,me)}var Pe;if(Eo)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 Br?zh(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(jh&&i.locale!=="ko"&&(Br||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Br&&(Pe=Dh()):(Ri=me,So="value"in Ri?Ri.value:Ri.textContent,Br=!0)),Te=Oa(ae,Ye),0<Te.length&&(Ye=new Oh(Ye,e,null,i,me),_e.push({event:Ye,listeners:Te}),Pe?Ye.data=Pe:(Pe=Ih(i),Pe!==null&&(Ye.data=Pe)))),(Pe=bv?Cv(e,i):wv(e,i))&&(Ye=Oa(ae,"onBeforeInput"),0<Ye.length&&(Te=new Oh("onBeforeInput","beforeinput",null,i,me),_e.push({event:Te,listeners:Ye}),Te.data=Pe)),p0(_e,e,ae,i,me)}xp(_e,t)})}function ol(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Oa(e,t){for(var i=t+"Capture",l=[];e!==null;){var p=e,w=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||w===null||(p=Rs(e,i),p!=null&&l.unshift(ol(e,p,w)),p=Rs(e,t),p!=null&&l.push(ol(e,p,w))),e.tag===3)return l;e=e.return}return[]}function v0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kp(e,t,i,l,p){for(var w=t._reactName,B=[];i!==null&&i!==l;){var P=i,Q=P.alternate,ae=P.stateNode;if(P=P.tag,Q!==null&&Q===l)break;P!==5&&P!==26&&P!==27||ae===null||(Q=ae,p?(ae=Rs(i,w),ae!=null&&B.unshift(ol(i,ae,Q))):p||(ae=Rs(i,w),ae!=null&&B.push(ol(i,ae,Q)))),i=i.return}B.length!==0&&e.push({event:t,listeners:B})}var y0=/\r\n?/g,S0=/\u0000|\uFFFD/g;function Ap(e){return(typeof e=="string"?e:""+e).replace(y0,`
49
- `).replace(S0,"")}function Tp(e,t){return t=Ap(t),Ap(e)===t}function at(e,t,i,l,p,w){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Ai(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Ai(e,""+l);break;case"className":Or(e,"class",l);break;case"tabIndex":Or(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Or(e,i,l);break;case"style":zl(e,l,w);break;case"data":if(t!=="object"){Or(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=pe(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(i==="formAction"?(t!=="input"&&at(e,t,"name",p.name,p,null),at(e,t,"formEncType",p.formEncType,p,null),at(e,t,"formMethod",p.formMethod,p,null),at(e,t,"formTarget",p.formTarget,p,null)):(at(e,t,"encType",p.encType,p,null),at(e,t,"method",p.method,p,null),at(e,t,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=pe(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=We);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=pe(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Lr(e,"popover",l);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Lr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Il.get(i)||i,Lr(e,i,l))}}function tu(e,t,i,l,p,w){switch(i){case"style":zl(e,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Ai(e,l):(typeof l=="number"||typeof l=="bigint")&&Ai(e,""+l);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=We);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xs.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),t=i.slice(2,p?i.length-7:void 0),w=e[Rt]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,p),typeof l=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,p);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Lr(e,i,l)}}}function Ft(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 l=!1,p=!1,w;for(w in i)if(i.hasOwnProperty(w)){var B=i[w];if(B!=null)switch(w){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,w,B,i,null)}}p&&at(e,t,"srcSet",i.srcSet,i,null),l&&at(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var P=w=B=p=null,Q=null,ae=null;for(l in i)if(i.hasOwnProperty(l)){var me=i[l];if(me!=null)switch(l){case"name":p=me;break;case"type":B=me;break;case"checked":Q=me;break;case"defaultChecked":ae=me;break;case"value":w=me;break;case"defaultValue":P=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(o(137,t));break;default:at(e,t,l,me,i,null)}}Vn(e,w,P,Q,ae,B,p,!1);return;case"select":Ve("invalid",e),l=B=w=null;for(p in i)if(i.hasOwnProperty(p)&&(P=i[p],P!=null))switch(p){case"value":w=P;break;case"defaultValue":B=P;break;case"multiple":l=P;default:at(e,t,p,P,i,null)}t=w,i=B,e.multiple=!!l,t!=null?ki(e,!!l,t,!1):i!=null&&ki(e,!!l,i,!0);return;case"textarea":Ve("invalid",e),w=p=l=null;for(B in i)if(i.hasOwnProperty(B)&&(P=i[B],P!=null))switch(B){case"value":l=P;break;case"defaultValue":p=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(91));break;default:at(e,t,B,P,i,null)}Ne(e,l,p,w);return;case"option":for(Q in i)if(i.hasOwnProperty(Q)&&(l=i[Q],l!=null))switch(Q){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:at(e,t,Q,l,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(l=0;l<al.length;l++)Ve(al[l],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(ae in i)if(i.hasOwnProperty(ae)&&(l=i[ae],l!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,ae,l,i,null)}return;default:if(cr(t)){for(me in i)i.hasOwnProperty(me)&&(l=i[me],l!==void 0&&tu(e,t,me,l,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(l=i[P],l!=null&&at(e,t,P,l,i,null))}function b0(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,w=null,B=null,P=null,Q=null,ae=null,me=null;for(he in i){var _e=i[he];if(i.hasOwnProperty(he)&&_e!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=_e;default:l.hasOwnProperty(he)||at(e,t,he,null,l,_e)}}for(var oe in l){var he=l[oe];if(_e=i[oe],l.hasOwnProperty(oe)&&(he!=null||_e!=null))switch(oe){case"type":w=he;break;case"name":p=he;break;case"checked":ae=he;break;case"defaultChecked":me=he;break;case"value":B=he;break;case"defaultValue":P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,t));break;default:he!==_e&&at(e,t,oe,he,l,_e)}}Ei(e,B,P,Q,ae,me,w,p);return;case"select":he=B=P=oe=null;for(w in i)if(Q=i[w],i.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":he=Q;default:l.hasOwnProperty(w)||at(e,t,w,null,l,Q)}for(p in l)if(w=l[p],Q=i[p],l.hasOwnProperty(p)&&(w!=null||Q!=null))switch(p){case"value":oe=w;break;case"defaultValue":P=w;break;case"multiple":B=w;default:w!==Q&&at(e,t,p,w,l,Q)}t=P,i=B,l=he,oe!=null?ki(e,!!i,oe,!1):!!l!=!!i&&(t!=null?ki(e,!!i,t,!0):ki(e,!!i,i?[]:"",!1));return;case"textarea":he=oe=null;for(P in i)if(p=i[P],i.hasOwnProperty(P)&&p!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:at(e,t,P,null,l,p)}for(B in l)if(p=l[B],w=i[B],l.hasOwnProperty(B)&&(p!=null||w!=null))switch(B){case"value":oe=p;break;case"defaultValue":he=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==w&&at(e,t,B,p,l,w)}Ts(e,oe,he);return;case"option":for(var Ae in i)if(oe=i[Ae],i.hasOwnProperty(Ae)&&oe!=null&&!l.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:at(e,t,Ae,null,l,oe)}for(Q in l)if(oe=l[Q],he=i[Q],l.hasOwnProperty(Q)&&oe!==he&&(oe!=null||he!=null))switch(Q){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:at(e,t,Q,oe,l,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in i)oe=i[Oe],i.hasOwnProperty(Oe)&&oe!=null&&!l.hasOwnProperty(Oe)&&at(e,t,Oe,null,l,oe);for(ae in l)if(oe=l[ae],he=i[ae],l.hasOwnProperty(ae)&&oe!==he&&(oe!=null||he!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:at(e,t,ae,oe,l,he)}return;default:if(cr(t)){for(var ot in i)oe=i[ot],i.hasOwnProperty(ot)&&oe!==void 0&&!l.hasOwnProperty(ot)&&tu(e,t,ot,void 0,l,oe);for(me in l)oe=l[me],he=i[me],!l.hasOwnProperty(me)||oe===he||oe===void 0&&he===void 0||tu(e,t,me,oe,l,he);return}}for(var ie in i)oe=i[ie],i.hasOwnProperty(ie)&&oe!=null&&!l.hasOwnProperty(ie)&&at(e,t,ie,null,l,oe);for(_e in l)oe=l[_e],he=i[_e],!l.hasOwnProperty(_e)||oe===he||oe==null&&he==null||at(e,t,_e,oe,l,he)}function Rp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var p=i[l],w=p.transferSize,B=p.initiatorType,P=p.duration;if(w&&P&&Rp(B)){for(B=0,P=p.responseEnd,l+=1;l<i.length;l++){var Q=i[l],ae=Q.startTime;if(ae>P)break;var me=Q.transferSize,_e=Q.initiatorType;me&&Rp(_e)&&(Q=Q.responseEnd,B+=me*(Q<P?1:(P-ae)/(Q-ae)))}if(--l,t+=8*(w+B)/(p.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nu=null,iu=null;function Ba(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Mp(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 ru(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 su=null;function w0(){var e=window.event;return e&&e.type==="popstate"?e===su?!1:(su=e,!0):(su=null,!1)}var Lp=typeof setTimeout=="function"?setTimeout:void 0,x0=typeof clearTimeout=="function"?clearTimeout:void 0,Op=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof Op<"u"?function(e){return Op.resolve(null).then(e).catch(k0)}:Lp;function k0(e){setTimeout(function(){throw e})}function $i(e){return e==="head"}function Bp(e,t){var i=t,l=0;do{var p=i.nextSibling;if(e.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(p),os(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")cl(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,cl(i);for(var w=i.firstChild;w;){var B=w.nextSibling,P=w.nodeName;w[Nn]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=B}}else i==="body"&&cl(e.ownerDocument.body);i=p}while(i);os(t)}function jp(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function lu(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":lu(i),lr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function A0(e,t,i,l){for(;e.nodeType===1;){var p=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Nn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(w=e.getAttribute("rel"),w==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(w!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=Dn(e.nextSibling),e===null)break}return null}function T0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Dn(e.nextSibling),e===null))return null;return e}function Np(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dn(e.nextSibling),e===null))return null;return e}function au(e){return e.data==="$?"||e.data==="$~"}function ou(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function R0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Dn(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 cu=null;function Hp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Dn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function zp(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 Ip(e,t,i){switch(t=Ba(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function cl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lr(e)}var Mn=new Map,Up=new Set;function ja(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _i=K.d;K.d={f:D0,r:M0,D:L0,C:O0,L:B0,m:j0,X:H0,S:N0,M:z0};function D0(){var e=_i.f(),t=ka();return e||t}function M0(e){var t=bi(e);t!==null&&t.tag===5&&t.type==="form"?id(t):_i.r(e)}var ss=typeof document>"u"?null:document;function Pp(e,t,i){var l=ss;if(l&&typeof t=="string"&&t){var p=xt(t);p='link[rel="'+e+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),Up.has(p)||(Up.add(p),e={rel:e,crossOrigin:i,href:t},l.querySelector(p)===null&&(t=l.createElement("link"),Ft(t,"link",e),nt(t),l.head.appendChild(t)))}}function L0(e){_i.D(e),Pp("dns-prefetch",e,null)}function O0(e,t){_i.C(e,t),Pp("preconnect",e,t)}function B0(e,t,i){_i.L(e,t,i);var l=ss;if(l&&e&&t){var p='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+xt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+xt(i.imageSizes)+'"]')):p+='[href="'+xt(e)+'"]';var w=p;switch(t){case"style":w=ls(e);break;case"script":w=as(e)}Mn.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Mn.set(w,e),l.querySelector(p)!==null||t==="style"&&l.querySelector(ul(w))||t==="script"&&l.querySelector(hl(w))||(t=l.createElement("link"),Ft(t,"link",e),nt(t),l.head.appendChild(t)))}}function j0(e,t){_i.m(e,t);var i=ss;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",p='link[rel="modulepreload"][as="'+xt(l)+'"][href="'+xt(e)+'"]',w=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=as(e)}if(!Mn.has(w)&&(e=u({rel:"modulepreload",href:e},t),Mn.set(w,e),i.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(hl(w)))return}l=i.createElement("link"),Ft(l,"link",e),nt(l),i.head.appendChild(l)}}}function N0(e,t,i){_i.S(e,t,i);var l=ss;if(l&&e){var p=Dt(l).hoistableStyles,w=ls(e);t=t||"default";var B=p.get(w);if(!B){var P={loading:0,preload:null};if(B=l.querySelector(ul(w)))P.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Mn.get(w))&&uu(e,i);var Q=B=l.createElement("link");nt(Q),Ft(Q,"link",e),Q._p=new Promise(function(ae,me){Q.onload=ae,Q.onerror=me}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Na(B,t,l)}B={type:"stylesheet",instance:B,count:1,state:P},p.set(w,B)}}}function H0(e,t){_i.X(e,t);var i=ss;if(i&&e){var l=Dt(i).hoistableScripts,p=as(e),w=l.get(p);w||(w=i.querySelector(hl(p)),w||(e=u({src:e,async:!0},t),(t=Mn.get(p))&&hu(e,t),w=i.createElement("script"),nt(w),Ft(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(p,w))}}function z0(e,t){_i.M(e,t);var i=ss;if(i&&e){var l=Dt(i).hoistableScripts,p=as(e),w=l.get(p);w||(w=i.querySelector(hl(p)),w||(e=u({src:e,async:!0,type:"module"},t),(t=Mn.get(p))&&hu(e,t),w=i.createElement("script"),nt(w),Ft(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(p,w))}}function Fp(e,t,i,l){var p=(p=ve.current)?ja(p):null;if(!p)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ls(i.href),i=Dt(p).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ls(i.href);var w=Dt(p).hoistableStyles,B=w.get(e);if(B||(p=p.ownerDocument||p,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,B),(w=p.querySelector(ul(e)))&&!w._p&&(B.instance=w,B.state.loading=5),Mn.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},Mn.set(e,i),w||I0(p,e,i,B.state))),t&&l===null)throw Error(o(528,""));return B}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=as(i),i=Dt(p).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ls(e){return'href="'+xt(e)+'"'}function ul(e){return'link[rel="stylesheet"]['+e+"]"}function qp(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function I0(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ft(t,"link",i),nt(t),e.head.appendChild(t))}function as(e){return'[src="'+xt(e)+'"]'}function hl(e){return"script[async]"+e}function Gp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+xt(i.href)+'"]');if(l)return t.instance=l,nt(l),l;var p=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),nt(l),Ft(l,"style",p),Na(l,i.precedence,e),t.instance=l;case"stylesheet":p=ls(i.href);var w=e.querySelector(ul(p));if(w)return t.state.loading|=4,t.instance=w,nt(w),w;l=qp(i),(p=Mn.get(p))&&uu(l,p),w=(e.ownerDocument||e).createElement("link"),nt(w);var B=w;return B._p=new Promise(function(P,Q){B.onload=P,B.onerror=Q}),Ft(w,"link",l),t.state.loading|=4,Na(w,i.precedence,e),t.instance=w;case"script":return w=as(i.src),(p=e.querySelector(hl(w)))?(t.instance=p,nt(p),p):(l=i,(p=Mn.get(w))&&(l=u({},i),hu(l,p)),e=e.ownerDocument||e,p=e.createElement("script"),nt(p),Ft(p,"link",l),e.head.appendChild(p),t.instance=p);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Na(l,i.precedence,e));return t.instance}function Na(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,w=p,B=0;B<l.length;B++){var P=l[B];if(P.dataset.precedence===t)w=P;else if(w!==p)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ha=null;function Vp(e,t,i){if(Ha===null){var l=new Map,p=Ha=new Map;p.set(i,l)}else p=Ha,l=p.get(i),l||(l=new Map,p.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),p=0;p<i.length;p++){var w=i[p];if(!(w[Nn]||w[yt]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var B=w.getAttribute(t)||"";B=e+B;var P=l.get(B);P?P.push(w):l.set(B,[w])}}return l}function $p(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function U0(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 Wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function P0(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=ls(l.href),w=t.querySelector(ul(p));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=za.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,nt(w);return}w=t.ownerDocument||t,l=qp(l),(p=Mn.get(p))&&uu(l,p),w=w.createElement("link"),nt(w);var B=w;B._p=new Promise(function(P,Q){B.onload=P,B.onerror=Q}),Ft(w,"link",l),i.instance=w}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=za.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var fu=0;function F0(e,t){return e.stylesheets&&e.count===0&&Ua(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&Ua(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&fu===0&&(fu=62500*C0());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ua(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>fu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function za(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ua(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ia=null;function Ua(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ia=new Map,t.forEach(q0,e),Ia=null,za.call(e))}function q0(e,t){if(!(t.state.loading&4)){var i=Ia.get(e);if(i)var l=i.get(null);else{i=new Map,Ia.set(e,i);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<p.length;w++){var B=p[w];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),l=B)}l&&i.set(null,l)}p=t.instance,B=p.getAttribute("data-precedence"),w=i.get(B)||l,w===l&&i.set(null,p),i.set(B,p),this.count++,l=za.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),w?w.parentNode.insertBefore(p,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),t.state.loading|=4}}var fl={$$typeof:S,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function G0(e,t,i,l,p,w,B,P,Q){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=Rr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rr(0),this.hiddenUpdates=Rr(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=w,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function Kp(e,t,i,l,p,w,B,P,Q,ae,me,_e){return e=new G0(e,t,i,B,Q,ae,me,_e,P),t=1,w===!0&&(t|=24),w=mn(3,null,null,t),e.current=w,w.stateNode=e,t=Vo(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:l,isDehydrated:i,cache:t},Yo(w),e}function Yp(e){return e?(e=zr,e):zr}function Xp(e,t,i,l,p,w){p=Yp(p),l.context===null?l.context=p:l.pendingContext=p,l=ji(t),l.payload={element:i},w=w===void 0?null:w,w!==null&&(l.callback=w),i=Ni(e,l,t),i!==null&&(un(i,e,t),Gs(i,e,t))}function Qp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function du(e,t){Qp(e,t),(e=e.alternate)&&Qp(e,t)}function Zp(e){if(e.tag===13||e.tag===31){var t=dr(e,67108864);t!==null&&un(t,e,67108864),du(e,67108864)}}function Jp(e){if(e.tag===13||e.tag===31){var t=Sn();t=Dr(t);var i=dr(e,t);i!==null&&un(i,e,t),du(e,t)}}var Pa=!0;function V0(e,t,i,l){var p=V.T;V.T=null;var w=K.p;try{K.p=2,pu(e,t,i,l)}finally{K.p=w,V.T=p}}function $0(e,t,i,l){var p=V.T;V.T=null;var w=K.p;try{K.p=8,pu(e,t,i,l)}finally{K.p=w,V.T=p}}function pu(e,t,i,l){if(Pa){var p=mu(l);if(p===null)eu(e,t,l,Fa,i),tm(e,l);else if(K0(p,e,t,i,l))l.stopPropagation();else if(tm(e,l),t&4&&-1<W0.indexOf(e)){for(;p!==null;){var w=bi(p);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var B=Zn(w.pendingLanes);if(B!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;B;){var Q=1<<31-qe(B);P.entanglements[1]|=Q,B&=~Q}Yn(w),(tt&6)===0&&(xa=pt()+500,ll(0))}}break;case 31:case 13:P=dr(w,2),P!==null&&un(P,w,2),ka(),du(w,2)}if(w=mu(l),w===null&&eu(e,t,l,Fa,i),w===p)break;p=w}p!==null&&l.stopPropagation()}else eu(e,t,l,null,i)}}function mu(e){return e=ti(e),gu(e)}var Fa=null;function gu(e){if(Fa=null,e=ei(e),e!==null){var t=_(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=a(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fa=e,null}function em(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(At()){case se:return 2;case ye:return 8;case ke:case Be:return 32;case je:return 268435456;default:return 32}default:return 32}}var _u=!1,Wi=null,Ki=null,Yi=null,dl=new Map,pl=new Map,Xi=[],W0="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 tm(e,t){switch(e){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":Yi=null;break;case"pointerover":case"pointerout":dl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(t.pointerId)}}function ml(e,t,i,l,p,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:w,targetContainers:[p]},t!==null&&(t=bi(t),t!==null&&Zp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function K0(e,t,i,l,p){switch(t){case"focusin":return Wi=ml(Wi,e,t,i,l,p),!0;case"dragenter":return Ki=ml(Ki,e,t,i,l,p),!0;case"mouseover":return Yi=ml(Yi,e,t,i,l,p),!0;case"pointerover":var w=p.pointerId;return dl.set(w,ml(dl.get(w)||null,e,t,i,l,p)),!0;case"gotpointercapture":return w=p.pointerId,pl.set(w,ml(pl.get(w)||null,e,t,i,l,p)),!0}return!1}function nm(e){var t=ei(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,Bn(e.priority,function(){Jp(i)});return}}else if(t===31){if(t=a(i),t!==null){e.blockedOn=t,Bn(e.priority,function(){Jp(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 qa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=mu(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);st=l,i.target.dispatchEvent(l),st=null}else return t=bi(i),t!==null&&Zp(t),e.blockedOn=i,!1;t.shift()}return!0}function im(e,t,i){qa(e)&&i.delete(t)}function Y0(){_u=!1,Wi!==null&&qa(Wi)&&(Wi=null),Ki!==null&&qa(Ki)&&(Ki=null),Yi!==null&&qa(Yi)&&(Yi=null),dl.forEach(im),pl.forEach(im)}function Ga(e,t){e.blockedOn===t&&(e.blockedOn=null,_u||(_u=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Y0)))}var Va=null;function rm(e){Va!==e&&(Va=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Va===e&&(Va=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],p=e[t+2];if(typeof l!="function"){if(gu(l||i)===null)continue;break}var w=bi(i);w!==null&&(e.splice(t,3),t-=3,mc(w,{pending:!0,data:p,method:i.method,action:l},l,p))}}))}function os(e){function t(Q){return Ga(Q,e)}Wi!==null&&Ga(Wi,e),Ki!==null&&Ga(Ki,e),Yi!==null&&Ga(Yi,e),dl.forEach(t),pl.forEach(t);for(var i=0;i<Xi.length;i++){var l=Xi[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Xi.length&&(i=Xi[0],i.blockedOn===null);)nm(i),i.blockedOn===null&&Xi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var p=i[l],w=i[l+1],B=p[Rt]||null;if(typeof w=="function")B||rm(i);else if(B){var P=null;if(w&&w.hasAttribute("formAction")){if(p=w,B=w[Rt]||null)P=B.formAction;else if(gu(p)!==null)continue}else P=B.action;typeof P=="function"?i[l+1]=P:(i.splice(l,3),l-=3),rm(i)}}}function sm(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(B){return p=B})},focusReset:"manual",scroll:"manual"})}function t(){p!==null&&(p(),p=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),p!==null&&(p(),p=null)}}}function vu(e){this._internalRoot=e}$a.prototype.render=vu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,l=Sn();Xp(i,l,e,t,null,null)},$a.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xp(e.current,2,null,e,null,null),ka(),t[jn]=null}};function $a(e){this._internalRoot=e}$a.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ss();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Xi.length&&t!==0&&t<Xi[i].priority;i++);Xi.splice(i,0,e),i===0&&nm(e)}};var lm=r.version;if(lm!=="19.2.6")throw Error(o(527,lm,"19.2.6"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?g(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 Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{et=Wa.inject(X0),Me=Wa}catch{}}return _l.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,l="",p=dd,w=pd,B=md;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(p=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(B=t.onRecoverableError)),t=Kp(e,1,!1,null,null,i,l,null,p,w,B,sm),e[jn]=t.current,Jc(e),new vu(t)},_l.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var l=!1,p="",w=dd,B=pd,P=md,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(B=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),t=Kp(e,1,!0,t,i??null,l,p,Q,w,B,P,sm),t.context=Yp(null),i=t.current,l=Sn(),l=Dr(l),p=ji(l),p.callback=null,Ni(i,p,l),i=l,t.current.lanes=i,Gn(t,i),Yn(t),e[jn]=t.current,Jc(e),new $a(t)},_l.version="19.2.6",_l}var _m;function o1(){if(_m)return bu.exports;_m=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(),bu.exports=a1(),bu.exports}var c1=o1();const gs=function(n,r){let d=n;const _=Cl[r];let f=null,a=0,c=null;const h=[],g={},u=function(D,E){a=d*4+17,f=(function(L){const O=new Array(L);for(let I=0;I<L;I+=1){O[I]=new Array(L);for(let F=0;F<L;F+=1)O[I][F]=null}return O})(a),b(0,0),b(a-7,0),b(0,a-7),x(),A(),v(D,E),d>=7&&y(D),c==null&&(c=k(d,_,h)),m(c,E)},b=function(D,E){for(let L=-1;L<=7;L+=1)if(!(D+L<=-1||a<=D+L))for(let O=-1;O<=7;O+=1)E+O<=-1||a<=E+O||(0<=L&&L<=6&&(O==0||O==6)||0<=O&&O<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=O&&O<=4?f[D+L][E+O]=!0:f[D+L][E+O]=!1)},C=function(){let D=0,E=0;for(let L=0;L<8;L+=1){u(!0,L);const O=Ji.getLostPoint(g);(L==0||D>O)&&(D=O,E=L)}return E},A=function(){for(let D=8;D<a-8;D+=1)f[D][6]==null&&(f[D][6]=D%2==0);for(let D=8;D<a-8;D+=1)f[6][D]==null&&(f[6][D]=D%2==0)},x=function(){const D=Ji.getPatternPosition(d);for(let E=0;E<D.length;E+=1)for(let L=0;L<D.length;L+=1){const O=D[E],I=D[L];if(f[O][I]==null)for(let F=-2;F<=2;F+=1)for(let U=-2;U<=2;U+=1)F==-2||F==2||U==-2||U==2||F==0&&U==0?f[O+F][I+U]=!0:f[O+F][I+U]=!1}},y=function(D){const E=Ji.getBCHTypeNumber(d);for(let L=0;L<18;L+=1){const O=!D&&(E>>L&1)==1;f[Math.floor(L/3)][L%3+a-8-3]=O}for(let L=0;L<18;L+=1){const O=!D&&(E>>L&1)==1;f[L%3+a-8-3][Math.floor(L/3)]=O}},v=function(D,E){const L=_<<3|E,O=Ji.getBCHTypeInfo(L);for(let I=0;I<15;I+=1){const F=!D&&(O>>I&1)==1;I<6?f[I][8]=F:I<8?f[I+1][8]=F:f[a-15+I][8]=F}for(let I=0;I<15;I+=1){const F=!D&&(O>>I&1)==1;I<8?f[8][a-I-1]=F:I<9?f[8][15-I-1+1]=F:f[8][15-I-1]=F}f[a-8][8]=!D},m=function(D,E){let L=-1,O=a-1,I=7,F=0;const U=Ji.getMaskFunction(E);for(let W=a-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let Y=0;Y<2;Y+=1)if(f[O][W-Y]==null){let V=!1;F<D.length&&(V=(D[F]>>>I&1)==1),U(O,W-Y)&&(V=!V),f[O][W-Y]=V,I-=1,I==-1&&(F+=1,I=7)}if(O+=L,O<0||a<=O){O-=L,L=-L;break}}},S=function(D,E){let L=0,O=0,I=0;const F=new Array(E.length),U=new Array(E.length);for(let K=0;K<E.length;K+=1){const J=E[K].dataCount,z=E[K].totalCount-J;O=Math.max(O,J),I=Math.max(I,z),F[K]=new Array(J);for(let N=0;N<F[K].length;N+=1)F[K][N]=255&D.getBuffer()[N+L];L+=J;const j=Ji.getErrorCorrectPolynomial(z),G=kl(F[K],j.getLength()-1).mod(j);U[K]=new Array(j.getLength()-1);for(let N=0;N<U[K].length;N+=1){const Z=N+G.getLength()-U[K].length;U[K][N]=Z>=0?G.getAt(Z):0}}let W=0;for(let K=0;K<E.length;K+=1)W+=E[K].totalCount;const Y=new Array(W);let V=0;for(let K=0;K<O;K+=1)for(let J=0;J<E.length;J+=1)K<F[J].length&&(Y[V]=F[J][K],V+=1);for(let K=0;K<I;K+=1)for(let J=0;J<E.length;J+=1)K<U[J].length&&(Y[V]=U[J][K],V+=1);return Y},k=function(D,E,L){const O=vm.getRSBlocks(D,E),I=ym();for(let U=0;U<L.length;U+=1){const W=L[U];I.put(W.getMode(),4),I.put(W.getLength(),Ji.getLengthInBits(W.getMode(),D)),W.write(I)}let F=0;for(let U=0;U<O.length;U+=1)F+=O[U].dataCount;if(I.getLengthInBits()>F*8)throw"code length overflow. ("+I.getLengthInBits()+">"+F*8+")";for(I.getLengthInBits()+4<=F*8&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=F*8||(I.put(236,8),I.getLengthInBits()>=F*8));)I.put(17,8);return S(I,O)};g.addData=function(D,E){E=E||"Byte";let L=null;switch(E){case"Numeric":L=u1(D);break;case"Alphanumeric":L=h1(D);break;case"Byte":L=f1(D);break;case"Kanji":L=d1(D);break;default:throw"mode:"+E}h.push(L),c=null},g.isDark=function(D,E){if(D<0||a<=D||E<0||a<=E)throw D+","+E;return f[D][E]},g.getModuleCount=function(){return a},g.make=function(){if(d<1){let D=1;for(;D<40;D++){const E=vm.getRSBlocks(D,_),L=ym();for(let I=0;I<h.length;I++){const F=h[I];L.put(F.getMode(),4),L.put(F.getLength(),Ji.getLengthInBits(F.getMode(),D)),F.write(L)}let O=0;for(let I=0;I<E.length;I++)O+=E[I].dataCount;if(L.getLengthInBits()<=O*8)break}d=D}u(!1,C())},g.createTableTag=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;let L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+E+"px;",L+='">',L+="<tbody>";for(let O=0;O<g.getModuleCount();O+=1){L+="<tr>";for(let I=0;I<g.getModuleCount();I+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+D+"px;",L+=" height: "+D+"px;",L+=" background-color: ",L+=g.isDark(O,I)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},g.createSvgTag=function(D,E,L,O){let I={};typeof arguments[0]=="object"&&(I=arguments[0],D=I.cellSize,E=I.margin,L=I.alt,O=I.title),D=D||2,E=typeof E>"u"?D*4:E,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-description":null,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-title":null;const F=g.getModuleCount()*D+E*2;let U,W,Y,V,K="",J;for(J="l"+D+",0 0,"+D+" -"+D+",0 0,-"+D+"z ",K+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',K+=I.scalable?"":' width="'+F+'px" height="'+F+'px"',K+=' viewBox="0 0 '+F+" "+F+'" ',K+=' preserveAspectRatio="xMinYMin meet"',K+=O.text||L.text?' role="img" aria-labelledby="'+M([O.id,L.id].join(" ").trim())+'"':"",K+=">",K+=O.text?'<title id="'+M(O.id)+'">'+M(O.text)+"</title>":"",K+=L.text?'<description id="'+M(L.id)+'">'+M(L.text)+"</description>":"",K+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',K+='<path d="',Y=0;Y<g.getModuleCount();Y+=1)for(V=Y*D+E,U=0;U<g.getModuleCount();U+=1)g.isDark(Y,U)&&(W=U*D+E,K+="M"+W+","+V+J);return K+='" stroke="transparent" fill="black"/>',K+="</svg>",K},g.createDataURL=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;const L=g.getModuleCount()*D+E*2,O=E,I=L-E;return _1(L,L,function(F,U){if(O<=F&&F<I&&O<=U&&U<I){const W=Math.floor((F-O)/D),Y=Math.floor((U-O)/D);return g.isDark(Y,W)?0:1}else return 1})},g.createImgTag=function(D,E,L){D=D||2,E=typeof E>"u"?D*4:E;const O=g.getModuleCount()*D+E*2;let I="";return I+="<img",I+=' src="',I+=g.createDataURL(D,E),I+='"',I+=' width="',I+=O,I+='"',I+=' height="',I+=O,I+='"',L&&(I+=' alt="',I+=M(L),I+='"'),I+="/>",I};const M=function(D){let E="";for(let L=0;L<D.length;L+=1){const O=D.charAt(L);switch(O){case"<":E+="&lt;";break;case">":E+="&gt;";break;case"&":E+="&amp;";break;case'"':E+="&quot;";break;default:E+=O;break}}return E},R=function(D){D=typeof D>"u"?2:D;const L=g.getModuleCount()*1+D*2,O=D,I=L-D;let F,U,W,Y,V;const K={"██":"█","█ ":"▀"," █":"▄"," ":" "},J={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(F=0;F<L;F+=2){for(W=Math.floor((F-O)/1),Y=Math.floor((F+1-O)/1),U=0;U<L;U+=1)V="█",O<=U&&U<I&&O<=F&&F<I&&g.isDark(W,Math.floor((U-O)/1))&&(V=" "),O<=U&&U<I&&O<=F+1&&F+1<I&&g.isDark(Y,Math.floor((U-O)/1))?V+=" ":V+="█",z+=D<1&&F+1>=I?J[V]:K[V];z+=`
48
+ `+l.stack}}var qt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,nn=n.unstable_cancelCallback,xn=n.unstable_shouldYield,wt=n.unstable_requestPaint,ft=n.unstable_now,At=n.unstable_getCurrentPriorityLevel,ne=n.unstable_ImmediatePriority,ye=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,Be=n.unstable_LowPriority,Ne=n.unstable_IdlePriority,dt=n.log,Ue=n.unstable_setDisableYieldValue,Je=null,we=null;function ct(e){if(typeof dt=="function"&&Ue(e),we&&typeof we.setStrictMode=="function")try{we.setStrictMode(Je,e)}catch{}}var qe=Math.clz32?Math.clz32:Yt,rn=Math.log,Tt=Math.LN2;function Yt(e){return e>>>=0,e===0?32:31-(rn(e)/Tt|0)|0}var Bn=256,ze=262144,Fn=4194304;function Jn(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 ei(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var p=0,w=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var P=l&134217727;return P!==0?(l=P&~w,l!==0?p=Jn(l):(B&=P,B!==0?p=Jn(B):i||(i=P&~e,i!==0&&(p=Jn(i))))):(P=l&~w,P!==0?p=Jn(P):B!==0?p=Jn(B):i||(i=l&~e,i!==0&&(p=Jn(i)))),p===0?0:t!==0&&t!==p&&(t&w)===0&&(w=p&-p,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:p}function nr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mo(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 Ol(){var e=Fn;return Fn<<=1,(Fn&62914560)===0&&(Fn=4194304),e}function kr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function qn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bl(e,t,i,l,p,w){var B=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var P=e.entanglements,Q=e.expirationTimes,ae=e.hiddenUpdates;for(i=B&~i;0<i;){var pe=31-qe(i),_e=1<<pe;P[pe]=0,Q[pe]=-1;var oe=ae[pe];if(oe!==null)for(ae[pe]=null,pe=0;pe<oe.length;pe++){var he=oe[pe];he!==null&&(he.lane&=-536870913)}i&=~_e}l!==0&&jl(e,l,0),w!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=w&~(B&~t))}function jl(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-qe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function ir(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-qe(i),p=1<<l;p&t|e[l]&t&&(e[l]|=t),i&=~p}}function ys(e,t){var i=t&-t;return i=(i&42)!==0?1:Ar(i),(i&(e.suspendedLanes|t))!==0?0:i}function Ar(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 gt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ss(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:em(e.type))}function jn(e,t){var i=K.p;try{return K.p=e,t()}finally{K.p=i}}var sn=Math.random().toString(36).slice(2),yt="__reactFiber$"+sn,jt="__reactProps$"+sn,Gn="__reactContainer$"+sn,ee="__reactEvents$"+sn,Xt="__reactListeners$"+sn,bs="__reactHandles$"+sn,Cs="__reactResources$"+sn,pn="__reactMarker$"+sn;function rr(e){delete e[yt],delete e[jt],delete e[ee],delete e[Xt],delete e[bs]}function ti(e){var t=e[yt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Gn]||i[yt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=zp(e);e!==null;){if(i=e[yt])return i;e=zp(e)}return t}e=i,i=e.parentNode}return null}function bi(e){if(e=e[yt]||e[Gn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function sr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Rt(e){var t=e[Cs];return t||(t=e[Cs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[pn]=!0}var ws=new Set,xs={};function Nn(e,t){Ci(e,t),Ci(e+"Capture",t)}function Ci(e,t){for(xs[e]=t,e=0;e<t.length;e++)ws.add(t[e])}var Tr=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]*$"),Nl={},Hl={};function go(e){return qt.call(Hl,e)?!0:qt.call(Nl,e)?!1:Tr.test(e)?Hl[e]=!0:(Nl[e]=!0,!1)}function Rr(e,t,i){if(go(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Dr(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 Qt(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}function Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wi(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Es(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,w=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return p.call(this)},set:function(B){i=""+B,w.call(this,B)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(B){i=""+B},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ks(e){if(!e._valueTracker){var t=wi(e)?"checked":"value";e._valueTracker=Es(e,t,""+e[t])}}function lr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=wi(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function xi(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 As=/[\n"\\]/g;function xt(e){return e.replace(As,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ei(e,t,i,l,p,w,B,P){e.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.type=B:e.removeAttribute("type"),t!=null?B==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),t!=null?Hn(e,B,Ht(t)):i!=null?Hn(e,B,Ht(i)):l!=null&&e.removeAttribute("value"),p==null&&w!=null&&(e.defaultChecked=!!w),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+Ht(P):e.removeAttribute("name")}function Vn(e,t,i,l,p,w,B,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.type=w),t!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||t!=null)){ks(e);return}i=i!=null?""+Ht(i):"",t=t!=null?""+Ht(t):i,P||t===e.value||(e.value=t),e.defaultValue=t}l=l??p,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=P?e.checked:!!l,e.defaultChecked=!!l,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(e.name=B),ks(e)}function Hn(e,t,i){t==="number"&&xi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function je(e,t,i,l){if(e=e.options,t){t={};for(var p=0;p<i.length;p++)t["$"+i[p]]=!0;for(i=0;i<e.length;i++)p=t.hasOwnProperty("$"+e[i].value),e[i].selected!==p&&(e[i].selected=p),p&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ht(i),t=null,p=0;p<e.length;p++){if(e[p].value===i){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}t!==null||e[p].disabled||(t=e[p])}t!==null&&(t.selected=!0)}}function zl(e,t,i){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ht(i):""}function Il(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(o(92));if(Y(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=Ht(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),ks(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 _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 Mr(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||_o.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Ts(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var p in t)l=t[p],t.hasOwnProperty(p)&&i[p]!==l&&Mr(e,p,l)}else for(var w in t)t.hasOwnProperty(w)&&Mr(e,w,t[w])}function $(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 me=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"]]),_t=/^[\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 St(e){return _t.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zt(){}var $n=null;function Rs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lr=null,Or=null;function Th(e){var t=bi(e);if(t&&(e=t.stateNode)){var i=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ei(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="'+xt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var p=l[jt]||null;if(!p)throw Error(o(90));Ei(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&lr(l)}break e;case"textarea":zl(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&je(e,!!i.multiple,t,!1)}}}var vo=!1;function Rh(e,t,i){if(vo)return e(t,i);vo=!0;try{var l=e(t);return l}finally{if(vo=!1,(Lr!==null||Or!==null)&&(ka(),Lr&&(t=Lr,e=Or,Or=Lr=null,Th(t),e)))for(t=0;t<e.length;t++)Th(e[t])}}function Ds(e,t){var i=e.stateNode;if(i===null)return null;var l=i[jt]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yo=!1;if(ni)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){yo=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{yo=!1}var Ai=null,So=null,Ul=null;function Dh(){if(Ul)return Ul;var e,t=So,i=t.length,l,p="value"in Ai?Ai.value:Ai.textContent,w=p.length;for(e=0;e<i&&t[e]===p[e];e++);var B=i-e;for(l=1;l<=B&&t[i-l]===p[w-l];l++);return Ul=p.slice(e,1<l?1-l:void 0)}function Pl(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 Fl(){return!0}function Mh(){return!1}function ln(e){function t(i,l,p,w,B){this._reactName=i,this._targetInst=p,this.type=l,this.nativeEvent=w,this.target=B,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(i=e[P],this[P]=i?i(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Fl:Mh,this.isPropagationStopped=Mh,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=Fl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),t}var ar={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=ln(ar),Ls=u({},ar,{view:0,detail:0}),X_=ln(Ls),bo,Co,Os,Gl=u({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xo,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!==Os&&(Os&&e.type==="mousemove"?(bo=e.screenX-Os.screenX,Co=e.screenY-Os.screenY):Co=bo=0,Os=e),bo)},movementY:function(e){return"movementY"in e?e.movementY:Co}}),Lh=ln(Gl),Q_=u({},Gl,{dataTransfer:0}),Z_=ln(Q_),J_=u({},Ls,{relatedTarget:0}),wo=ln(J_),ev=u({},ar,{animationName:0,elapsedTime:0,pseudoElement:0}),tv=ln(ev),nv=u({},ar,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),iv=ln(nv),rv=u({},ar,{data:0}),Oh=ln(rv),sv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lv={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"},av={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ov(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=av[e])?!!t[e]:!1}function xo(){return ov}var cv=u({},Ls,{key:function(e){if(e.key){var t=sv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xo,charCode:function(e){return e.type==="keypress"?Pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uv=ln(cv),hv=u({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bh=ln(hv),fv=u({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xo}),dv=ln(fv),pv=u({},ar,{propertyName:0,elapsedTime:0,pseudoElement:0}),mv=ln(pv),gv=u({},Gl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_v=ln(gv),vv=u({},ar,{newState:0,oldState:0}),yv=ln(vv),Sv=[9,13,27,32],Eo=ni&&"CompositionEvent"in window,Bs=null;ni&&"documentMode"in document&&(Bs=document.documentMode);var bv=ni&&"TextEvent"in window&&!Bs,jh=ni&&(!Eo||Bs&&8<Bs&&11>=Bs),Nh=" ",Hh=!1;function zh(e,t){switch(e){case"keyup":return Sv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ih(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function Cv(e,t){switch(e){case"compositionend":return Ih(t);case"keypress":return t.which!==32?null:(Hh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Hh?null:e;default:return null}}function wv(e,t){if(Br)return e==="compositionend"||!Eo&&zh(e,t)?(e=Dh(),Ul=So=Ai=null,Br=!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 jh&&t.locale!=="ko"?null:t.data;default:return null}}var xv={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xv[e.type]:t==="textarea"}function Ph(e,t,i,l){Lr?Or?Or.push(l):Or=[l]:Lr=l,t=Oa(t,"onChange"),0<t.length&&(i=new ql("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var js=null,Ns=null;function Ev(e){xp(e,0)}function Vl(e){var t=sr(e);if(lr(t))return e}function Fh(e,t){if(e==="change")return t}var qh=!1;if(ni){var ko;if(ni){var Ao="oninput"in document;if(!Ao){var Gh=document.createElement("div");Gh.setAttribute("oninput","return;"),Ao=typeof Gh.oninput=="function"}ko=Ao}else ko=!1;qh=ko&&(!document.documentMode||9<document.documentMode)}function Vh(){js&&(js.detachEvent("onpropertychange",$h),Ns=js=null)}function $h(e){if(e.propertyName==="value"&&Vl(Ns)){var t=[];Ph(t,Ns,e,Rs(e)),Rh(Ev,t)}}function kv(e,t,i){e==="focusin"?(Vh(),js=t,Ns=i,js.attachEvent("onpropertychange",$h)):e==="focusout"&&Vh()}function Av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(Ns)}function Tv(e,t){if(e==="click")return Vl(t)}function Rv(e,t){if(e==="input"||e==="change")return Vl(t)}function Dv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:Dv;function Hs(e,t){if(mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var p=i[l];if(!qt.call(t,p)||!mn(e[p],t[p]))return!1}return!0}function Wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kh(e,t){var i=Wh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wh(i)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xi(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=xi(e.document)}return t}function To(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 Mv=ni&&"documentMode"in document&&11>=document.documentMode,jr=null,Ro=null,zs=null,Do=!1;function Qh(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Do||jr==null||jr!==xi(l)||(l=jr,"selectionStart"in l&&To(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),zs&&Hs(zs,l)||(zs=l,l=Oa(Ro,"onSelect"),0<l.length&&(t=new ql("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=jr)))}function or(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Nr={animationend:or("Animation","AnimationEnd"),animationiteration:or("Animation","AnimationIteration"),animationstart:or("Animation","AnimationStart"),transitionrun:or("Transition","TransitionRun"),transitionstart:or("Transition","TransitionStart"),transitioncancel:or("Transition","TransitionCancel"),transitionend:or("Transition","TransitionEnd")},Mo={},Zh={};ni&&(Zh=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function cr(e){if(Mo[e])return Mo[e];if(!Nr[e])return e;var t=Nr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Zh)return Mo[e]=t[i];return e}var Jh=cr("animationend"),ef=cr("animationiteration"),tf=cr("animationstart"),Lv=cr("transitionrun"),Ov=cr("transitionstart"),Bv=cr("transitioncancel"),nf=cr("transitionend"),rf=new Map,Lo="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(" ");Lo.push("scrollEnd");function zn(e,t){rf.set(e,t),Nn(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)},En=[],Hr=0,Oo=0;function Wl(){for(var e=Hr,t=Oo=Hr=0;t<e;){var i=En[t];En[t++]=null;var l=En[t];En[t++]=null;var p=En[t];En[t++]=null;var w=En[t];if(En[t++]=null,l!==null&&p!==null){var B=l.pending;B===null?p.next=p:(p.next=B.next,B.next=p),l.pending=p}w!==0&&sf(i,p,w)}}function Kl(e,t,i,l){En[Hr++]=e,En[Hr++]=t,En[Hr++]=i,En[Hr++]=l,Oo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Bo(e,t,i,l){return Kl(e,t,i,l),Yl(e)}function ur(e,t){return Kl(e,null,null,t),Yl(e)}function sf(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var p=!1,w=e.return;w!==null;)w.childLanes|=i,l=w.alternate,l!==null&&(l.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(p=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,p&&t!==null&&(p=31-qe(i),e=w.hiddenUpdates,l=e[p],l===null?e[p]=[t]:l.push(t),t.lane=i|536870912),w):null}function Yl(e){if(50<ll)throw ll=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zr={};function jv(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,i,l){return new jv(e,t,i,l)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var i=e.alternate;return i===null?(i=gn(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 Xl(e,t,i,l,p,w){var B=0;if(l=e,typeof e=="function")jo(e)&&(B=1);else if(typeof e=="string")B=U0(e,i,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=gn(31,i,t,p),e.elementType=L,e.lanes=w,e;case x:return hr(i.children,p,w,t);case y:B=8,p|=24;break;case v:return e=gn(12,i,t,p|2),e.elementType=v,e.lanes=w,e;case M:return e=gn(13,i,t,p),e.elementType=M,e.lanes=w,e;case R:return e=gn(19,i,t,p),e.elementType=R,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:B=10;break e;case m:B=9;break e;case k:B=11;break e;case D:B=14;break e;case E:B=16,l=null;break e}B=29,i=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=gn(B,i,t,p),t.elementType=e,t.type=l,t.lanes=w,t}function hr(e,t,i,l){return e=gn(7,e,l,t),e.lanes=i,e}function No(e,t,i){return e=gn(6,e,null,t),e.lanes=i,e}function af(e){var t=gn(18,null,null,0);return t.stateNode=e,t}function Ho(e,t,i){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function kn(e,t){if(typeof e=="object"&&e!==null){var i=of.get(e);return i!==void 0?i:(t={value:e,source:t,stack:tn(t)},of.set(e,t),t)}return{value:e,source:t,stack:tn(t)}}var Ir=[],Ur=0,Ql=null,Is=0,An=[],Tn=0,Ti=null,Wn=1,Kn="";function ri(e,t){Ir[Ur++]=Is,Ir[Ur++]=Ql,Ql=e,Is=t}function cf(e,t,i){An[Tn++]=Wn,An[Tn++]=Kn,An[Tn++]=Ti,Ti=e;var l=Wn;e=Kn;var p=32-qe(l)-1;l&=~(1<<p),i+=1;var w=32-qe(t)+p;if(30<w){var B=p-p%5;w=(l&(1<<B)-1).toString(32),l>>=B,p-=B,Wn=1<<32-qe(t)+p|i<<p|l,Kn=w+e}else Wn=1<<w|i<<p|l,Kn=e}function zo(e){e.return!==null&&(ri(e,1),cf(e,1,0))}function Io(e){for(;e===Ql;)Ql=Ir[--Ur],Ir[Ur]=null,Is=Ir[--Ur],Ir[Ur]=null;for(;e===Ti;)Ti=An[--Tn],An[Tn]=null,Kn=An[--Tn],An[Tn]=null,Wn=An[--Tn],An[Tn]=null}function uf(e,t){An[Tn++]=Wn,An[Tn++]=Kn,An[Tn++]=Ti,Wn=t.id,Kn=t.overflow,Ti=e}var It=null,pt=null,Ye=!1,Ri=null,Rn=!1,Uo=Error(o(519));function Di(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Us(kn(t,e)),Uo}function hf(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[yt]=e,t[jt]=l,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<ol.length;i++)Ve(ol[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),Vn(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Il(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||Tp(t.textContent,i)?(l.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),l.onScroll!=null&&Ve("scroll",t),l.onScrollEnd!=null&&Ve("scrollend",t),l.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||Di(e,!0)}function ff(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:Rn=!1;return;case 27:case 3:Rn=!0;return;default:It=It.return}}function Pr(e){if(e!==It)return!1;if(!Ye)return ff(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||ru(e.type,e.memoizedProps)),i=!i),i&&pt&&Di(e),ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));pt=Hp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));pt=Hp(e)}else t===27?(t=pt,Gi(e.type)?(e=cu,cu=null,pt=e):pt=t):pt=It?Mn(e.stateNode.nextSibling):null;return!0}function fr(){pt=It=null,Ye=!1}function Po(){var e=Ri;return e!==null&&(un===null?un=e:un.push.apply(un,e),Ri=null),e}function Us(e){Ri===null?Ri=[e]:Ri.push(e)}var Fo=H(null),dr=null,si=null;function Mi(e,t,i){N(Fo,t._currentValue),t._currentValue=i}function li(e){e._currentValue=Fo.current,G(Fo)}function qo(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Go(e,t,i,l){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var w=p.dependencies;if(w!==null){var B=p.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=p;for(var Q=0;Q<t.length;Q++)if(P.context===t[Q]){w.lanes|=i,P=w.alternate,P!==null&&(P.lanes|=i),qo(w.return,i,e),l||(B=null);break e}w=P.next}}else if(p.tag===18){if(B=p.return,B===null)throw Error(o(341));B.lanes|=i,w=B.alternate,w!==null&&(w.lanes|=i),qo(B,i,e),B=null}else B=p.child;if(B!==null)B.return=p;else for(B=p;B!==null;){if(B===e){B=null;break}if(p=B.sibling,p!==null){p.return=B.return,B=p;break}B=B.return}p=B}}function Fr(e,t,i,l){e=null;for(var p=t,w=!1;p!==null;){if(!w){if((p.flags&524288)!==0)w=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var B=p.alternate;if(B===null)throw Error(o(387));if(B=B.memoizedProps,B!==null){var P=p.type;mn(p.pendingProps.value,B.value)||(e!==null?e.push(P):e=[P])}}else if(p===X.current){if(B=p.alternate,B===null)throw Error(o(387));B.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(dl):e=[dl])}p=p.return}e!==null&&Go(t,e,i,l),t.flags|=262144}function Zl(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pr(e){dr=e,si=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return df(dr,e)}function Jl(e,t){return dr===null&&pr(e),df(e,t)}function df(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},si===null){if(e===null)throw Error(o(308));si=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else si=si.next=t;return i}var Nv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Hv=n.unstable_scheduleCallback,zv=n.unstable_NormalPriority,Dt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vo(){return{controller:new Nv,data:new Map,refCount:0}}function Ps(e){e.refCount--,e.refCount===0&&Hv(zv,function(){e.controller.abort()})}var Fs=null,$o=0,qr=0,Gr=null;function Iv(e,t){if(Fs===null){var i=Fs=[];$o=0,qr=Yc(),Gr={status:"pending",value:void 0,then:function(l){i.push(l)}}}return $o++,t.then(pf,pf),t}function pf(){if(--$o===0&&Fs!==null){Gr!==null&&(Gr.status="fulfilled");var e=Fs;Fs=null,qr=0,Gr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Uv(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var p=0;p<i.length;p++)(0,i[p])(t)},function(p){for(l.status="rejected",l.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),l}var mf=V.S;V.S=function(e,t){Zd=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Iv(e,t),mf!==null&&mf(e,t)};var mr=H(null);function Wo(){var e=mr.current;return e!==null?e:at.pooledCache}function ea(e,t){t===null?N(mr,mr.current):N(mr,t.pool)}function gf(){var e=Wo();return e===null?null:{parent:Dt._currentValue,pool:e}}var Vr=Error(o(460)),Ko=Error(o(474)),ta=Error(o(542)),na={then:function(){}};function _f(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Zt,Zt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sf(e),e;default:if(typeof t.status=="string")t.then(Zt,Zt);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var p=t;p.status="fulfilled",p.value=l}},function(l){if(t.status==="pending"){var p=t;p.status="rejected",p.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sf(e),e}throw _r=t,Vr}}function gr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(_r=i,Vr):i}}var _r=null;function yf(){if(_r===null)throw Error(o(459));var e=_r;return _r=null,e}function Sf(e){if(e===Vr||e===ta)throw Error(o(483))}var $r=null,qs=0;function ia(e){var t=qs;return qs+=1,$r===null&&($r=[]),vf($r,e,t)}function Gs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ra(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bf(e){function t(re,te){if(e){var le=re.deletions;le===null?(re.deletions=[te],re.flags|=16):le.push(te)}}function i(re,te){if(!e)return null;for(;te!==null;)t(re,te),te=te.sibling;return null}function l(re){for(var te=new Map;re!==null;)re.key!==null?te.set(re.key,re):te.set(re.index,re),re=re.sibling;return te}function p(re,te){return re=ii(re,te),re.index=0,re.sibling=null,re}function w(re,te,le){return re.index=le,e?(le=re.alternate,le!==null?(le=le.index,le<te?(re.flags|=67108866,te):le):(re.flags|=67108866,te)):(re.flags|=1048576,te)}function B(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function P(re,te,le,ge){return te===null||te.tag!==6?(te=No(le,re.mode,ge),te.return=re,te):(te=p(te,le),te.return=re,te)}function Q(re,te,le,ge){var Me=le.type;return Me===x?pe(re,te,le.props.children,ge,le.key):te!==null&&(te.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===E&&gr(Me)===te.type)?(te=p(te,le.props),Gs(te,le),te.return=re,te):(te=Xl(le.type,le.key,le.props,null,re.mode,ge),Gs(te,le),te.return=re,te)}function ae(re,te,le,ge){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=Ho(le,re.mode,ge),te.return=re,te):(te=p(te,le.children||[]),te.return=re,te)}function pe(re,te,le,ge,Me){return te===null||te.tag!==7?(te=hr(le,re.mode,ge,Me),te.return=re,te):(te=p(te,le),te.return=re,te)}function _e(re,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=No(""+te,re.mode,le),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return le=Xl(te.type,te.key,te.props,null,re.mode,le),Gs(le,te),le.return=re,le;case A:return te=Ho(te,re.mode,le),te.return=re,te;case E:return te=gr(te),_e(re,te,le)}if(Y(te)||F(te))return te=hr(te,re.mode,le,null),te.return=re,te;if(typeof te.then=="function")return _e(re,ia(te),le);if(te.$$typeof===S)return _e(re,Jl(re,te),le);ra(re,te)}return null}function oe(re,te,le,ge){var Me=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Me!==null?null:P(re,te,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Me?Q(re,te,le,ge):null;case A:return le.key===Me?ae(re,te,le,ge):null;case E:return le=gr(le),oe(re,te,le,ge)}if(Y(le)||F(le))return Me!==null?null:pe(re,te,le,ge,null);if(typeof le.then=="function")return oe(re,te,ia(le),ge);if(le.$$typeof===S)return oe(re,te,Jl(re,le),ge);ra(re,le)}return null}function he(re,te,le,ge,Me){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(le)||null,P(te,re,""+ge,Me);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case C:return re=re.get(ge.key===null?le:ge.key)||null,Q(te,re,ge,Me);case A:return re=re.get(ge.key===null?le:ge.key)||null,ae(te,re,ge,Me);case E:return ge=gr(ge),he(re,te,le,ge,Me)}if(Y(ge)||F(ge))return re=re.get(le)||null,pe(te,re,ge,Me,null);if(typeof ge.then=="function")return he(re,te,le,ia(ge),Me);if(ge.$$typeof===S)return he(re,te,le,Jl(te,ge),Me);ra(te,ge)}return null}function Te(re,te,le,ge){for(var Me=null,Qe=null,Re=te,Pe=te=0,Ke=null;Re!==null&&Pe<le.length;Pe++){Re.index>Pe?(Ke=Re,Re=null):Ke=Re.sibling;var Ze=oe(re,Re,le[Pe],ge);if(Ze===null){Re===null&&(Re=Ke);break}e&&Re&&Ze.alternate===null&&t(re,Re),te=w(Ze,te,Pe),Qe===null?Me=Ze:Qe.sibling=Ze,Qe=Ze,Re=Ke}if(Pe===le.length)return i(re,Re),Ye&&ri(re,Pe),Me;if(Re===null){for(;Pe<le.length;Pe++)Re=_e(re,le[Pe],ge),Re!==null&&(te=w(Re,te,Pe),Qe===null?Me=Re:Qe.sibling=Re,Qe=Re);return Ye&&ri(re,Pe),Me}for(Re=l(Re);Pe<le.length;Pe++)Ke=he(Re,re,Pe,le[Pe],ge),Ke!==null&&(e&&Ke.alternate!==null&&Re.delete(Ke.key===null?Pe:Ke.key),te=w(Ke,te,Pe),Qe===null?Me=Ke:Qe.sibling=Ke,Qe=Ke);return e&&Re.forEach(function(Yi){return t(re,Yi)}),Ye&&ri(re,Pe),Me}function Oe(re,te,le,ge){if(le==null)throw Error(o(151));for(var Me=null,Qe=null,Re=te,Pe=te=0,Ke=null,Ze=le.next();Re!==null&&!Ze.done;Pe++,Ze=le.next()){Re.index>Pe?(Ke=Re,Re=null):Ke=Re.sibling;var Yi=oe(re,Re,Ze.value,ge);if(Yi===null){Re===null&&(Re=Ke);break}e&&Re&&Yi.alternate===null&&t(re,Re),te=w(Yi,te,Pe),Qe===null?Me=Yi:Qe.sibling=Yi,Qe=Yi,Re=Ke}if(Ze.done)return i(re,Re),Ye&&ri(re,Pe),Me;if(Re===null){for(;!Ze.done;Pe++,Ze=le.next())Ze=_e(re,Ze.value,ge),Ze!==null&&(te=w(Ze,te,Pe),Qe===null?Me=Ze:Qe.sibling=Ze,Qe=Ze);return Ye&&ri(re,Pe),Me}for(Re=l(Re);!Ze.done;Pe++,Ze=le.next())Ze=he(Re,re,Pe,Ze.value,ge),Ze!==null&&(e&&Ze.alternate!==null&&Re.delete(Ze.key===null?Pe:Ze.key),te=w(Ze,te,Pe),Qe===null?Me=Ze:Qe.sibling=Ze,Qe=Ze);return e&&Re.forEach(function(Q0){return t(re,Q0)}),Ye&&ri(re,Pe),Me}function lt(re,te,le,ge){if(typeof le=="object"&&le!==null&&le.type===x&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Me=le.key;te!==null;){if(te.key===Me){if(Me=le.type,Me===x){if(te.tag===7){i(re,te.sibling),ge=p(te,le.props.children),ge.return=re,re=ge;break e}}else if(te.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===E&&gr(Me)===te.type){i(re,te.sibling),ge=p(te,le.props),Gs(ge,le),ge.return=re,re=ge;break e}i(re,te);break}else t(re,te);te=te.sibling}le.type===x?(ge=hr(le.props.children,re.mode,ge,le.key),ge.return=re,re=ge):(ge=Xl(le.type,le.key,le.props,null,re.mode,ge),Gs(ge,le),ge.return=re,re=ge)}return B(re);case A:e:{for(Me=le.key;te!==null;){if(te.key===Me)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){i(re,te.sibling),ge=p(te,le.children||[]),ge.return=re,re=ge;break e}else{i(re,te);break}else t(re,te);te=te.sibling}ge=Ho(le,re.mode,ge),ge.return=re,re=ge}return B(re);case E:return le=gr(le),lt(re,te,le,ge)}if(Y(le))return Te(re,te,le,ge);if(F(le)){if(Me=F(le),typeof Me!="function")throw Error(o(150));return le=Me.call(le),Oe(re,te,le,ge)}if(typeof le.then=="function")return lt(re,te,ia(le),ge);if(le.$$typeof===S)return lt(re,te,Jl(re,le),ge);ra(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(i(re,te.sibling),ge=p(te,le),ge.return=re,re=ge):(i(re,te),ge=No(le,re.mode,ge),ge.return=re,re=ge),B(re)):i(re,te)}return function(re,te,le,ge){try{qs=0;var Me=lt(re,te,le,ge);return $r=null,Me}catch(Re){if(Re===Vr||Re===ta)throw Re;var Qe=gn(29,Re,null,re.mode);return Qe.lanes=ge,Qe.return=re,Qe}finally{}}}var vr=bf(!0),Cf=bf(!1),Li=!1;function Yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xo(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 Oi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Bi(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(et&2)!==0){var p=l.pending;return p===null?t.next=t:(t.next=p.next,p.next=t),l.pending=t,t=Yl(e),sf(e,null,i),t}return Kl(e,l,t,i),Yl(e)}function Vs(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,ir(e,i)}}function Qo(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var p=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var B={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?p=w=B:w=w.next=B,i=i.next}while(i!==null);w===null?p=w=t:w=w.next=t}else p=w=t;i={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Zo=!1;function $s(){if(Zo){var e=Gr;if(e!==null)throw e}}function Ws(e,t,i,l){Zo=!1;var p=e.updateQueue;Li=!1;var w=p.firstBaseUpdate,B=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var Q=P,ae=Q.next;Q.next=null,B===null?w=ae:B.next=ae,B=Q;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,P=pe.lastBaseUpdate,P!==B&&(P===null?pe.firstBaseUpdate=ae:P.next=ae,pe.lastBaseUpdate=Q))}if(w!==null){var _e=p.baseState;B=0,pe=ae=Q=null,P=w;do{var oe=P.lane&-536870913,he=oe!==P.lane;if(he?(We&oe)===oe:(l&oe)===oe){oe!==0&&oe===qr&&(Zo=!0),pe!==null&&(pe=pe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Te=e,Oe=P;oe=t;var lt=i;switch(Oe.tag){case 1:if(Te=Oe.payload,typeof Te=="function"){_e=Te.call(lt,_e,oe);break e}_e=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Oe.payload,oe=typeof Te=="function"?Te.call(lt,_e,oe):Te,oe==null)break e;_e=u({},_e,oe);break e;case 2:Li=!0}}oe=P.callback,oe!==null&&(e.flags|=64,he&&(e.flags|=8192),he=p.callbacks,he===null?p.callbacks=[oe]:he.push(oe))}else he={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},pe===null?(ae=pe=he,Q=_e):pe=pe.next=he,B|=oe;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;he=P,P=he.next,he.next=null,p.lastBaseUpdate=he,p.shared.pending=null}}while(!0);pe===null&&(Q=_e),p.baseState=Q,p.firstBaseUpdate=ae,p.lastBaseUpdate=pe,w===null&&(p.shared.lanes=0),Ii|=B,e.lanes=B,e.memoizedState=_e}}function wf(e,t){if(typeof e!="function")throw Error(o(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++)wf(i[e],t)}var Wr=H(null),sa=H(0);function Ef(e,t){e=mi,N(sa,e),N(Wr,t),mi=e|t.baseLanes}function Jo(){N(sa,mi),N(Wr,Wr.current)}function ec(){mi=sa.current,G(Wr),G(sa)}var _n=H(null),Dn=null;function ji(e){var t=e.alternate;N(Et,Et.current&1),N(_n,e),Dn===null&&(t===null||Wr.current!==null||t.memoizedState!==null)&&(Dn=e)}function tc(e){N(Et,Et.current),N(_n,e),Dn===null&&(Dn=e)}function kf(e){e.tag===22?(N(Et,Et.current),N(_n,e),Dn===null&&(Dn=e)):Ni()}function Ni(){N(Et,Et.current),N(_n,_n.current)}function vn(e){G(_n),Dn===e&&(Dn=null),G(Et)}var Et=H(0);function la(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||au(i)||ou(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,rt=null,Mt=null,aa=!1,Kr=!1,yr=!1,oa=0,Ks=0,Yr=null,Pv=0;function bt(){throw Error(o(321))}function nc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!mn(e[i],t[i]))return!1;return!0}function ic(e,t,i,l,p,w){return ai=w,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?cd:vc,yr=!1,w=i(l,p),yr=!1,Kr&&(w=Tf(t,i,l,p)),Af(e),w}function Af(e){V.H=Qs;var t=rt!==null&&rt.next!==null;if(ai=0,Mt=rt=Ie=null,aa=!1,Ks=0,Yr=null,t)throw Error(o(300));e===null||Lt||(e=e.dependencies,e!==null&&Zl(e)&&(Lt=!0))}function Tf(e,t,i,l){Ie=e;var p=0;do{if(Kr&&(Yr=null),Ks=0,Kr=!1,25<=p)throw Error(o(301));if(p+=1,Mt=rt=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}V.H=ud,w=t(i,l)}while(Kr);return w}function Fv(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?Ys(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Ie.flags|=1024),t}function rc(){var e=oa!==0;return oa=0,e}function sc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function lc(e){if(aa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}aa=!1}ai=0,Mt=rt=Ie=null,Kr=!1,Ks=oa=0,Yr=null}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ie.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function kt(){if(rt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Mt===null?Ie.memoizedState:Mt.next;if(t!==null)Mt=t,rt=e;else{if(e===null)throw Ie.alternate===null?Error(o(467)):Error(o(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Mt===null?Ie.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function ca(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ys(e){var t=Ks;return Ks+=1,Yr===null&&(Yr=[]),e=vf(Yr,e,t),t=Ie,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?cd:vc),e}function ua(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ys(e);if(e.$$typeof===S)return Ut(e)}throw Error(o(438,String(e)))}function ac(e){var t=null,i=Ie.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=Ie.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(p){return p.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=ca(),Ie.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=O;return t.index++,i}function oi(e,t){return typeof t=="function"?t(e):t}function ha(e){var t=kt();return oc(t,rt,e)}function oc(e,t,i){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var p=e.baseQueue,w=l.pending;if(w!==null){if(p!==null){var B=p.next;p.next=w.next,w.next=B}t.baseQueue=p=w,l.pending=null}if(w=e.baseState,p===null)e.memoizedState=w;else{t=p.next;var P=B=null,Q=null,ae=t,pe=!1;do{var _e=ae.lane&-536870913;if(_e!==ae.lane?(We&_e)===_e:(ai&_e)===_e){var oe=ae.revertLane;if(oe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),_e===qr&&(pe=!0);else if((ai&oe)===oe){ae=ae.next,oe===qr&&(pe=!0);continue}else _e={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=_e,B=w):Q=Q.next=_e,Ie.lanes|=oe,Ii|=oe;_e=ae.action,yr&&i(w,_e),w=ae.hasEagerState?ae.eagerState:i(w,_e)}else oe={lane:_e,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=oe,B=w):Q=Q.next=oe,Ie.lanes|=_e,Ii|=_e;ae=ae.next}while(ae!==null&&ae!==t);if(Q===null?B=w:Q.next=P,!mn(w,e.memoizedState)&&(Lt=!0,pe&&(i=Gr,i!==null)))throw i;e.memoizedState=w,e.baseState=B,e.baseQueue=Q,l.lastRenderedState=w}return p===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function cc(e){var t=kt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,p=i.pending,w=t.memoizedState;if(p!==null){i.pending=null;var B=p=p.next;do w=e(w,B.action),B=B.next;while(B!==p);mn(w,t.memoizedState)||(Lt=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,l]}function Rf(e,t,i){var l=Ie,p=kt(),w=Ye;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=t();var B=!mn((rt||p).memoizedState,i);if(B&&(p.memoizedState=i,Lt=!0),p=p.queue,fc(Lf.bind(null,l,p,e),[e]),p.getSnapshot!==t||B||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,Xr(9,{destroy:void 0},Mf.bind(null,l,p,i,t),null),at===null)throw Error(o(349));w||(ai&127)!==0||Df(l,t,i)}return i}function Df(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ie.updateQueue,t===null?(t=ca(),Ie.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Mf(e,t,i,l){t.value=i,t.getSnapshot=l,Of(t)&&Bf(e)}function Lf(e,t,i){return i(function(){Of(t)&&Bf(e)})}function Of(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!mn(e,i)}catch{return!0}}function Bf(e){var t=ur(e,2);t!==null&&hn(t,e,2)}function uc(e){var t=Jt();if(typeof e=="function"){var i=e;if(e=i(),yr){ct(!0);try{i()}finally{ct(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:e},t}function jf(e,t,i,l){return e.baseState=i,oc(e,rt,typeof l=="function"?l:oi)}function qv(e,t,i,l,p){if(pa(e))throw Error(o(485));if(e=t.action,e!==null){var w={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){w.listeners.push(B)}};V.T!==null?i(!0):w.isTransition=!1,l(w),i=t.pending,i===null?(w.next=t.pending=w,Nf(t,w)):(w.next=i.next,t.pending=i.next=w)}}function Nf(e,t){var i=t.action,l=t.payload,p=e.state;if(t.isTransition){var w=V.T,B={};V.T=B;try{var P=i(p,l),Q=V.S;Q!==null&&Q(B,P),Hf(e,t,P)}catch(ae){hc(e,t,ae)}finally{w!==null&&B.types!==null&&(w.types=B.types),V.T=w}}else try{w=i(p,l),Hf(e,t,w)}catch(ae){hc(e,t,ae)}}function Hf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){zf(e,t,l)},function(l){return hc(e,t,l)}):zf(e,t,i)}function zf(e,t,i){t.status="fulfilled",t.value=i,If(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Nf(e,i)))}function hc(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,If(t),t=t.next;while(t!==l)}e.action=null}function If(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uf(e,t){return t}function Pf(e,t){if(Ye){var i=at.formState;if(i!==null){e:{var l=Ie;if(Ye){if(pt){t:{for(var p=pt,w=Rn;p.nodeType!==8;){if(!w){p=null;break t}if(p=Mn(p.nextSibling),p===null){p=null;break t}}w=p.data,p=w==="F!"||w==="F"?p:null}if(p){pt=Mn(p.nextSibling),l=p.data==="F!";break e}}Di(l)}l=!1}l&&(t=i[0])}}return i=Jt(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:t},i.queue=l,i=ld.bind(null,Ie,l),l.dispatch=i,l=uc(!1),w=_c.bind(null,Ie,!1,l.queue),l=Jt(),p={state:t,dispatch:null,action:e,pending:null},l.queue=p,i=qv.bind(null,Ie,p,w,i),p.dispatch=i,l.memoizedState=e,[t,i,!1]}function Ff(e){var t=kt();return qf(t,rt,e)}function qf(e,t,i){if(t=oc(e,t,Uf)[0],e=ha(oi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ys(t)}catch(B){throw B===Vr?ta:B}else l=t;t=kt();var p=t.queue,w=p.dispatch;return i!==t.memoizedState&&(Ie.flags|=2048,Xr(9,{destroy:void 0},Gv.bind(null,p,i),null)),[l,w,e]}function Gv(e,t){e.action=t}function Gf(e){var t=kt(),i=rt;if(i!==null)return qf(t,i,e);kt(),t=t.memoizedState,i=kt();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Xr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=Ie.updateQueue,t===null&&(t=ca(),Ie.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Vf(){return kt().memoizedState}function fa(e,t,i,l){var p=Jt();Ie.flags|=e,p.memoizedState=Xr(1|t,{destroy:void 0},i,l===void 0?null:l)}function da(e,t,i,l){var p=kt();l=l===void 0?null:l;var w=p.memoizedState.inst;rt!==null&&l!==null&&nc(l,rt.memoizedState.deps)?p.memoizedState=Xr(t,w,i,l):(Ie.flags|=e,p.memoizedState=Xr(1|t,w,i,l))}function $f(e,t){fa(8390656,8,e,t)}function fc(e,t){da(2048,8,e,t)}function Vv(e){Ie.flags|=4;var t=Ie.updateQueue;if(t===null)t=ca(),Ie.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Wf(e){var t=kt().memoizedState;return Vv({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Kf(e,t){return da(4,2,e,t)}function Yf(e,t){return da(4,4,e,t)}function Xf(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 Qf(e,t,i){i=i!=null?i.concat([e]):null,da(4,4,Xf.bind(null,t,e),i)}function dc(){}function Zf(e,t){var i=kt();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&nc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Jf(e,t){var i=kt();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&nc(t,l[1]))return l[0];if(l=e(),yr){ct(!0);try{e()}finally{ct(!1)}}return i.memoizedState=[l,t],l}function pc(e,t,i){return i===void 0||(ai&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=ep(),Ie.lanes|=e,Ii|=e,i)}function ed(e,t,i,l){return mn(i,t)?i:Wr.current!==null?(e=pc(e,i,l),mn(e,t)||(Lt=!0),e):(ai&42)===0||(ai&1073741824)!==0&&(We&261930)===0?(Lt=!0,e.memoizedState=i):(e=ep(),Ie.lanes|=e,Ii|=e,t)}function td(e,t,i,l,p){var w=K.p;K.p=w!==0&&8>w?w:8;var B=V.T,P={};V.T=P,_c(e,!1,t,i);try{var Q=p(),ae=V.S;if(ae!==null&&ae(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var pe=Uv(Q,l);Xs(e,t,pe,bn(e))}else Xs(e,t,l,bn(e))}catch(_e){Xs(e,t,{then:function(){},status:"rejected",reason:_e},bn())}finally{K.p=w,B!==null&&P.types!==null&&(B.types=P.types),V.T=B}}function $v(){}function mc(e,t,i,l){if(e.tag!==5)throw Error(o(476));var p=nd(e).queue;td(e,p,t,J,i===null?$v:function(){return id(e),i(l)})}function nd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:J},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=nd(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},bn())}function gc(){return Ut(dl)}function rd(){return kt().memoizedState}function sd(){return kt().memoizedState}function Wv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=bn();e=Oi(i);var l=Bi(t,e,i);l!==null&&(hn(l,t,i),Vs(l,t,i)),t={cache:Vo()},e.payload=t;return}t=t.return}}function Kv(e,t,i){var l=bn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pa(e)?ad(t,i):(i=Bo(e,t,i,l),i!==null&&(hn(i,e,l),od(i,t,l)))}function ld(e,t,i){var l=bn();Xs(e,t,i,l)}function Xs(e,t,i,l){var p={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pa(e))ad(t,p);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var B=t.lastRenderedState,P=w(B,i);if(p.hasEagerState=!0,p.eagerState=P,mn(P,B))return Kl(e,t,p,0),at===null&&Wl(),!1}catch{}finally{}if(i=Bo(e,t,p,l),i!==null)return hn(i,e,l),od(i,t,l),!0}return!1}function _c(e,t,i,l){if(l={lane:2,revertLane:Yc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pa(e)){if(t)throw Error(o(479))}else t=Bo(e,i,l,2),t!==null&&hn(t,e,2)}function pa(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function ad(e,t){Kr=aa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function od(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,ir(e,i)}}var Qs={readContext:Ut,use:ua,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};Qs.useEffectEvent=bt;var cd={readContext:Ut,use:ua,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:$f,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,fa(4194308,4,Xf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return fa(4194308,4,e,t)},useInsertionEffect:function(e,t){fa(4,2,e,t)},useMemo:function(e,t){var i=Jt();t=t===void 0?null:t;var l=e();if(yr){ct(!0);try{e()}finally{ct(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Jt();if(i!==void 0){var p=i(t);if(yr){ct(!0);try{i(t)}finally{ct(!1)}}}else p=t;return l.memoizedState=l.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},l.queue=e,e=e.dispatch=Kv.bind(null,Ie,e),[l.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:function(e){e=uc(e);var t=e.queue,i=ld.bind(null,Ie,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:dc,useDeferredValue:function(e,t){var i=Jt();return pc(i,e,t)},useTransition:function(){var e=uc(!1);return e=td.bind(null,Ie,e.queue,!0,!1),Jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=Ie,p=Jt();if(Ye){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),at===null)throw Error(o(349));(We&127)!==0||Df(l,t,i)}p.memoizedState=i;var w={value:i,getSnapshot:t};return p.queue=w,$f(Lf.bind(null,l,w,e),[e]),l.flags|=2048,Xr(9,{destroy:void 0},Mf.bind(null,l,w,i,t),null),i},useId:function(){var e=Jt(),t=at.identifierPrefix;if(Ye){var i=Kn,l=Wn;i=(l&~(1<<32-qe(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=oa++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Pv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:Pf,useActionState:Pf,useOptimistic:function(e){var t=Jt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=_c.bind(null,Ie,!0,i),i.dispatch=t,[e,t]},useMemoCache:ac,useCacheRefresh:function(){return Jt().memoizedState=Wv.bind(null,Ie)},useEffectEvent:function(e){var t=Jt(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},vc={readContext:Ut,use:ua,useCallback:Zf,useContext:Ut,useEffect:fc,useImperativeHandle:Qf,useInsertionEffect:Kf,useLayoutEffect:Yf,useMemo:Jf,useReducer:ha,useRef:Vf,useState:function(){return ha(oi)},useDebugValue:dc,useDeferredValue:function(e,t){var i=kt();return ed(i,rt.memoizedState,e,t)},useTransition:function(){var e=ha(oi)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:gc,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var i=kt();return jf(i,rt,e,t)},useMemoCache:ac,useCacheRefresh:sd};vc.useEffectEvent=Wf;var ud={readContext:Ut,use:ua,useCallback:Zf,useContext:Ut,useEffect:fc,useImperativeHandle:Qf,useInsertionEffect:Kf,useLayoutEffect:Yf,useMemo:Jf,useReducer:cc,useRef:Vf,useState:function(){return cc(oi)},useDebugValue:dc,useDeferredValue:function(e,t){var i=kt();return rt===null?pc(i,e,t):ed(i,rt.memoizedState,e,t)},useTransition:function(){var e=cc(oi)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:gc,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var i=kt();return rt!==null?jf(i,rt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ac,useCacheRefresh:sd};ud.useEffectEvent=Wf;function yc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Sc={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=bn(),p=Oi(l);p.payload=t,i!=null&&(p.callback=i),t=Bi(e,p,l),t!==null&&(hn(t,e,l),Vs(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=bn(),p=Oi(l);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Bi(e,p,l),t!==null&&(hn(t,e,l),Vs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=bn(),l=Oi(i);l.tag=2,t!=null&&(l.callback=t),t=Bi(e,l,i),t!==null&&(hn(t,e,i),Vs(t,e,i))}};function hd(e,t,i,l,p,w,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,w,B):t.prototype&&t.prototype.isPureReactComponent?!Hs(i,l)||!Hs(p,w):!0}function fd(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Sc.enqueueReplaceState(t,t.state,null)}function Sr(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var p in e)i[p]===void 0&&(i[p]=e[p])}return i}function dd(e){$l(e)}function pd(e){console.error(e)}function md(e){$l(e)}function ma(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gd(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function bc(e,t,i){return i=Oi(i),i.tag=3,i.payload={element:null},i.callback=function(){ma(e,t)},i}function _d(e){return e=Oi(e),e.tag=3,e}function vd(e,t,i,l){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var w=l.value;e.payload=function(){return p(w)},e.callback=function(){gd(t,i,l)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){gd(t,i,l),typeof p!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function Yv(e,t,i,l,p){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&Fr(t,i,p,!0),i=_n.current,i!==null){switch(i.tag){case 31:case 13:return Dn===null?Aa():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=p,l===na?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),$c(e,l,p)),!1;case 22:return i.flags|=65536,l===na?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),$c(e,l,p)),!1}throw Error(o(435,i.tag))}return $c(e,l,p),Aa(),!1}if(Ye)return t=_n.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=p,l!==Uo&&(e=Error(o(422),{cause:l}),Us(kn(e,i)))):(l!==Uo&&(t=Error(o(423),{cause:l}),Us(kn(t,i))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,l=kn(l,i),p=bc(e.stateNode,l,p),Qo(e,p),Ct!==4&&(Ct=2)),!1;var w=Error(o(520),{cause:l});if(w=kn(w,i),sl===null?sl=[w]:sl.push(w),Ct!==4&&(Ct=2),t===null)return!0;l=kn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=p&-p,i.lanes|=e,e=bc(i.stateNode,l,e),Qo(i,e),!1;case 1:if(t=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ui===null||!Ui.has(w))))return i.flags|=65536,p&=-p,i.lanes|=p,p=_d(p),vd(p,e,i,l),Qo(i,p),!1}i=i.return}while(i!==null);return!1}var Cc=Error(o(461)),Lt=!1;function Pt(e,t,i,l){t.child=e===null?Cf(t,null,i,l):vr(t,e.child,i,l)}function yd(e,t,i,l,p){i=i.render;var w=t.ref;if("ref"in l){var B={};for(var P in l)P!=="ref"&&(B[P]=l[P])}else B=l;return pr(t),l=ic(e,t,i,B,w,p),P=rc(),e!==null&&!Lt?(sc(e,t,p),ci(e,t,p)):(Ye&&P&&zo(t),t.flags|=1,Pt(e,t,l,p),t.child)}function Sd(e,t,i,l,p){if(e===null){var w=i.type;return typeof w=="function"&&!jo(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,bd(e,t,w,l,p)):(e=Xl(i.type,null,l,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Dc(e,p)){var B=w.memoizedProps;if(i=i.compare,i=i!==null?i:Hs,i(B,l)&&e.ref===t.ref)return ci(e,t,p)}return t.flags|=1,e=ii(w,l),e.ref=t.ref,e.return=t,t.child=e}function bd(e,t,i,l,p){if(e!==null){var w=e.memoizedProps;if(Hs(w,l)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=l=w,Dc(e,p))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,ci(e,t,p)}return wc(e,t,i,l,p)}function Cd(e,t,i,l){var p=l.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(l=t.child=e.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~w}else l=0,t.child=null;return wd(e,t,w,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ea(t,w!==null?w.cachePool:null),w!==null?Ef(t,w):Jo(),kf(t);else return l=t.lanes=536870912,wd(e,t,w!==null?w.baseLanes|i:i,i,l)}else w!==null?(ea(t,w.cachePool),Ef(t,w),Ni(),t.memoizedState=null):(e!==null&&ea(t,null),Jo(),Ni());return Pt(e,t,p,i),t.child}function Zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wd(e,t,i,l,p){var w=Wo();return w=w===null?null:{parent:Dt._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&ea(t,null),Jo(),kf(t),e!==null&&Fr(e,t,l,!0),t.childLanes=p,null}function ga(e,t){return t=va({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 vr(t,e.child,null,i),e=ga(t,t.pendingProps),e.flags|=2,vn(t),t.memoizedState=null,e}function Xv(e,t,i){var l=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(l.mode==="hidden")return e=ga(t,l),t.lanes=536870912,Zs(null,e);if(tc(t),(e=pt)?(e=Np(e,Rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:Wn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},i=af(e),i.return=t,t.child=i,It=t,pt=null)):e=null,e===null)throw Di(t);return t.lanes=536870912,null}return ga(t,l)}var w=e.memoizedState;if(w!==null){var B=w.dehydrated;if(tc(t),p)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(o(558));else if(Lt||Fr(e,t,i,!1),p=(i&e.childLanes)!==0,Lt||p){if(l=at,l!==null&&(B=ys(l,i),B!==0&&B!==w.retryLane))throw w.retryLane=B,ur(e,B),hn(l,e,B),Cc;Aa(),t=xd(e,t,i)}else e=w.treeContext,pt=Mn(B.nextSibling),It=t,Ye=!0,Ri=null,Rn=!1,e!==null&&uf(t,e),t=ga(t,l),t.flags|=4096;return t}return e=ii(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _a(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function wc(e,t,i,l,p){return pr(t),i=ic(e,t,i,l,void 0,p),l=rc(),e!==null&&!Lt?(sc(e,t,p),ci(e,t,p)):(Ye&&l&&zo(t),t.flags|=1,Pt(e,t,i,p),t.child)}function Ed(e,t,i,l,p,w){return pr(t),t.updateQueue=null,i=Tf(t,l,i,p),Af(e),l=rc(),e!==null&&!Lt?(sc(e,t,w),ci(e,t,w)):(Ye&&l&&zo(t),t.flags|=1,Pt(e,t,i,w),t.child)}function kd(e,t,i,l,p){if(pr(t),t.stateNode===null){var w=zr,B=i.contextType;typeof B=="object"&&B!==null&&(w=Ut(B)),w=new i(l,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Sc,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=l,w.state=t.memoizedState,w.refs={},Yo(t),B=i.contextType,w.context=typeof B=="object"&&B!==null?Ut(B):zr,w.state=t.memoizedState,B=i.getDerivedStateFromProps,typeof B=="function"&&(yc(t,i,B,l),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(B=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),B!==w.state&&Sc.enqueueReplaceState(w,w.state,null),Ws(t,l,w,p),$s(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){w=t.stateNode;var P=t.memoizedProps,Q=Sr(i,P);w.props=Q;var ae=w.context,pe=i.contextType;B=zr,typeof pe=="object"&&pe!==null&&(B=Ut(pe));var _e=i.getDerivedStateFromProps;pe=typeof _e=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,pe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||ae!==B)&&fd(t,w,l,B),Li=!1;var oe=t.memoizedState;w.state=oe,Ws(t,l,w,p),$s(),ae=t.memoizedState,P||oe!==ae||Li?(typeof _e=="function"&&(yc(t,i,_e,l),ae=t.memoizedState),(Q=Li||hd(t,i,Q,l,oe,ae,B))?(pe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=ae),w.props=l,w.state=ae,w.context=B,l=Q):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{w=t.stateNode,Xo(e,t),B=t.memoizedProps,pe=Sr(i,B),w.props=pe,_e=t.pendingProps,oe=w.context,ae=i.contextType,Q=zr,typeof ae=="object"&&ae!==null&&(Q=Ut(ae)),P=i.getDerivedStateFromProps,(ae=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(B!==_e||oe!==Q)&&fd(t,w,l,Q),Li=!1,oe=t.memoizedState,w.state=oe,Ws(t,l,w,p),$s();var he=t.memoizedState;B!==_e||oe!==he||Li||e!==null&&e.dependencies!==null&&Zl(e.dependencies)?(typeof P=="function"&&(yc(t,i,P,l),he=t.memoizedState),(pe=Li||hd(t,i,pe,l,oe,he,Q)||e!==null&&e.dependencies!==null&&Zl(e.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,he,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,he,Q)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=he),w.props=l,w.state=he,w.context=Q,l=pe):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),l=!1)}return w=l,_a(e,t),l=(t.flags&128)!==0,w||l?(w=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&l?(t.child=vr(t,e.child,null,p),t.child=vr(t,null,i,p)):Pt(e,t,i,p),t.memoizedState=w.state,e=t.child):e=ci(e,t,p),e}function Ad(e,t,i,l){return fr(),t.flags|=256,Pt(e,t,i,l),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:gf()}}function kc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Sn),e}function Td(e,t,i){var l=t.pendingProps,p=!1,w=(t.flags&128)!==0,B;if((B=w)||(B=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),B&&(p=!0,t.flags&=-129),B=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(p?ji(t):Ni(),(e=pt)?(e=Np(e,Rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:Wn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},i=af(e),i.return=t,t.child=i,It=t,pt=null)):e=null,e===null)throw Di(t);return ou(e)?t.lanes=32:t.lanes=536870912,null}var P=l.children;return l=l.fallback,p?(Ni(),p=t.mode,P=va({mode:"hidden",children:P},p),l=hr(l,p,i,null),P.return=t,l.return=t,P.sibling=l,t.child=P,l=t.child,l.memoizedState=Ec(i),l.childLanes=kc(e,B,i),t.memoizedState=xc,Zs(null,l)):(ji(t),Ac(t,P))}var Q=e.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(w)t.flags&256?(ji(t),t.flags&=-257,t=Tc(e,t,i)):t.memoizedState!==null?(Ni(),t.child=e.child,t.flags|=128,t=null):(Ni(),P=l.fallback,p=t.mode,l=va({mode:"visible",children:l.children},p),P=hr(P,p,i,null),P.flags|=2,l.return=t,P.return=t,l.sibling=P,t.child=l,vr(t,e.child,null,i),l=t.child,l.memoizedState=Ec(i),l.childLanes=kc(e,B,i),t.memoizedState=xc,t=Zs(null,l));else if(ji(t),ou(P)){if(B=P.nextSibling&&P.nextSibling.dataset,B)var ae=B.dgst;B=ae,l=Error(o(419)),l.stack="",l.digest=B,Us({value:l,source:null,stack:null}),t=Tc(e,t,i)}else if(Lt||Fr(e,t,i,!1),B=(i&e.childLanes)!==0,Lt||B){if(B=at,B!==null&&(l=ys(B,i),l!==0&&l!==Q.retryLane))throw Q.retryLane=l,ur(e,l),hn(B,e,l),Cc;au(P)||Aa(),t=Tc(e,t,i)}else au(P)?(t.flags|=192,t.child=e.child,t=null):(e=Q.treeContext,pt=Mn(P.nextSibling),It=t,Ye=!0,Ri=null,Rn=!1,e!==null&&uf(t,e),t=Ac(t,l.children),t.flags|=4096);return t}return p?(Ni(),P=l.fallback,p=t.mode,Q=e.child,ae=Q.sibling,l=ii(Q,{mode:"hidden",children:l.children}),l.subtreeFlags=Q.subtreeFlags&65011712,ae!==null?P=ii(ae,P):(P=hr(P,p,i,null),P.flags|=2),P.return=t,l.return=t,l.sibling=P,t.child=l,Zs(null,l),l=t.child,P=e.child.memoizedState,P===null?P=Ec(i):(p=P.cachePool,p!==null?(Q=Dt._currentValue,p=p.parent!==Q?{parent:Q,pool:Q}:p):p=gf(),P={baseLanes:P.baseLanes|i,cachePool:p}),l.memoizedState=P,l.childLanes=kc(e,B,i),t.memoizedState=xc,Zs(e.child,l)):(ji(t),i=e.child,e=i.sibling,i=ii(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(B=t.deletions,B===null?(t.deletions=[e],t.flags|=16):B.push(e)),t.child=i,t.memoizedState=null,i)}function Ac(e,t){return t=va({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function va(e,t){return e=gn(22,e,null,t),e.lanes=0,e}function Tc(e,t,i){return vr(t,e.child,null,i),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rd(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),qo(e.return,t,i)}function Rc(e,t,i,l,p,w){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:p,treeForkCount:w}:(B.isBackwards=t,B.rendering=null,B.renderingStartTime=0,B.last=l,B.tail=i,B.tailMode=p,B.treeForkCount=w)}function Dd(e,t,i){var l=t.pendingProps,p=l.revealOrder,w=l.tail;l=l.children;var B=Et.current,P=(B&2)!==0;if(P?(B=B&1|2,t.flags|=128):B&=1,N(Et,B),Pt(e,t,l,i),l=Ye?Is:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,i,t);else if(e.tag===19)Rd(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(p){case"forwards":for(i=t.child,p=null;i!==null;)e=i.alternate,e!==null&&la(e)===null&&(p=i),i=i.sibling;i=p,i===null?(p=t.child,t.child=null):(p=i.sibling,i.sibling=null),Rc(t,!1,p,i,w,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&la(e)===null){t.child=p;break}e=p.sibling,p.sibling=i,i=p,p=e}Rc(t,!0,i,null,w,l);break;case"together":Rc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ci(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ii|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Fr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=ii(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ii(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zl(e)))}function Qv(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Mi(t,Dt,e.memoizedState.cache),fr();break;case 27:case 5:ce(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Mi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ji(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Td(e,t,i):(ji(t),e=ci(e,t,i),e!==null?e.sibling:null);ji(t);break;case 19:var p=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(Fr(e,t,i,!1),l=(i&t.childLanes)!==0),p){if(l)return Dd(e,t,i);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),N(Et,Et.current),l)break;return null;case 22:return t.lanes=0,Cd(e,t,i,t.pendingProps);case 24:Mi(t,Dt,e.memoizedState.cache)}return ci(e,t,i)}function Md(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!Dc(e,i)&&(t.flags&128)===0)return Lt=!1,Qv(e,t,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ye&&(t.flags&1048576)!==0&&cf(t,Is,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=gr(t.elementType),t.type=e,typeof e=="function")jo(e)?(l=Sr(e,l),t.tag=1,t=kd(null,t,e,l,i)):(t.tag=0,t=wc(null,t,e,l,i));else{if(e!=null){var p=e.$$typeof;if(p===k){t.tag=11,t=yd(null,t,e,l,i);break e}else if(p===D){t.tag=14,t=Sd(null,t,e,l,i);break e}}throw t=W(e)||e,Error(o(306,t,""))}}return t;case 0:return wc(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,p=Sr(l,t.pendingProps),kd(e,t,l,p,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var w=t.memoizedState;p=w.element,Xo(e,t),Ws(t,l,null,i);var B=t.memoizedState;if(l=B.cache,Mi(t,Dt,l),l!==w.cache&&Go(t,[Dt],i,!0),$s(),l=B.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:B.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Ad(e,t,l,i);break e}else if(l!==p){p=kn(Error(o(424)),t),Us(p),t=Ad(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(pt=Mn(e.firstChild),It=t,Ye=!0,Ri=null,Rn=!0,i=Cf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(fr(),l===p){t=ci(e,t,i);break e}Pt(e,t,l,i)}t=t.child}return t;case 26:return _a(e,t),e===null?(i=Fp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,l=Ba(ve.current).createElement(i),l[yt]=t,l[jt]=e,Ft(l,i,e),tt(l),t.stateNode=l):t.memoizedState=Fp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Ye&&(l=t.stateNode=Ip(t.type,t.pendingProps,ve.current),It=t,Rn=!0,p=pt,Gi(t.type)?(cu=p,pt=Mn(l.firstChild)):pt=p),Pt(e,t,t.pendingProps.children,i),_a(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((p=l=pt)&&(l=A0(l,t.type,t.pendingProps,Rn),l!==null?(t.stateNode=l,It=t,pt=Mn(l.firstChild),Rn=!1,p=!0):p=!1),p||Di(t)),ce(t),p=t.type,w=t.pendingProps,B=e!==null?e.memoizedProps:null,l=w.children,ru(p,w)?l=null:B!==null&&ru(p,B)&&(t.flags|=32),t.memoizedState!==null&&(p=ic(e,t,Fv,null,null,i),dl._currentValue=p),_a(e,t),Pt(e,t,l,i),t.child;case 6:return e===null&&Ye&&((e=i=pt)&&(i=T0(i,t.pendingProps,Rn),i!==null?(t.stateNode=i,It=t,pt=null,e=!0):e=!1),e||Di(t)),null;case 13:return Td(e,t,i);case 4:return q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=vr(t,null,l,i):Pt(e,t,l,i),t.child;case 11:return yd(e,t,t.type,t.pendingProps,i);case 7:return Pt(e,t,t.pendingProps,i),t.child;case 8:return Pt(e,t,t.pendingProps.children,i),t.child;case 12:return Pt(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,Mi(t,t.type,l.value),Pt(e,t,l.children,i),t.child;case 9:return p=t.type._context,l=t.pendingProps.children,pr(t),p=Ut(p),l=l(p),t.flags|=1,Pt(e,t,l,i),t.child;case 14:return Sd(e,t,t.type,t.pendingProps,i);case 15:return bd(e,t,t.type,t.pendingProps,i);case 19:return Dd(e,t,i);case 31:return Xv(e,t,i);case 22:return Cd(e,t,i,t.pendingProps);case 24:return pr(t),l=Ut(Dt),e===null?(p=Wo(),p===null&&(p=at,w=Vo(),p.pooledCache=w,w.refCount++,w!==null&&(p.pooledCacheLanes|=i),p=w),t.memoizedState={parent:l,cache:p},Yo(t),Mi(t,Dt,p)):((e.lanes&i)!==0&&(Xo(e,t),Ws(t,null,null,i),$s()),p=e.memoizedState,w=t.memoizedState,p.parent!==l?(p={parent:l,cache:l},t.memoizedState=p,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=p),Mi(t,Dt,l)):(l=w.cache,Mi(t,Dt,l),l!==p.cache&&Go(t,[Dt],i,!0))),Pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ui(e){e.flags|=4}function Mc(e,t,i,l,p){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(rp())e.flags|=8192;else throw _r=na,Ko}else e.flags&=-16777217}function Ld(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wp(t))if(rp())e.flags|=8192;else throw _r=na,Ko}function ya(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ol():536870912,e.lanes|=t,es|=t)}function Js(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Zv(e,t,i){var l=t.pendingProps;switch(Io(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),li(Dt),fe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Pr(t)?ui(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Po())),mt(t),null;case 26:var p=t.type,w=t.memoizedState;return e===null?(ui(t),w!==null?(mt(t),Ld(t,w)):(mt(t),Mc(t,p,null,l,i))):w?w!==e.memoizedState?(ui(t),mt(t),Ld(t,w)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ui(t),mt(t),Mc(t,p,e,l,i)),null;case 27:if(de(t),i=ve.current,p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return mt(t),null}e=Z.current,Pr(t)?hf(t):(e=Ip(p,l,i),t.stateNode=e,ui(t))}return mt(t),null;case 5:if(de(t),p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return mt(t),null}if(w=Z.current,Pr(t))hf(t);else{var B=Ba(ve.current);switch(w){case 1:w=B.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:w=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":w=B.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":w=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":w=B.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?B.createElement("select",{is:l.is}):B.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?B.createElement(p,{is:l.is}):B.createElement(p)}}w[yt]=t,w[jt]=l;e:for(B=t.child;B!==null;){if(B.tag===5||B.tag===6)w.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===t)break e;for(;B.sibling===null;){if(B.return===null||B.return===t)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}t.stateNode=w;e:switch(Ft(w,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ui(t)}}return mt(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ui(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ve.current,Pr(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,p=It,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}e[yt]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Tp(e.nodeValue,i)),e||Di(t,!0)}else e=Ba(e).createTextNode(l),e[yt]=t,t.stateNode=e}return mt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Pr(t),i!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[yt]=t}else fr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else i=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(vn(t),t):(vn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=Pr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[yt]=t}else fr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),p=!1}else p=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(vn(t),t):(vn(t),null)}return vn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==p&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ya(t,t.updateQueue),mt(t),null);case 4:return fe(),e===null&&Jc(t.stateNode.containerInfo),mt(t),null;case 10:return li(t.type),mt(t),null;case 19:if(G(Et),l=t.memoizedState,l===null)return mt(t),null;if(p=(t.flags&128)!==0,w=l.rendering,w===null)if(p)Js(l,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=la(e),w!==null){for(t.flags|=128,Js(l,!1),e=w.updateQueue,t.updateQueue=e,ya(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)lf(i,e),i=i.sibling;return N(Et,Et.current&1|2),Ye&&ri(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ft()>xa&&(t.flags|=128,p=!0,Js(l,!1),t.lanes=4194304)}else{if(!p)if(e=la(w),e!==null){if(t.flags|=128,p=!0,e=e.updateQueue,t.updateQueue=e,ya(t,e),Js(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!Ye)return mt(t),null}else 2*ft()-l.renderingStartTime>xa&&i!==536870912&&(t.flags|=128,p=!0,Js(l,!1),t.lanes=4194304);l.isBackwards?(w.sibling=t.child,t.child=w):(e=l.last,e!==null?e.sibling=w:t.child=w,l.last=w)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ft(),e.sibling=null,i=Et.current,N(Et,p?i&1|2:i&1),Ye&&ri(t,l.treeForkCount),e):(mt(t),null);case 22:case 23:return vn(t),ec(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),i=t.updateQueue,i!==null&&ya(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&G(mr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),li(Dt),mt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Jv(e,t){switch(Io(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return li(Dt),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(vn(t),t.alternate===null)throw Error(o(340));fr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));fr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Et),null;case 4:return fe(),null;case 10:return li(t.type),null;case 22:case 23:return vn(t),ec(),e!==null&&G(mr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return li(Dt),null;case 25:return null;default:return null}}function Od(e,t){switch(Io(t),t.tag){case 3:li(Dt),fe();break;case 26:case 27:case 5:de(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&vn(t);break;case 13:vn(t);break;case 19:G(Et);break;case 10:li(t.type);break;case 22:case 23:vn(t),ec(),e!==null&&G(mr);break;case 24:li(Dt)}}function el(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var p=l.next;i=p;do{if((i.tag&e)===e){l=void 0;var w=i.create,B=i.inst;l=w(),B.destroy=l}i=i.next}while(i!==p)}}catch(P){it(t,t.return,P)}}function Hi(e,t,i){try{var l=t.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var w=p.next;l=w;do{if((l.tag&e)===e){var B=l.inst,P=B.destroy;if(P!==void 0){B.destroy=void 0,p=t;var Q=i,ae=P;try{ae()}catch(pe){it(p,Q,pe)}}}l=l.next}while(l!==w)}}catch(pe){it(t,t.return,pe)}}function Bd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{xf(t,i)}catch(l){it(e,e.return,l)}}}function jd(e,t,i){i.props=Sr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){it(e,t,l)}}function tl(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(p){it(e,t,p)}}function Yn(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(p){it(e,t,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){it(e,t,p)}else i.current=null}function Nd(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(p){it(e,e.return,p)}}function Lc(e,t,i){try{var l=e.stateNode;b0(l,e.type,i,t),l[jt]=t}catch(p){it(e,e.return,p)}}function Hd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gi(e.type)||e.tag===4}function Oc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hd(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&&Gi(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 Bc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Zt));else if(l!==4&&(l===27&&Gi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Bc(e,t,i),e=e.sibling;e!==null;)Bc(e,t,i),e=e.sibling}function Sa(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&Gi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Sa(e,t,i),e=e.sibling;e!==null;)Sa(e,t,i),e=e.sibling}function zd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);Ft(t,l,i),t[yt]=e,t[jt]=i}catch(w){it(e,e.return,w)}}var hi=!1,Ot=!1,jc=!1,Id=typeof WeakSet=="function"?WeakSet:Set,zt=null;function e0(e,t){if(e=e.containerInfo,nu=Pa,e=Xh(e),To(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var p=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var B=0,P=-1,Q=-1,ae=0,pe=0,_e=e,oe=null;t:for(;;){for(var he;_e!==i||p!==0&&_e.nodeType!==3||(P=B+p),_e!==w||l!==0&&_e.nodeType!==3||(Q=B+l),_e.nodeType===3&&(B+=_e.nodeValue.length),(he=_e.firstChild)!==null;)oe=_e,_e=he;for(;;){if(_e===e)break t;if(oe===i&&++ae===p&&(P=B),oe===w&&++pe===l&&(Q=B),(he=_e.nextSibling)!==null)break;_e=oe,oe=_e.parentNode}_e=he}i=P===-1||Q===-1?null:{start:P,end:Q}}else i=null}i=i||{start:0,end:0}}else i=null;for(iu={focusedElem:e,selectionRange:i},Pa=!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,w=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)p=e[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,p=w.memoizedProps,w=w.memoizedState,l=i.stateNode;try{var Te=Sr(i.type,p);e=l.getSnapshotBeforeUpdate(Te,w),l.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){it(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)lu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":lu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function Ud(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:di(e,i),l&4&&el(5,i);break;case 1:if(di(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(B){it(i,i.return,B)}else{var p=Sr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(B){it(i,i.return,B)}}l&64&&Bd(i),l&512&&tl(i,i.return);break;case 3:if(di(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{xf(e,t)}catch(B){it(i,i.return,B)}}break;case 27:t===null&&l&4&&zd(i);case 26:case 5:di(e,i),t===null&&l&4&&Nd(i),l&512&&tl(i,i.return);break;case 12:di(e,i);break;case 31:di(e,i),l&4&&qd(e,i);break;case 13:di(e,i),l&4&&Gd(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=c0.bind(null,i),R0(e,i))));break;case 22:if(l=i.memoizedState!==null||hi,!l){t=t!==null&&t.memoizedState!==null||Ot,p=hi;var w=Ot;hi=l,(Ot=t)&&!w?pi(e,i,(i.subtreeFlags&8772)!==0):di(e,i),hi=p,Ot=w}break;case 30:break;default:di(e,i)}}function Pd(e){var t=e.alternate;t!==null&&(e.alternate=null,Pd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rr(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,an=!1;function fi(e,t,i){for(i=i.child;i!==null;)Fd(e,t,i),i=i.sibling}function Fd(e,t,i){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(Je,i)}catch{}switch(i.tag){case 26:Ot||Yn(i,t),fi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ot||Yn(i,t);var l=vt,p=an;Gi(i.type)&&(vt=i.stateNode,an=!1),fi(e,t,i),ul(i.stateNode),vt=l,an=p;break;case 5:Ot||Yn(i,t);case 6:if(l=vt,p=an,vt=null,fi(e,t,i),vt=l,an=p,vt!==null)if(an)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(w){it(i,t,w)}else try{vt.removeChild(i.stateNode)}catch(w){it(i,t,w)}break;case 18:vt!==null&&(an?(e=vt,Bp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),os(e)):Bp(vt,i.stateNode));break;case 4:l=vt,p=an,vt=i.stateNode.containerInfo,an=!0,fi(e,t,i),vt=l,an=p;break;case 0:case 11:case 14:case 15:Hi(2,i,t),Ot||Hi(4,i,t),fi(e,t,i);break;case 1:Ot||(Yn(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&jd(i,t,l)),fi(e,t,i);break;case 21:fi(e,t,i);break;case 22:Ot=(l=Ot)||i.memoizedState!==null,fi(e,t,i),Ot=l;break;default:fi(e,t,i)}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{os(e)}catch(i){it(t,t.return,i)}}}function Gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{os(e)}catch(i){it(t,t.return,i)}}function t0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Id),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Id),t;default:throw Error(o(435,e.tag))}}function ba(e,t){var i=t0(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var p=u0.bind(null,e,l);l.then(p,p)}})}function on(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var p=i[l],w=e,B=t,P=B;e:for(;P!==null;){switch(P.tag){case 27:if(Gi(P.type)){vt=P.stateNode,an=!1;break e}break;case 5:vt=P.stateNode,an=!1;break e;case 3:case 4:vt=P.stateNode.containerInfo,an=!0;break e}P=P.return}if(vt===null)throw Error(o(160));Fd(w,B,p),vt=null,an=!1,w=p.alternate,w!==null&&(w.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vd(t,e),t=t.sibling}var In=null;function Vd(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:on(t,e),cn(e),l&4&&(Hi(3,e,e.return),el(3,e),Hi(5,e,e.return));break;case 1:on(t,e),cn(e),l&512&&(Ot||i===null||Yn(i,i.return)),l&64&&hi&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var p=In;if(on(t,e),cn(e),l&512&&(Ot||i===null||Yn(i,i.return)),l&4){var w=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,p=p.ownerDocument||p;t:switch(l){case"title":w=p.getElementsByTagName("title")[0],(!w||w[pn]||w[yt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=p.createElement(l),p.head.insertBefore(w,p.querySelector("head > title"))),Ft(w,l,i),w[yt]=e,tt(w),l=w;break e;case"link":var B=Vp("link","href",p).get(l+(i.href||""));if(B){for(var P=0;P<B.length;P++)if(w=B[P],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){B.splice(P,1);break t}}w=p.createElement(l),Ft(w,l,i),p.head.appendChild(w);break;case"meta":if(B=Vp("meta","content",p).get(l+(i.content||""))){for(P=0;P<B.length;P++)if(w=B[P],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){B.splice(P,1);break t}}w=p.createElement(l),Ft(w,l,i),p.head.appendChild(w);break;default:throw Error(o(468,l))}w[yt]=e,tt(w),l=w}e.stateNode=l}else $p(p,e.type,e.stateNode);else e.stateNode=Gp(p,l,e.memoizedProps);else w!==l?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,l===null?$p(p,e.type,e.stateNode):Gp(p,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Lc(e,e.memoizedProps,i.memoizedProps)}break;case 27:on(t,e),cn(e),l&512&&(Ot||i===null||Yn(i,i.return)),i!==null&&l&4&&Lc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(on(t,e),cn(e),l&512&&(Ot||i===null||Yn(i,i.return)),e.flags&32){p=e.stateNode;try{ki(p,"")}catch(Te){it(e,e.return,Te)}}l&4&&e.stateNode!=null&&(p=e.memoizedProps,Lc(e,p,i!==null?i.memoizedProps:p)),l&1024&&(jc=!0);break;case 6:if(on(t,e),cn(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Te){it(e,e.return,Te)}}break;case 3:if(Ha=null,p=In,In=ja(t.containerInfo),on(t,e),In=p,cn(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{os(t.containerInfo)}catch(Te){it(e,e.return,Te)}jc&&(jc=!1,$d(e));break;case 4:l=In,In=ja(e.stateNode.containerInfo),on(t,e),cn(e),In=l;break;case 12:on(t,e),cn(e);break;case 31:on(t,e),cn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 13:on(t,e),cn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(wa=ft()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 22:p=e.memoizedState!==null;var Q=i!==null&&i.memoizedState!==null,ae=hi,pe=Ot;if(hi=ae||p,Ot=pe||Q,on(t,e),Ot=pe,hi=ae,cn(e),l&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(i===null||Q||hi||Ot||br(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Q=i=t;try{if(w=Q.stateNode,p)B=w.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{P=Q.stateNode;var _e=Q.memoizedProps.style,oe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Te){it(Q,Q.return,Te)}}}else if(t.tag===6){if(i===null){Q=t;try{Q.stateNode.nodeValue=p?"":Q.memoizedProps}catch(Te){it(Q,Q.return,Te)}}}else if(t.tag===18){if(i===null){Q=t;try{var he=Q.stateNode;p?jp(he,!0):jp(Q.stateNode,!1)}catch(Te){it(Q,Q.return,Te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,ba(e,i))));break;case 19:on(t,e),cn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,ba(e,l)));break;case 30:break;case 21:break;default:on(t,e),cn(e)}}function cn(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Hd(l)){i=l;break}l=l.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var p=i.stateNode,w=Oc(e);Sa(e,w,p);break;case 5:var B=i.stateNode;i.flags&32&&(ki(B,""),i.flags&=-33);var P=Oc(e);Sa(e,P,B);break;case 3:case 4:var Q=i.stateNode.containerInfo,ae=Oc(e);Bc(e,ae,Q);break;default:throw Error(o(161))}}catch(pe){it(e,e.return,pe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $d(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;$d(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function di(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ud(e,t.alternate,t),t=t.sibling}function br(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hi(4,t,t.return),br(t);break;case 1:Yn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&jd(t,t.return,i),br(t);break;case 27:ul(t.stateNode);case 26:case 5:Yn(t,t.return),br(t);break;case 22:t.memoizedState===null&&br(t);break;case 30:br(t);break;default:br(t)}e=e.sibling}}function pi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,p=e,w=t,B=w.flags;switch(w.tag){case 0:case 11:case 15:pi(p,w,i),el(4,w);break;case 1:if(pi(p,w,i),l=w,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ae){it(l,l.return,ae)}if(l=w,p=l.updateQueue,p!==null){var P=l.stateNode;try{var Q=p.shared.hiddenCallbacks;if(Q!==null)for(p.shared.hiddenCallbacks=null,p=0;p<Q.length;p++)wf(Q[p],P)}catch(ae){it(l,l.return,ae)}}i&&B&64&&Bd(w),tl(w,w.return);break;case 27:zd(w);case 26:case 5:pi(p,w,i),i&&l===null&&B&4&&Nd(w),tl(w,w.return);break;case 12:pi(p,w,i);break;case 31:pi(p,w,i),i&&B&4&&qd(p,w);break;case 13:pi(p,w,i),i&&B&4&&Gd(p,w);break;case 22:w.memoizedState===null&&pi(p,w,i),tl(w,w.return);break;case 30:break;default:pi(p,w,i)}t=t.sibling}}function Nc(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&&Ps(i))}function Hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e))}function Un(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wd(e,t,i,l),t=t.sibling}function Wd(e,t,i,l){var p=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,i,l),p&2048&&el(9,t);break;case 1:Un(e,t,i,l);break;case 3:Un(e,t,i,l),p&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e)));break;case 12:if(p&2048){Un(e,t,i,l),e=t.stateNode;try{var w=t.memoizedProps,B=w.id,P=w.onPostCommit;typeof P=="function"&&P(B,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Q){it(t,t.return,Q)}}else Un(e,t,i,l);break;case 31:Un(e,t,i,l);break;case 13:Un(e,t,i,l);break;case 23:break;case 22:w=t.stateNode,B=t.alternate,t.memoizedState!==null?w._visibility&2?Un(e,t,i,l):nl(e,t):w._visibility&2?Un(e,t,i,l):(w._visibility|=2,Qr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1)),p&2048&&Nc(B,t);break;case 24:Un(e,t,i,l),p&2048&&Hc(t.alternate,t);break;default:Un(e,t,i,l)}}function Qr(e,t,i,l,p){for(p=p&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,B=t,P=i,Q=l,ae=B.flags;switch(B.tag){case 0:case 11:case 15:Qr(w,B,P,Q,p),el(8,B);break;case 23:break;case 22:var pe=B.stateNode;B.memoizedState!==null?pe._visibility&2?Qr(w,B,P,Q,p):nl(w,B):(pe._visibility|=2,Qr(w,B,P,Q,p)),p&&ae&2048&&Nc(B.alternate,B);break;case 24:Qr(w,B,P,Q,p),p&&ae&2048&&Hc(B.alternate,B);break;default:Qr(w,B,P,Q,p)}t=t.sibling}}function nl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,p=l.flags;switch(l.tag){case 22:nl(i,l),p&2048&&Nc(l.alternate,l);break;case 24:nl(i,l),p&2048&&Hc(l.alternate,l);break;default:nl(i,l)}t=t.sibling}}var il=8192;function Zr(e,t,i){if(e.subtreeFlags&il)for(e=e.child;e!==null;)Kd(e,t,i),e=e.sibling}function Kd(e,t,i){switch(e.tag){case 26:Zr(e,t,i),e.flags&il&&e.memoizedState!==null&&P0(i,In,e.memoizedState,e.memoizedProps);break;case 5:Zr(e,t,i);break;case 3:case 4:var l=In;In=ja(e.stateNode.containerInfo),Zr(e,t,i),In=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=il,il=16777216,Zr(e,t,i),il=l):Zr(e,t,i));break;default:Zr(e,t,i)}}function Yd(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 rl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];zt=l,Qd(l,e)}Yd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xd(e),e=e.sibling}function Xd(e){switch(e.tag){case 0:case 11:case 15:rl(e),e.flags&2048&&Hi(9,e,e.return);break;case 3:rl(e);break;case 12:rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ca(e)):rl(e);break;default:rl(e)}}function Ca(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];zt=l,Qd(l,e)}Yd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hi(8,t,t.return),Ca(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ca(t));break;default:Ca(t)}e=e.sibling}}function Qd(e,t){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:Hi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ps(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,zt=l;else e:for(i=e;zt!==null;){l=zt;var p=l.sibling,w=l.return;if(Pd(l),l===i){zt=null;break e}if(p!==null){p.return=w,zt=p;break e}zt=w}}}var n0={getCacheForType:function(e){var t=Ut(Dt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ut(Dt).controller.signal}},i0=typeof WeakMap=="function"?WeakMap:Map,et=0,at=null,Ge=null,We=0,nt=0,yn=null,zi=!1,Jr=!1,zc=!1,mi=0,Ct=0,Ii=0,Cr=0,Ic=0,Sn=0,es=0,sl=null,un=null,Uc=!1,wa=0,Zd=0,xa=1/0,Ea=null,Ui=null,Nt=0,Pi=null,ts=null,gi=0,Pc=0,Fc=null,Jd=null,ll=0,qc=null;function bn(){return(et&2)!==0&&We!==0?We&-We:V.T!==null?Yc():Ss()}function ep(){if(Sn===0)if((We&536870912)===0||Ye){var e=ze;ze<<=1,(ze&3932160)===0&&(ze=262144),Sn=e}else Sn=536870912;return e=_n.current,e!==null&&(e.flags|=32),Sn}function hn(e,t,i){(e===at&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(ns(e,0),Fi(e,We,Sn,!1)),qn(e,i),((et&2)===0||e!==at)&&(e===at&&((et&2)===0&&(Cr|=i),Ct===4&&Fi(e,We,Sn,!1)),Xn(e))}function tp(e,t,i){if((et&6)!==0)throw Error(o(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||nr(e,t),p=l?l0(e,t):Vc(e,t,!0),w=l;do{if(p===0){Jr&&!l&&Fi(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!r0(i)){p=Vc(e,t,!1),w=!1;continue}if(p===2){if(w=t,e.errorRecoveryDisabledLanes&w)var B=0;else B=e.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){t=B;e:{var P=e;p=sl;var Q=P.current.memoizedState.isDehydrated;if(Q&&(ns(P,B).flags|=256),B=Vc(P,B,!1),B!==2){if(zc&&!Q){P.errorRecoveryDisabledLanes|=w,Cr|=w,p=4;break e}w=un,un=p,w!==null&&(un===null?un=w:un.push.apply(un,w))}p=B}if(w=!1,p!==2)continue}}if(p===1){ns(e,0),Fi(e,t,0,!0);break}e:{switch(l=e,w=p,w){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Fi(l,t,Sn,!zi);break e;case 2:un=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(p=wa+300-ft(),10<p)){if(Fi(l,t,Sn,!zi),ei(l,0,!0)!==0)break e;gi=t,l.timeoutHandle=Lp(np.bind(null,l,i,un,Ea,Uc,t,Sn,Cr,es,zi,w,"Throttled",-0,0),p);break e}np(l,i,un,Ea,Uc,t,Sn,Cr,es,zi,w,null,-0,0)}}break}while(!0);Xn(e)}function np(e,t,i,l,p,w,B,P,Q,ae,pe,_e,oe,he){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:Zt},Kd(t,w,_e);var Te=(w&62914560)===w?wa-ft():(w&4194048)===w?Zd-ft():0;if(Te=F0(_e,Te),Te!==null){gi=w,e.cancelPendingCommit=Te(up.bind(null,e,t,w,i,l,p,B,P,Q,pe,_e,null,oe,he)),Fi(e,w,B,!ae);return}}up(e,t,w,i,l,p,B,P,Q)}function r0(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var p=i[l],w=p.getSnapshot;p=p.value;try{if(!mn(w(),p))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fi(e,t,i,l){t&=~Ic,t&=~Cr,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var p=t;0<p;){var w=31-qe(p),B=1<<w;l[w]=-1,p&=~B}i!==0&&jl(e,i,t)}function ka(){return(et&6)===0?(al(0),!1):!0}function Gc(){if(Ge!==null){if(nt===0)var e=Ge.return;else e=Ge,si=dr=null,lc(e),$r=null,qs=0,e=Ge;for(;e!==null;)Od(e.alternate,e),e=e.return;Ge=null}}function ns(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,x0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),gi=0,Gc(),at=e,Ge=i=ii(e.current,null),We=t,nt=0,yn=null,zi=!1,Jr=nr(e,t),zc=!1,es=Sn=Ic=Cr=Ii=Ct=0,un=sl=null,Uc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var p=31-qe(l),w=1<<p;t|=e[p],l&=~w}return mi=t,Wl(),i}function ip(e,t){Ie=null,V.H=Qs,t===Vr||t===ta?(t=yf(),nt=3):t===Ko?(t=yf(),nt=4):nt=t===Cc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yn=t,Ge===null&&(Ct=1,ma(e,kn(t,e.current)))}function rp(){var e=_n.current;return e===null?!0:(We&4194048)===We?Dn===null:(We&62914560)===We||(We&536870912)!==0?e===Dn:!1}function sp(){var e=V.H;return V.H=Qs,e===null?Qs:e}function lp(){var e=V.A;return V.A=n0,e}function Aa(){Ct=4,zi||(We&4194048)!==We&&_n.current!==null||(Jr=!0),(Ii&134217727)===0&&(Cr&134217727)===0||at===null||Fi(at,We,Sn,!1)}function Vc(e,t,i){var l=et;et|=2;var p=sp(),w=lp();(at!==e||We!==t)&&(Ea=null,ns(e,t)),t=!1;var B=Ct;e:do try{if(nt!==0&&Ge!==null){var P=Ge,Q=yn;switch(nt){case 8:Gc(),B=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(t=!0);var ae=nt;if(nt=0,yn=null,is(e,P,Q,ae),i&&Jr){B=0;break e}break;default:ae=nt,nt=0,yn=null,is(e,P,Q,ae)}}s0(),B=Ct;break}catch(pe){ip(e,pe)}while(!0);return t&&e.shellSuspendCounter++,si=dr=null,et=l,V.H=p,V.A=w,Ge===null&&(at=null,We=0,Wl()),B}function s0(){for(;Ge!==null;)ap(Ge)}function l0(e,t){var i=et;et|=2;var l=sp(),p=lp();at!==e||We!==t?(Ea=null,xa=ft()+500,ns(e,t)):Jr=nr(e,t);e:do try{if(nt!==0&&Ge!==null){t=Ge;var w=yn;t:switch(nt){case 1:nt=0,yn=null,is(e,t,w,1);break;case 2:case 9:if(_f(w)){nt=0,yn=null,op(t);break}t=function(){nt!==2&&nt!==9||at!==e||(nt=7),Xn(e)},w.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:_f(w)?(nt=0,yn=null,op(t)):(nt=0,yn=null,is(e,t,w,7));break;case 5:var B=null;switch(Ge.tag){case 26:B=Ge.memoizedState;case 5:case 27:var P=Ge;if(B?Wp(B):P.stateNode.complete){nt=0,yn=null;var Q=P.sibling;if(Q!==null)Ge=Q;else{var ae=P.return;ae!==null?(Ge=ae,Ta(ae)):Ge=null}break t}}nt=0,yn=null,is(e,t,w,5);break;case 6:nt=0,yn=null,is(e,t,w,6);break;case 8:Gc(),Ct=6;break e;default:throw Error(o(462))}}a0();break}catch(pe){ip(e,pe)}while(!0);return si=dr=null,V.H=l,V.A=p,et=i,Ge!==null?0:(at=null,We=0,Wl(),Ct)}function a0(){for(;Ge!==null&&!xn();)ap(Ge)}function ap(e){var t=Md(e.alternate,e,mi);e.memoizedProps=e.pendingProps,t===null?Ta(e):Ge=t}function op(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Ed(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=Ed(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:lc(t);default:Od(i,t),t=Ge=lf(t,mi),t=Md(i,t,mi)}e.memoizedProps=e.pendingProps,t===null?Ta(e):Ge=t}function is(e,t,i,l){si=dr=null,lc(t),$r=null,qs=0;var p=t.return;try{if(Yv(e,p,t,i,We)){Ct=1,ma(e,kn(i,e.current)),Ge=null;return}}catch(w){if(p!==null)throw Ge=p,w;Ct=1,ma(e,kn(i,e.current)),Ge=null;return}t.flags&32768?(Ye||l===1?e=!0:Jr||(We&536870912)!==0?e=!1:(zi=e=!0,(l===2||l===9||l===3||l===6)&&(l=_n.current,l!==null&&l.tag===13&&(l.flags|=16384))),cp(t,e)):Ta(t)}function Ta(e){var t=e;do{if((t.flags&32768)!==0){cp(t,zi);return}e=t.return;var i=Zv(t.alternate,t,mi);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 cp(e,t){do{var i=Jv(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 up(e,t,i,l,p,w,B,P,Q){e.cancelPendingCommit=null;do Ra();while(Nt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(w=t.lanes|t.childLanes,w|=Oo,Bl(e,i,w,B,P,Q),e===at&&(Ge=at=null,We=0),ts=t,Pi=e,gi=i,Pc=w,Fc=p,Jd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,h0(Ae,function(){return mp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=V.T,V.T=null,p=K.p,K.p=2,B=et,et|=4;try{e0(e,t,i)}finally{et=B,K.p=p,V.T=l}}Nt=1,hp(),fp(),dp()}}function hp(){if(Nt===1){Nt=0;var e=Pi,t=ts,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var l=K.p;K.p=2;var p=et;et|=4;try{Vd(t,e);var w=iu,B=Xh(e.containerInfo),P=w.focusedElem,Q=w.selectionRange;if(B!==P&&P&&P.ownerDocument&&Yh(P.ownerDocument.documentElement,P)){if(Q!==null&&To(P)){var ae=Q.start,pe=Q.end;if(pe===void 0&&(pe=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(pe,P.value.length);else{var _e=P.ownerDocument||document,oe=_e&&_e.defaultView||window;if(oe.getSelection){var he=oe.getSelection(),Te=P.textContent.length,Oe=Math.min(Q.start,Te),lt=Q.end===void 0?Oe:Math.min(Q.end,Te);!he.extend&&Oe>lt&&(B=lt,lt=Oe,Oe=B);var re=Kh(P,Oe),te=Kh(P,lt);if(re&&te&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var le=_e.createRange();le.setStart(re.node,re.offset),he.removeAllRanges(),Oe>lt?(he.addRange(le),he.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),he.addRange(le))}}}}for(_e=[],he=P;he=he.parentNode;)he.nodeType===1&&_e.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<_e.length;P++){var ge=_e[P];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Pa=!!nu,iu=nu=null}finally{et=p,K.p=l,V.T=i}}e.current=t,Nt=2}}function fp(){if(Nt===2){Nt=0;var e=Pi,t=ts,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var l=K.p;K.p=2;var p=et;et|=4;try{Ud(e,t.alternate,t)}finally{et=p,K.p=l,V.T=i}}Nt=3}}function dp(){if(Nt===4||Nt===3){Nt=0,wt();var e=Pi,t=ts,i=gi,l=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,ts=Pi=null,pp(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Ui=null),gt(i),t=t.stateNode,we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(Je,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=V.T,p=K.p,K.p=2,V.T=null;try{for(var w=e.onRecoverableError,B=0;B<l.length;B++){var P=l[B];w(P.value,{componentStack:P.stack})}}finally{V.T=t,K.p=p}}(gi&3)!==0&&Ra(),Xn(e),p=e.pendingLanes,(i&261930)!==0&&(p&42)!==0?e===qc?ll++:(ll=0,qc=e):ll=0,al(0)}}function pp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ps(t)))}function Ra(){return hp(),fp(),dp(),mp()}function mp(){if(Nt!==5)return!1;var e=Pi,t=Pc;Pc=0;var i=gt(gi),l=V.T,p=K.p;try{K.p=32>i?32:i,V.T=null,i=Fc,Fc=null;var w=Pi,B=gi;if(Nt=0,ts=Pi=null,gi=0,(et&6)!==0)throw Error(o(331));var P=et;if(et|=4,Xd(w.current),Wd(w,w.current,B,i),et=P,al(0,!1),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(Je,w)}catch{}return!0}finally{K.p=p,V.T=l,pp(e,t)}}function gp(e,t,i){t=kn(i,t),t=bc(e.stateNode,t,2),e=Bi(e,t,2),e!==null&&(qn(e,2),Xn(e))}function it(e,t,i){if(e.tag===3)gp(e,e,i);else for(;t!==null;){if(t.tag===3){gp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ui===null||!Ui.has(l))){e=kn(i,e),i=_d(2),l=Bi(t,i,2),l!==null&&(vd(i,l,t,e),qn(l,2),Xn(l));break}}t=t.return}}function $c(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new i0;var p=new Set;l.set(t,p)}else p=l.get(t),p===void 0&&(p=new Set,l.set(t,p));p.has(i)||(zc=!0,p.add(i),e=o0.bind(null,e,t,i),t.then(e,e))}function o0(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,at===e&&(We&i)===i&&(Ct===4||Ct===3&&(We&62914560)===We&&300>ft()-wa?(et&2)===0&&ns(e,0):Ic|=i,es===We&&(es=0)),Xn(e)}function _p(e,t){t===0&&(t=Ol()),e=ur(e,t),e!==null&&(qn(e,t),Xn(e))}function c0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),_p(e,i)}function u0(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(i=p.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),_p(e,i)}function h0(e,t){return Kt(e,t)}var Da=null,rs=null,Wc=!1,Ma=!1,Kc=!1,qi=0;function Xn(e){e!==rs&&e.next===null&&(rs===null?Da=rs=e:rs=rs.next=e),Ma=!0,Wc||(Wc=!0,d0())}function al(e,t){if(!Kc&&Ma){Kc=!0;do for(var i=!1,l=Da;l!==null;){if(e!==0){var p=l.pendingLanes;if(p===0)var w=0;else{var B=l.suspendedLanes,P=l.pingedLanes;w=(1<<31-qe(42|e)+1)-1,w&=p&~(B&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,bp(l,w))}else w=We,w=ei(l,l===at?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||nr(l,w)||(i=!0,bp(l,w));l=l.next}while(i);Kc=!1}}function f0(){vp()}function vp(){Ma=Wc=!1;var e=0;qi!==0&&w0()&&(e=qi);for(var t=ft(),i=null,l=Da;l!==null;){var p=l.next,w=yp(l,t);w===0?(l.next=null,i===null?Da=p:i.next=p,p===null&&(rs=i)):(i=l,(e!==0||(w&3)!==0)&&(Ma=!0)),l=p}Nt!==0&&Nt!==5||al(e),qi!==0&&(qi=0)}function yp(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var B=31-qe(w),P=1<<B,Q=p[B];Q===-1?((P&i)===0||(P&l)!==0)&&(p[B]=mo(P,t)):Q<=t&&(e.expiredLanes|=P),w&=~P}if(t=at,i=We,i=ei(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&nn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||nr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&nn(l),gt(i)){case 2:case 8:i=ye;break;case 32:i=Ae;break;case 268435456:i=Ne;break;default:i=Ae}return l=Sp.bind(null,e),i=Kt(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&nn(l),e.callbackPriority=2,e.callbackNode=null,2}function Sp(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ra()&&e.callbackNode!==i)return null;var l=We;return l=ei(e,e===at?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tp(e,l,t),yp(e,ft()),e.callbackNode!=null&&e.callbackNode===i?Sp.bind(null,e):null)}function bp(e,t){if(Ra())return null;tp(e,t,!0)}function d0(){E0(function(){(et&6)!==0?Kt(ne,f0):vp()})}function Yc(){if(qi===0){var e=qr;e===0&&(e=Bn,Bn<<=1,(Bn&261888)===0&&(Bn=256)),qi=e}return qi}function Cp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:St(""+e)}function wp(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 p0(e,t,i,l,p){if(t==="submit"&&i&&i.stateNode===p){var w=Cp((p[jt]||null).action),B=l.submitter;B&&(t=(t=B[jt]||null)?Cp(t.formAction):B.getAttribute("formAction"),t!==null&&(w=t,B=null));var P=new ql("action","action",null,l,p);e.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(qi!==0){var Q=B?wp(p,B):new FormData(p);mc(i,{pending:!0,data:Q,method:p.method,action:w},null,Q)}}else typeof w=="function"&&(P.preventDefault(),Q=B?wp(p,B):new FormData(p),mc(i,{pending:!0,data:Q,method:p.method,action:w},w,Q))},currentTarget:p}]})}}for(var Xc=0;Xc<Lo.length;Xc++){var Qc=Lo[Xc],m0=Qc.toLowerCase(),g0=Qc[0].toUpperCase()+Qc.slice(1);zn(m0,"on"+g0)}zn(Jh,"onAnimationEnd"),zn(ef,"onAnimationIteration"),zn(tf,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(Lv,"onTransitionRun"),zn(Ov,"onTransitionStart"),zn(Bv,"onTransitionCancel"),zn(nf,"onTransitionEnd"),Ci("onMouseEnter",["mouseout","mouseover"]),Ci("onMouseLeave",["mouseout","mouseover"]),Ci("onPointerEnter",["pointerout","pointerover"]),Ci("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="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(" "),_0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function xp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],p=l.event;l=l.listeners;e:{var w=void 0;if(t)for(var B=l.length-1;0<=B;B--){var P=l[B],Q=P.instance,ae=P.currentTarget;if(P=P.listener,Q!==w&&p.isPropagationStopped())break e;w=P,p.currentTarget=ae;try{w(p)}catch(pe){$l(pe)}p.currentTarget=null,w=Q}else for(B=0;B<l.length;B++){if(P=l[B],Q=P.instance,ae=P.currentTarget,P=P.listener,Q!==w&&p.isPropagationStopped())break e;w=P,p.currentTarget=ae;try{w(p)}catch(pe){$l(pe)}p.currentTarget=null,w=Q}}}}function Ve(e,t){var i=t[ee];i===void 0&&(i=t[ee]=new Set);var l=e+"__bubble";i.has(l)||(Ep(t,e,2,!1),i.add(l))}function Zc(e,t,i){var l=0;t&&(l|=4),Ep(i,e,l,t)}var La="_reactListening"+Math.random().toString(36).slice(2);function Jc(e){if(!e[La]){e[La]=!0,ws.forEach(function(i){i!=="selectionchange"&&(_0.has(i)||Zc(i,!1,e),Zc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[La]||(t[La]=!0,Zc("selectionchange",!1,t))}}function Ep(e,t,i,l){switch(em(t)){case 2:var p=V0;break;case 8:p=$0;break;default:p=pu}i=p.bind(null,t,i,e),p=void 0,!yo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(t,i,{capture:!0,passive:p}):e.addEventListener(t,i,!0):p!==void 0?e.addEventListener(t,i,{passive:p}):e.addEventListener(t,i,!1)}function eu(e,t,i,l,p){var w=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var B=l.tag;if(B===3||B===4){var P=l.stateNode.containerInfo;if(P===p)break;if(B===4)for(B=l.return;B!==null;){var Q=B.tag;if((Q===3||Q===4)&&B.stateNode.containerInfo===p)return;B=B.return}for(;P!==null;){if(B=ti(P),B===null)return;if(Q=B.tag,Q===5||Q===6||Q===26||Q===27){l=w=B;continue e}P=P.parentNode}}l=l.return}Rh(function(){var ae=w,pe=Rs(i),_e=[];e:{var oe=rf.get(e);if(oe!==void 0){var he=ql,Te=e;switch(e){case"keypress":if(Pl(i)===0)break e;case"keydown":case"keyup":he=uv;break;case"focusin":Te="focus",he=wo;break;case"focusout":Te="blur",he=wo;break;case"beforeblur":case"afterblur":he=wo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Lh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Z_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=dv;break;case Jh:case ef:case tf:he=tv;break;case nf:he=mv;break;case"scroll":case"scrollend":he=X_;break;case"wheel":he=_v;break;case"copy":case"cut":case"paste":he=iv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Bh;break;case"toggle":case"beforetoggle":he=yv}var Oe=(t&4)!==0,lt=!Oe&&(e==="scroll"||e==="scrollend"),re=Oe?oe!==null?oe+"Capture":null:oe;Oe=[];for(var te=ae,le;te!==null;){var ge=te;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||re===null||(ge=Ds(te,re),ge!=null&&Oe.push(cl(te,ge,le))),lt)break;te=te.return}0<Oe.length&&(oe=new he(oe,Te,null,i,pe),_e.push({event:oe,listeners:Oe}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",oe&&i!==$n&&(Te=i.relatedTarget||i.fromElement)&&(ti(Te)||Te[Gn]))break e;if((he||oe)&&(oe=pe.window===pe?pe:(oe=pe.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(Te=i.relatedTarget||i.toElement,he=ae,Te=Te?ti(Te):null,Te!==null&&(lt=_(Te),Oe=Te.tag,Te!==lt||Oe!==5&&Oe!==27&&Oe!==6)&&(Te=null)):(he=null,Te=ae),he!==Te)){if(Oe=Lh,ge="onMouseLeave",re="onMouseEnter",te="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=Bh,ge="onPointerLeave",re="onPointerEnter",te="pointer"),lt=he==null?oe:sr(he),le=Te==null?oe:sr(Te),oe=new Oe(ge,te+"leave",he,i,pe),oe.target=lt,oe.relatedTarget=le,ge=null,ti(pe)===ae&&(Oe=new Oe(re,te+"enter",Te,i,pe),Oe.target=le,Oe.relatedTarget=lt,ge=Oe),lt=ge,he&&Te)t:{for(Oe=v0,re=he,te=Te,le=0,ge=re;ge;ge=Oe(ge))le++;ge=0;for(var Me=te;Me;Me=Oe(Me))ge++;for(;0<le-ge;)re=Oe(re),le--;for(;0<ge-le;)te=Oe(te),ge--;for(;le--;){if(re===te||te!==null&&re===te.alternate){Oe=re;break t}re=Oe(re),te=Oe(te)}Oe=null}else Oe=null;he!==null&&kp(_e,oe,he,Oe,!1),Te!==null&&lt!==null&&kp(_e,lt,Te,Oe,!0)}}e:{if(oe=ae?sr(ae):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Qe=Fh;else if(Uh(oe))if(qh)Qe=Rv;else{Qe=Av;var Re=kv}else he=oe.nodeName,!he||he.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&$(ae.elementType)&&(Qe=Fh):Qe=Tv;if(Qe&&(Qe=Qe(e,ae))){Ph(_e,Qe,i,pe);break e}Re&&Re(e,oe,ae),e==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Hn(oe,"number",oe.value)}switch(Re=ae?sr(ae):window,e){case"focusin":(Uh(Re)||Re.contentEditable==="true")&&(jr=Re,Ro=ae,zs=null);break;case"focusout":zs=Ro=jr=null;break;case"mousedown":Do=!0;break;case"contextmenu":case"mouseup":case"dragend":Do=!1,Qh(_e,i,pe);break;case"selectionchange":if(Mv)break;case"keydown":case"keyup":Qh(_e,i,pe)}var Pe;if(Eo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Br?zh(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(jh&&i.locale!=="ko"&&(Br||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Br&&(Pe=Dh()):(Ai=pe,So="value"in Ai?Ai.value:Ai.textContent,Br=!0)),Re=Oa(ae,Ke),0<Re.length&&(Ke=new Oh(Ke,e,null,i,pe),_e.push({event:Ke,listeners:Re}),Pe?Ke.data=Pe:(Pe=Ih(i),Pe!==null&&(Ke.data=Pe)))),(Pe=bv?Cv(e,i):wv(e,i))&&(Ke=Oa(ae,"onBeforeInput"),0<Ke.length&&(Re=new Oh("onBeforeInput","beforeinput",null,i,pe),_e.push({event:Re,listeners:Ke}),Re.data=Pe)),p0(_e,e,ae,i,pe)}xp(_e,t)})}function cl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Oa(e,t){for(var i=t+"Capture",l=[];e!==null;){var p=e,w=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||w===null||(p=Ds(e,i),p!=null&&l.unshift(cl(e,p,w)),p=Ds(e,t),p!=null&&l.push(cl(e,p,w))),e.tag===3)return l;e=e.return}return[]}function v0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kp(e,t,i,l,p){for(var w=t._reactName,B=[];i!==null&&i!==l;){var P=i,Q=P.alternate,ae=P.stateNode;if(P=P.tag,Q!==null&&Q===l)break;P!==5&&P!==26&&P!==27||ae===null||(Q=ae,p?(ae=Ds(i,w),ae!=null&&B.unshift(cl(i,ae,Q))):p||(ae=Ds(i,w),ae!=null&&B.push(cl(i,ae,Q)))),i=i.return}B.length!==0&&e.push({event:t,listeners:B})}var y0=/\r\n?/g,S0=/\u0000|\uFFFD/g;function Ap(e){return(typeof e=="string"?e:""+e).replace(y0,`
49
+ `).replace(S0,"")}function Tp(e,t){return t=Ap(t),Ap(e)===t}function st(e,t,i,l,p,w){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ki(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ki(e,""+l);break;case"className":Dr(e,"class",l);break;case"tabIndex":Dr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Dr(e,i,l);break;case"style":Ts(e,l,w);break;case"data":if(t!=="object"){Dr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=St(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(i==="formAction"?(t!=="input"&&st(e,t,"name",p.name,p,null),st(e,t,"formEncType",p.formEncType,p,null),st(e,t,"formMethod",p.formMethod,p,null),st(e,t,"formTarget",p.formTarget,p,null)):(st(e,t,"encType",p.encType,p,null),st(e,t,"method",p.method,p,null),st(e,t,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=St(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Zt);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=St(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Rr(e,"popover",l);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Rr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=me.get(i)||i,Rr(e,i,l))}}function tu(e,t,i,l,p,w){switch(i){case"style":Ts(e,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof l=="string"?ki(e,l):(typeof l=="number"||typeof l=="bigint")&&ki(e,""+l);break;case"onScroll":l!=null&&Ve("scroll",e);break;case"onScrollEnd":l!=null&&Ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Zt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xs.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),t=i.slice(2,p?i.length-7:void 0),w=e[jt]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,p),typeof l=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,p);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Rr(e,i,l)}}}function Ft(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 l=!1,p=!1,w;for(w in i)if(i.hasOwnProperty(w)){var B=i[w];if(B!=null)switch(w){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,w,B,i,null)}}p&&st(e,t,"srcSet",i.srcSet,i,null),l&&st(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var P=w=B=p=null,Q=null,ae=null;for(l in i)if(i.hasOwnProperty(l)){var pe=i[l];if(pe!=null)switch(l){case"name":p=pe;break;case"type":B=pe;break;case"checked":Q=pe;break;case"defaultChecked":ae=pe;break;case"value":w=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(o(137,t));break;default:st(e,t,l,pe,i,null)}}Vn(e,w,P,Q,ae,B,p,!1);return;case"select":Ve("invalid",e),l=B=w=null;for(p in i)if(i.hasOwnProperty(p)&&(P=i[p],P!=null))switch(p){case"value":w=P;break;case"defaultValue":B=P;break;case"multiple":l=P;default:st(e,t,p,P,i,null)}t=w,i=B,e.multiple=!!l,t!=null?je(e,!!l,t,!1):i!=null&&je(e,!!l,i,!0);return;case"textarea":Ve("invalid",e),w=p=l=null;for(B in i)if(i.hasOwnProperty(B)&&(P=i[B],P!=null))switch(B){case"value":l=P;break;case"defaultValue":p=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(91));break;default:st(e,t,B,P,i,null)}Il(e,l,p,w);return;case"option":for(Q in i)if(i.hasOwnProperty(Q)&&(l=i[Q],l!=null))switch(Q){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:st(e,t,Q,l,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(l=0;l<ol.length;l++)Ve(ol[l],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(ae in i)if(i.hasOwnProperty(ae)&&(l=i[ae],l!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,ae,l,i,null)}return;default:if($(t)){for(pe in i)i.hasOwnProperty(pe)&&(l=i[pe],l!==void 0&&tu(e,t,pe,l,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(l=i[P],l!=null&&st(e,t,P,l,i,null))}function b0(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,w=null,B=null,P=null,Q=null,ae=null,pe=null;for(he in i){var _e=i[he];if(i.hasOwnProperty(he)&&_e!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=_e;default:l.hasOwnProperty(he)||st(e,t,he,null,l,_e)}}for(var oe in l){var he=l[oe];if(_e=i[oe],l.hasOwnProperty(oe)&&(he!=null||_e!=null))switch(oe){case"type":w=he;break;case"name":p=he;break;case"checked":ae=he;break;case"defaultChecked":pe=he;break;case"value":B=he;break;case"defaultValue":P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,t));break;default:he!==_e&&st(e,t,oe,he,l,_e)}}Ei(e,B,P,Q,ae,pe,w,p);return;case"select":he=B=P=oe=null;for(w in i)if(Q=i[w],i.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":he=Q;default:l.hasOwnProperty(w)||st(e,t,w,null,l,Q)}for(p in l)if(w=l[p],Q=i[p],l.hasOwnProperty(p)&&(w!=null||Q!=null))switch(p){case"value":oe=w;break;case"defaultValue":P=w;break;case"multiple":B=w;default:w!==Q&&st(e,t,p,w,l,Q)}t=P,i=B,l=he,oe!=null?je(e,!!i,oe,!1):!!l!=!!i&&(t!=null?je(e,!!i,t,!0):je(e,!!i,i?[]:"",!1));return;case"textarea":he=oe=null;for(P in i)if(p=i[P],i.hasOwnProperty(P)&&p!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:st(e,t,P,null,l,p)}for(B in l)if(p=l[B],w=i[B],l.hasOwnProperty(B)&&(p!=null||w!=null))switch(B){case"value":oe=p;break;case"defaultValue":he=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==w&&st(e,t,B,p,l,w)}zl(e,oe,he);return;case"option":for(var Te in i)if(oe=i[Te],i.hasOwnProperty(Te)&&oe!=null&&!l.hasOwnProperty(Te))switch(Te){case"selected":e.selected=!1;break;default:st(e,t,Te,null,l,oe)}for(Q in l)if(oe=l[Q],he=i[Q],l.hasOwnProperty(Q)&&oe!==he&&(oe!=null||he!=null))switch(Q){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:st(e,t,Q,oe,l,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in i)oe=i[Oe],i.hasOwnProperty(Oe)&&oe!=null&&!l.hasOwnProperty(Oe)&&st(e,t,Oe,null,l,oe);for(ae in l)if(oe=l[ae],he=i[ae],l.hasOwnProperty(ae)&&oe!==he&&(oe!=null||he!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:st(e,t,ae,oe,l,he)}return;default:if($(t)){for(var lt in i)oe=i[lt],i.hasOwnProperty(lt)&&oe!==void 0&&!l.hasOwnProperty(lt)&&tu(e,t,lt,void 0,l,oe);for(pe in l)oe=l[pe],he=i[pe],!l.hasOwnProperty(pe)||oe===he||oe===void 0&&he===void 0||tu(e,t,pe,oe,l,he);return}}for(var re in i)oe=i[re],i.hasOwnProperty(re)&&oe!=null&&!l.hasOwnProperty(re)&&st(e,t,re,null,l,oe);for(_e in l)oe=l[_e],he=i[_e],!l.hasOwnProperty(_e)||oe===he||oe==null&&he==null||st(e,t,_e,oe,l,he)}function Rp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var p=i[l],w=p.transferSize,B=p.initiatorType,P=p.duration;if(w&&P&&Rp(B)){for(B=0,P=p.responseEnd,l+=1;l<i.length;l++){var Q=i[l],ae=Q.startTime;if(ae>P)break;var pe=Q.transferSize,_e=Q.initiatorType;pe&&Rp(_e)&&(Q=Q.responseEnd,B+=pe*(Q<P?1:(P-ae)/(Q-ae)))}if(--l,t+=8*(w+B)/(p.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nu=null,iu=null;function Ba(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Mp(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 ru(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 su=null;function w0(){var e=window.event;return e&&e.type==="popstate"?e===su?!1:(su=e,!0):(su=null,!1)}var Lp=typeof setTimeout=="function"?setTimeout:void 0,x0=typeof clearTimeout=="function"?clearTimeout:void 0,Op=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof Op<"u"?function(e){return Op.resolve(null).then(e).catch(k0)}:Lp;function k0(e){setTimeout(function(){throw e})}function Gi(e){return e==="head"}function Bp(e,t){var i=t,l=0;do{var p=i.nextSibling;if(e.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(p),os(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")ul(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,ul(i);for(var w=i.firstChild;w;){var B=w.nextSibling,P=w.nodeName;w[pn]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=B}}else i==="body"&&ul(e.ownerDocument.body);i=p}while(i);os(t)}function jp(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function lu(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":lu(i),rr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function A0(e,t,i,l){for(;e.nodeType===1;){var p=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[pn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(w=e.getAttribute("rel"),w==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(w!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=Mn(e.nextSibling),e===null)break}return null}function T0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Mn(e.nextSibling),e===null))return null;return e}function Np(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Mn(e.nextSibling),e===null))return null;return e}function au(e){return e.data==="$?"||e.data==="$~"}function ou(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function R0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Mn(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 cu=null;function Hp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Mn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function zp(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 Ip(e,t,i){switch(t=Ba(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function ul(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rr(e)}var Ln=new Map,Up=new Set;function ja(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _i=K.d;K.d={f:D0,r:M0,D:L0,C:O0,L:B0,m:j0,X:H0,S:N0,M:z0};function D0(){var e=_i.f(),t=ka();return e||t}function M0(e){var t=bi(e);t!==null&&t.tag===5&&t.type==="form"?id(t):_i.r(e)}var ss=typeof document>"u"?null:document;function Pp(e,t,i){var l=ss;if(l&&typeof t=="string"&&t){var p=xt(t);p='link[rel="'+e+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),Up.has(p)||(Up.add(p),e={rel:e,crossOrigin:i,href:t},l.querySelector(p)===null&&(t=l.createElement("link"),Ft(t,"link",e),tt(t),l.head.appendChild(t)))}}function L0(e){_i.D(e),Pp("dns-prefetch",e,null)}function O0(e,t){_i.C(e,t),Pp("preconnect",e,t)}function B0(e,t,i){_i.L(e,t,i);var l=ss;if(l&&e&&t){var p='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+xt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+xt(i.imageSizes)+'"]')):p+='[href="'+xt(e)+'"]';var w=p;switch(t){case"style":w=ls(e);break;case"script":w=as(e)}Ln.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ln.set(w,e),l.querySelector(p)!==null||t==="style"&&l.querySelector(hl(w))||t==="script"&&l.querySelector(fl(w))||(t=l.createElement("link"),Ft(t,"link",e),tt(t),l.head.appendChild(t)))}}function j0(e,t){_i.m(e,t);var i=ss;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",p='link[rel="modulepreload"][as="'+xt(l)+'"][href="'+xt(e)+'"]',w=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=as(e)}if(!Ln.has(w)&&(e=u({rel:"modulepreload",href:e},t),Ln.set(w,e),i.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(fl(w)))return}l=i.createElement("link"),Ft(l,"link",e),tt(l),i.head.appendChild(l)}}}function N0(e,t,i){_i.S(e,t,i);var l=ss;if(l&&e){var p=Rt(l).hoistableStyles,w=ls(e);t=t||"default";var B=p.get(w);if(!B){var P={loading:0,preload:null};if(B=l.querySelector(hl(w)))P.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ln.get(w))&&uu(e,i);var Q=B=l.createElement("link");tt(Q),Ft(Q,"link",e),Q._p=new Promise(function(ae,pe){Q.onload=ae,Q.onerror=pe}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Na(B,t,l)}B={type:"stylesheet",instance:B,count:1,state:P},p.set(w,B)}}}function H0(e,t){_i.X(e,t);var i=ss;if(i&&e){var l=Rt(i).hoistableScripts,p=as(e),w=l.get(p);w||(w=i.querySelector(fl(p)),w||(e=u({src:e,async:!0},t),(t=Ln.get(p))&&hu(e,t),w=i.createElement("script"),tt(w),Ft(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(p,w))}}function z0(e,t){_i.M(e,t);var i=ss;if(i&&e){var l=Rt(i).hoistableScripts,p=as(e),w=l.get(p);w||(w=i.querySelector(fl(p)),w||(e=u({src:e,async:!0,type:"module"},t),(t=Ln.get(p))&&hu(e,t),w=i.createElement("script"),tt(w),Ft(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(p,w))}}function Fp(e,t,i,l){var p=(p=ve.current)?ja(p):null;if(!p)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ls(i.href),i=Rt(p).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ls(i.href);var w=Rt(p).hoistableStyles,B=w.get(e);if(B||(p=p.ownerDocument||p,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,B),(w=p.querySelector(hl(e)))&&!w._p&&(B.instance=w,B.state.loading=5),Ln.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},Ln.set(e,i),w||I0(p,e,i,B.state))),t&&l===null)throw Error(o(528,""));return B}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=as(i),i=Rt(p).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ls(e){return'href="'+xt(e)+'"'}function hl(e){return'link[rel="stylesheet"]['+e+"]"}function qp(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function I0(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ft(t,"link",i),tt(t),e.head.appendChild(t))}function as(e){return'[src="'+xt(e)+'"]'}function fl(e){return"script[async]"+e}function Gp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+xt(i.href)+'"]');if(l)return t.instance=l,tt(l),l;var p=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),tt(l),Ft(l,"style",p),Na(l,i.precedence,e),t.instance=l;case"stylesheet":p=ls(i.href);var w=e.querySelector(hl(p));if(w)return t.state.loading|=4,t.instance=w,tt(w),w;l=qp(i),(p=Ln.get(p))&&uu(l,p),w=(e.ownerDocument||e).createElement("link"),tt(w);var B=w;return B._p=new Promise(function(P,Q){B.onload=P,B.onerror=Q}),Ft(w,"link",l),t.state.loading|=4,Na(w,i.precedence,e),t.instance=w;case"script":return w=as(i.src),(p=e.querySelector(fl(w)))?(t.instance=p,tt(p),p):(l=i,(p=Ln.get(w))&&(l=u({},i),hu(l,p)),e=e.ownerDocument||e,p=e.createElement("script"),tt(p),Ft(p,"link",l),e.head.appendChild(p),t.instance=p);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Na(l,i.precedence,e));return t.instance}function Na(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,w=p,B=0;B<l.length;B++){var P=l[B];if(P.dataset.precedence===t)w=P;else if(w!==p)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ha=null;function Vp(e,t,i){if(Ha===null){var l=new Map,p=Ha=new Map;p.set(i,l)}else p=Ha,l=p.get(i),l||(l=new Map,p.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),p=0;p<i.length;p++){var w=i[p];if(!(w[pn]||w[yt]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var B=w.getAttribute(t)||"";B=e+B;var P=l.get(B);P?P.push(w):l.set(B,[w])}}return l}function $p(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function U0(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 Wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function P0(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=ls(l.href),w=t.querySelector(hl(p));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=za.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,tt(w);return}w=t.ownerDocument||t,l=qp(l),(p=Ln.get(p))&&uu(l,p),w=w.createElement("link"),tt(w);var B=w;B._p=new Promise(function(P,Q){B.onload=P,B.onerror=Q}),Ft(w,"link",l),i.instance=w}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=za.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var fu=0;function F0(e,t){return e.stylesheets&&e.count===0&&Ua(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&Ua(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&fu===0&&(fu=62500*C0());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ua(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>fu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function za(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ua(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ia=null;function Ua(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ia=new Map,t.forEach(q0,e),Ia=null,za.call(e))}function q0(e,t){if(!(t.state.loading&4)){var i=Ia.get(e);if(i)var l=i.get(null);else{i=new Map,Ia.set(e,i);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<p.length;w++){var B=p[w];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),l=B)}l&&i.set(null,l)}p=t.instance,B=p.getAttribute("data-precedence"),w=i.get(B)||l,w===l&&i.set(null,p),i.set(B,p),this.count++,l=za.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),w?w.parentNode.insertBefore(p,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),t.state.loading|=4}}var dl={$$typeof:S,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function G0(e,t,i,l,p,w,B,P,Q){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=kr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kr(0),this.hiddenUpdates=kr(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=w,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function Kp(e,t,i,l,p,w,B,P,Q,ae,pe,_e){return e=new G0(e,t,i,B,Q,ae,pe,_e,P),t=1,w===!0&&(t|=24),w=gn(3,null,null,t),e.current=w,w.stateNode=e,t=Vo(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:l,isDehydrated:i,cache:t},Yo(w),e}function Yp(e){return e?(e=zr,e):zr}function Xp(e,t,i,l,p,w){p=Yp(p),l.context===null?l.context=p:l.pendingContext=p,l=Oi(t),l.payload={element:i},w=w===void 0?null:w,w!==null&&(l.callback=w),i=Bi(e,l,t),i!==null&&(hn(i,e,t),Vs(i,e,t))}function Qp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function du(e,t){Qp(e,t),(e=e.alternate)&&Qp(e,t)}function Zp(e){if(e.tag===13||e.tag===31){var t=ur(e,67108864);t!==null&&hn(t,e,67108864),du(e,67108864)}}function Jp(e){if(e.tag===13||e.tag===31){var t=bn();t=Ar(t);var i=ur(e,t);i!==null&&hn(i,e,t),du(e,t)}}var Pa=!0;function V0(e,t,i,l){var p=V.T;V.T=null;var w=K.p;try{K.p=2,pu(e,t,i,l)}finally{K.p=w,V.T=p}}function $0(e,t,i,l){var p=V.T;V.T=null;var w=K.p;try{K.p=8,pu(e,t,i,l)}finally{K.p=w,V.T=p}}function pu(e,t,i,l){if(Pa){var p=mu(l);if(p===null)eu(e,t,l,Fa,i),tm(e,l);else if(K0(p,e,t,i,l))l.stopPropagation();else if(tm(e,l),t&4&&-1<W0.indexOf(e)){for(;p!==null;){var w=bi(p);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var B=Jn(w.pendingLanes);if(B!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;B;){var Q=1<<31-qe(B);P.entanglements[1]|=Q,B&=~Q}Xn(w),(et&6)===0&&(xa=ft()+500,al(0))}}break;case 31:case 13:P=ur(w,2),P!==null&&hn(P,w,2),ka(),du(w,2)}if(w=mu(l),w===null&&eu(e,t,l,Fa,i),w===p)break;p=w}p!==null&&l.stopPropagation()}else eu(e,t,l,null,i)}}function mu(e){return e=Rs(e),gu(e)}var Fa=null;function gu(e){if(Fa=null,e=ti(e),e!==null){var t=_(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=a(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fa=e,null}function em(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(At()){case ne:return 2;case ye:return 8;case Ae:case Be:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var _u=!1,Vi=null,$i=null,Wi=null,pl=new Map,ml=new Map,Ki=[],W0="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 tm(e,t){switch(e){case"focusin":case"focusout":Vi=null;break;case"dragenter":case"dragleave":$i=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":pl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ml.delete(t.pointerId)}}function gl(e,t,i,l,p,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:w,targetContainers:[p]},t!==null&&(t=bi(t),t!==null&&Zp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function K0(e,t,i,l,p){switch(t){case"focusin":return Vi=gl(Vi,e,t,i,l,p),!0;case"dragenter":return $i=gl($i,e,t,i,l,p),!0;case"mouseover":return Wi=gl(Wi,e,t,i,l,p),!0;case"pointerover":var w=p.pointerId;return pl.set(w,gl(pl.get(w)||null,e,t,i,l,p)),!0;case"gotpointercapture":return w=p.pointerId,ml.set(w,gl(ml.get(w)||null,e,t,i,l,p)),!0}return!1}function nm(e){var t=ti(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,jn(e.priority,function(){Jp(i)});return}}else if(t===31){if(t=a(i),t!==null){e.blockedOn=t,jn(e.priority,function(){Jp(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 qa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=mu(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);$n=l,i.target.dispatchEvent(l),$n=null}else return t=bi(i),t!==null&&Zp(t),e.blockedOn=i,!1;t.shift()}return!0}function im(e,t,i){qa(e)&&i.delete(t)}function Y0(){_u=!1,Vi!==null&&qa(Vi)&&(Vi=null),$i!==null&&qa($i)&&($i=null),Wi!==null&&qa(Wi)&&(Wi=null),pl.forEach(im),ml.forEach(im)}function Ga(e,t){e.blockedOn===t&&(e.blockedOn=null,_u||(_u=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Y0)))}var Va=null;function rm(e){Va!==e&&(Va=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Va===e&&(Va=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],p=e[t+2];if(typeof l!="function"){if(gu(l||i)===null)continue;break}var w=bi(i);w!==null&&(e.splice(t,3),t-=3,mc(w,{pending:!0,data:p,method:i.method,action:l},l,p))}}))}function os(e){function t(Q){return Ga(Q,e)}Vi!==null&&Ga(Vi,e),$i!==null&&Ga($i,e),Wi!==null&&Ga(Wi,e),pl.forEach(t),ml.forEach(t);for(var i=0;i<Ki.length;i++){var l=Ki[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ki.length&&(i=Ki[0],i.blockedOn===null);)nm(i),i.blockedOn===null&&Ki.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var p=i[l],w=i[l+1],B=p[jt]||null;if(typeof w=="function")B||rm(i);else if(B){var P=null;if(w&&w.hasAttribute("formAction")){if(p=w,B=w[jt]||null)P=B.formAction;else if(gu(p)!==null)continue}else P=B.action;typeof P=="function"?i[l+1]=P:(i.splice(l,3),l-=3),rm(i)}}}function sm(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(B){return p=B})},focusReset:"manual",scroll:"manual"})}function t(){p!==null&&(p(),p=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),p!==null&&(p(),p=null)}}}function vu(e){this._internalRoot=e}$a.prototype.render=vu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,l=bn();Xp(i,l,e,t,null,null)},$a.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xp(e.current,2,null,e,null,null),ka(),t[Gn]=null}};function $a(e){this._internalRoot=e}$a.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ss();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ki.length&&t!==0&&t<Ki[i].priority;i++);Ki.splice(i,0,e),i===0&&nm(e)}};var lm=r.version;if(lm!=="19.2.6")throw Error(o(527,lm,"19.2.6"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?g(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 Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{Je=Wa.inject(X0),we=Wa}catch{}}return vl.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,l="",p=dd,w=pd,B=md;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(p=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(B=t.onRecoverableError)),t=Kp(e,1,!1,null,null,i,l,null,p,w,B,sm),e[Gn]=t.current,Jc(e),new vu(t)},vl.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var l=!1,p="",w=dd,B=pd,P=md,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(B=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),t=Kp(e,1,!0,t,i??null,l,p,Q,w,B,P,sm),t.context=Yp(null),i=t.current,l=bn(),l=Ar(l),p=Oi(l),p.callback=null,Bi(i,p,l),i=l,t.current.lanes=i,qn(t,i),Xn(t),e[Gn]=t.current,Jc(e),new $a(t)},vl.version="19.2.6",vl}var _m;function o1(){if(_m)return bu.exports;_m=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(),bu.exports=a1(),bu.exports}var c1=o1();const gs=function(n,r){let d=n;const _=wl[r];let f=null,a=0,c=null;const h=[],g={},u=function(D,E){a=d*4+17,f=(function(L){const O=new Array(L);for(let I=0;I<L;I+=1){O[I]=new Array(L);for(let F=0;F<L;F+=1)O[I][F]=null}return O})(a),b(0,0),b(a-7,0),b(0,a-7),x(),A(),v(D,E),d>=7&&y(D),c==null&&(c=k(d,_,h)),m(c,E)},b=function(D,E){for(let L=-1;L<=7;L+=1)if(!(D+L<=-1||a<=D+L))for(let O=-1;O<=7;O+=1)E+O<=-1||a<=E+O||(0<=L&&L<=6&&(O==0||O==6)||0<=O&&O<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=O&&O<=4?f[D+L][E+O]=!0:f[D+L][E+O]=!1)},C=function(){let D=0,E=0;for(let L=0;L<8;L+=1){u(!0,L);const O=Qi.getLostPoint(g);(L==0||D>O)&&(D=O,E=L)}return E},A=function(){for(let D=8;D<a-8;D+=1)f[D][6]==null&&(f[D][6]=D%2==0);for(let D=8;D<a-8;D+=1)f[6][D]==null&&(f[6][D]=D%2==0)},x=function(){const D=Qi.getPatternPosition(d);for(let E=0;E<D.length;E+=1)for(let L=0;L<D.length;L+=1){const O=D[E],I=D[L];if(f[O][I]==null)for(let F=-2;F<=2;F+=1)for(let U=-2;U<=2;U+=1)F==-2||F==2||U==-2||U==2||F==0&&U==0?f[O+F][I+U]=!0:f[O+F][I+U]=!1}},y=function(D){const E=Qi.getBCHTypeNumber(d);for(let L=0;L<18;L+=1){const O=!D&&(E>>L&1)==1;f[Math.floor(L/3)][L%3+a-8-3]=O}for(let L=0;L<18;L+=1){const O=!D&&(E>>L&1)==1;f[L%3+a-8-3][Math.floor(L/3)]=O}},v=function(D,E){const L=_<<3|E,O=Qi.getBCHTypeInfo(L);for(let I=0;I<15;I+=1){const F=!D&&(O>>I&1)==1;I<6?f[I][8]=F:I<8?f[I+1][8]=F:f[a-15+I][8]=F}for(let I=0;I<15;I+=1){const F=!D&&(O>>I&1)==1;I<8?f[8][a-I-1]=F:I<9?f[8][15-I-1+1]=F:f[8][15-I-1]=F}f[a-8][8]=!D},m=function(D,E){let L=-1,O=a-1,I=7,F=0;const U=Qi.getMaskFunction(E);for(let W=a-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let Y=0;Y<2;Y+=1)if(f[O][W-Y]==null){let V=!1;F<D.length&&(V=(D[F]>>>I&1)==1),U(O,W-Y)&&(V=!V),f[O][W-Y]=V,I-=1,I==-1&&(F+=1,I=7)}if(O+=L,O<0||a<=O){O-=L,L=-L;break}}},S=function(D,E){let L=0,O=0,I=0;const F=new Array(E.length),U=new Array(E.length);for(let K=0;K<E.length;K+=1){const J=E[K].dataCount,z=E[K].totalCount-J;O=Math.max(O,J),I=Math.max(I,z),F[K]=new Array(J);for(let N=0;N<F[K].length;N+=1)F[K][N]=255&D.getBuffer()[N+L];L+=J;const j=Qi.getErrorCorrectPolynomial(z),G=Al(F[K],j.getLength()-1).mod(j);U[K]=new Array(j.getLength()-1);for(let N=0;N<U[K].length;N+=1){const Z=N+G.getLength()-U[K].length;U[K][N]=Z>=0?G.getAt(Z):0}}let W=0;for(let K=0;K<E.length;K+=1)W+=E[K].totalCount;const Y=new Array(W);let V=0;for(let K=0;K<O;K+=1)for(let J=0;J<E.length;J+=1)K<F[J].length&&(Y[V]=F[J][K],V+=1);for(let K=0;K<I;K+=1)for(let J=0;J<E.length;J+=1)K<U[J].length&&(Y[V]=U[J][K],V+=1);return Y},k=function(D,E,L){const O=vm.getRSBlocks(D,E),I=ym();for(let U=0;U<L.length;U+=1){const W=L[U];I.put(W.getMode(),4),I.put(W.getLength(),Qi.getLengthInBits(W.getMode(),D)),W.write(I)}let F=0;for(let U=0;U<O.length;U+=1)F+=O[U].dataCount;if(I.getLengthInBits()>F*8)throw"code length overflow. ("+I.getLengthInBits()+">"+F*8+")";for(I.getLengthInBits()+4<=F*8&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=F*8||(I.put(236,8),I.getLengthInBits()>=F*8));)I.put(17,8);return S(I,O)};g.addData=function(D,E){E=E||"Byte";let L=null;switch(E){case"Numeric":L=u1(D);break;case"Alphanumeric":L=h1(D);break;case"Byte":L=f1(D);break;case"Kanji":L=d1(D);break;default:throw"mode:"+E}h.push(L),c=null},g.isDark=function(D,E){if(D<0||a<=D||E<0||a<=E)throw D+","+E;return f[D][E]},g.getModuleCount=function(){return a},g.make=function(){if(d<1){let D=1;for(;D<40;D++){const E=vm.getRSBlocks(D,_),L=ym();for(let I=0;I<h.length;I++){const F=h[I];L.put(F.getMode(),4),L.put(F.getLength(),Qi.getLengthInBits(F.getMode(),D)),F.write(L)}let O=0;for(let I=0;I<E.length;I++)O+=E[I].dataCount;if(L.getLengthInBits()<=O*8)break}d=D}u(!1,C())},g.createTableTag=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;let L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+E+"px;",L+='">',L+="<tbody>";for(let O=0;O<g.getModuleCount();O+=1){L+="<tr>";for(let I=0;I<g.getModuleCount();I+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+D+"px;",L+=" height: "+D+"px;",L+=" background-color: ",L+=g.isDark(O,I)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},g.createSvgTag=function(D,E,L,O){let I={};typeof arguments[0]=="object"&&(I=arguments[0],D=I.cellSize,E=I.margin,L=I.alt,O=I.title),D=D||2,E=typeof E>"u"?D*4:E,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-description":null,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-title":null;const F=g.getModuleCount()*D+E*2;let U,W,Y,V,K="",J;for(J="l"+D+",0 0,"+D+" -"+D+",0 0,-"+D+"z ",K+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',K+=I.scalable?"":' width="'+F+'px" height="'+F+'px"',K+=' viewBox="0 0 '+F+" "+F+'" ',K+=' preserveAspectRatio="xMinYMin meet"',K+=O.text||L.text?' role="img" aria-labelledby="'+M([O.id,L.id].join(" ").trim())+'"':"",K+=">",K+=O.text?'<title id="'+M(O.id)+'">'+M(O.text)+"</title>":"",K+=L.text?'<description id="'+M(L.id)+'">'+M(L.text)+"</description>":"",K+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',K+='<path d="',Y=0;Y<g.getModuleCount();Y+=1)for(V=Y*D+E,U=0;U<g.getModuleCount();U+=1)g.isDark(Y,U)&&(W=U*D+E,K+="M"+W+","+V+J);return K+='" stroke="transparent" fill="black"/>',K+="</svg>",K},g.createDataURL=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;const L=g.getModuleCount()*D+E*2,O=E,I=L-E;return _1(L,L,function(F,U){if(O<=F&&F<I&&O<=U&&U<I){const W=Math.floor((F-O)/D),Y=Math.floor((U-O)/D);return g.isDark(Y,W)?0:1}else return 1})},g.createImgTag=function(D,E,L){D=D||2,E=typeof E>"u"?D*4:E;const O=g.getModuleCount()*D+E*2;let I="";return I+="<img",I+=' src="',I+=g.createDataURL(D,E),I+='"',I+=' width="',I+=O,I+='"',I+=' height="',I+=O,I+='"',L&&(I+=' alt="',I+=M(L),I+='"'),I+="/>",I};const M=function(D){let E="";for(let L=0;L<D.length;L+=1){const O=D.charAt(L);switch(O){case"<":E+="&lt;";break;case">":E+="&gt;";break;case"&":E+="&amp;";break;case'"':E+="&quot;";break;default:E+=O;break}}return E},R=function(D){D=typeof D>"u"?2:D;const L=g.getModuleCount()*1+D*2,O=D,I=L-D;let F,U,W,Y,V;const K={"██":"█","█ ":"▀"," █":"▄"," ":" "},J={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(F=0;F<L;F+=2){for(W=Math.floor((F-O)/1),Y=Math.floor((F+1-O)/1),U=0;U<L;U+=1)V="█",O<=U&&U<I&&O<=F&&F<I&&g.isDark(W,Math.floor((U-O)/1))&&(V=" "),O<=U&&U<I&&O<=F+1&&F+1<I&&g.isDark(Y,Math.floor((U-O)/1))?V+=" ":V+="█",z+=D<1&&F+1>=I?J[V]:K[V];z+=`
50
50
  `}return L%2&&D>0?z.substring(0,z.length-L-1)+Array(L+1).join("▀"):z.substring(0,z.length-1)};return g.createASCII=function(D,E){if(D=D||1,D<2)return R(E);D-=1,E=typeof E>"u"?D*2:E;const L=g.getModuleCount()*D+E*2,O=E,I=L-E;let F,U,W,Y;const V=Array(D+1).join("██"),K=Array(D+1).join(" ");let J="",z="";for(F=0;F<L;F+=1){for(W=Math.floor((F-O)/D),z="",U=0;U<L;U+=1)Y=1,O<=U&&U<I&&O<=F&&F<I&&g.isDark(W,Math.floor((U-O)/D))&&(Y=0),z+=Y?V:K;for(W=0;W<D;W+=1)J+=z+`
51
- `}return J.substring(0,J.length-1)},g.renderTo2dContext=function(D,E){E=E||2;const L=g.getModuleCount();for(let O=0;O<L;O++)for(let I=0;I<L;I++)D.fillStyle=g.isDark(O,I)?"black":"white",D.fillRect(I*E,O*E,E,E)},g};gs.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};gs.createStringToBytes=function(n,r){const s=(function(){const d=m1(n),_=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const a={};for(;;){const c=d.read();if(c==-1)break;const h=_(),g=_(),u=_(),b=String.fromCharCode(c<<8|h),C=g<<8|u;a[b]=C,f+=1}if(f!=r)throw f+" != "+r;return a})(),o=63;return function(d){const _=[];for(let f=0;f<d.length;f+=1){const a=d.charCodeAt(f);if(a<128)_.push(a);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?_.push(c):(_.push(c>>>8),_.push(c&255)):_.push(o)}}return _}};const Vt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Cl={L:1,M:0,Q:3,H:2},Zi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ji=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,o=21522,d={},_=function(f){let a=0;for(;f!=0;)a+=1,f>>>=1;return a};return d.getBCHTypeInfo=function(f){let a=f<<10;for(;_(a)-_(r)>=0;)a^=r<<_(a)-_(r);return(f<<10|a)^o},d.getBCHTypeNumber=function(f){let a=f<<12;for(;_(a)-_(s)>=0;)a^=s<<_(a)-_(s);return f<<12|a},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case Zi.PATTERN000:return function(a,c){return(a+c)%2==0};case Zi.PATTERN001:return function(a,c){return a%2==0};case Zi.PATTERN010:return function(a,c){return c%3==0};case Zi.PATTERN011:return function(a,c){return(a+c)%3==0};case Zi.PATTERN100:return function(a,c){return(Math.floor(a/2)+Math.floor(c/3))%2==0};case Zi.PATTERN101:return function(a,c){return a*c%2+a*c%3==0};case Zi.PATTERN110:return function(a,c){return(a*c%2+a*c%3)%2==0};case Zi.PATTERN111:return function(a,c){return(a*c%3+(a+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let a=kl([1],0);for(let c=0;c<f;c+=1)a=a.multiply(kl([1,tr.gexp(c)],0));return a},d.getLengthInBits=function(f,a){if(1<=a&&a<10)switch(f){case Vt.MODE_NUMBER:return 10;case Vt.MODE_ALPHA_NUM:return 9;case Vt.MODE_8BIT_BYTE:return 8;case Vt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(a<27)switch(f){case Vt.MODE_NUMBER:return 12;case Vt.MODE_ALPHA_NUM:return 11;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(a<41)switch(f){case Vt.MODE_NUMBER:return 14;case Vt.MODE_ALPHA_NUM:return 13;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+a},d.getLostPoint=function(f){const a=f.getModuleCount();let c=0;for(let u=0;u<a;u+=1)for(let b=0;b<a;b+=1){let C=0;const A=f.isDark(u,b);for(let x=-1;x<=1;x+=1)if(!(u+x<0||a<=u+x))for(let y=-1;y<=1;y+=1)b+y<0||a<=b+y||x==0&&y==0||A==f.isDark(u+x,b+y)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<a-1;u+=1)for(let b=0;b<a-1;b+=1){let C=0;f.isDark(u,b)&&(C+=1),f.isDark(u+1,b)&&(C+=1),f.isDark(u,b+1)&&(C+=1),f.isDark(u+1,b+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<a;u+=1)for(let b=0;b<a-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<a;u+=1)for(let b=0;b<a-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<a;u+=1)for(let b=0;b<a;b+=1)f.isDark(b,u)&&(h+=1);const g=Math.abs(100*h/a/a-50)/5;return c+=g*10,c},d})(),tr=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),kl=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const _=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)_[f]=n[f+d];return _})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const _=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let a=0;a<d.getLength();a+=1)_[f+a]^=tr.gexp(tr.glog(o.getAt(f))+tr.glog(d.getAt(a)));return kl(_,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const _=tr.glog(o.getAt(0))-tr.glog(d.getAt(0)),f=new Array(o.getLength());for(let a=0;a<o.getLength();a+=1)f[a]=o.getAt(a);for(let a=0;a<d.getLength();a+=1)f[a]^=tr.gexp(tr.glog(d.getAt(a))+_);return kl(f,0).mod(d)},o},vm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,_){const f={};return f.totalCount=d,f.dataCount=_,f},s={},o=function(d,_){switch(_){case Cl.L:return n[(d-1)*4+0];case Cl.M:return n[(d-1)*4+1];case Cl.Q:return n[(d-1)*4+2];case Cl.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,_){const f=o(d,_);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+_;const a=f.length/3,c=[];for(let h=0;h<a;h+=1){const g=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let C=0;C<g;C+=1)c.push(r(u,b))}return c},s})(),ym=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let _=0;_<d;_+=1)s.putBit((o>>>d-_-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},u1=function(n){const r=Vt.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const a=s;let c=0;for(;c+2<a.length;)f.put(d(a.substring(c,c+3)),10),c+=3;c<a.length&&(a.length-c==1?f.put(d(a.substring(c,c+1)),4):a.length-c==2&&f.put(d(a.substring(c,c+2)),7))};const d=function(f){let a=0;for(let c=0;c<f.length;c+=1)a=a*10+_(f.charAt(c));return a},_=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},h1=function(n){const r=Vt.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(_){return s.length},o.write=function(_){const f=s;let a=0;for(;a+1<f.length;)_.put(d(f.charAt(a))*45+d(f.charAt(a+1)),11),a+=2;a<f.length&&_.put(d(f.charAt(a)),6)};const d=function(_){if("0"<=_&&_<="9")return _.charCodeAt(0)-48;if("A"<=_&&_<="Z")return _.charCodeAt(0)-65+10;switch(_){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+_}};return o},f1=function(n){const r=Vt.MODE_8BIT_BYTE,s=gs.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let _=0;_<s.length;_+=1)d.put(s[_],8)},o},d1=function(n){const r=Vt.MODE_KANJI,s=gs.stringToBytes;(function(_,f){const a=s(_);if(a.length!=2||(a[0]<<8|a[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(_){return~~(o.length/2)},d.write=function(_){const f=o;let a=0;for(;a+1<f.length;){let c=(255&f[a])<<8|255&f[a+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(a+1)+"/"+c;c=(c>>>8&255)*192+(c&255),_.put(c,13),a+=2}if(a<f.length)throw"illegal char at "+(a+1)},d},Rg=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,o,d){o=o||0,d=d||s.length;for(let _=0;_<d;_+=1)r.writeByte(s[_+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},p1=function(){let n=0,r=0,s=0,o="";const d={},_=function(a){o+=String.fromCharCode(f(a&63))},f=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return d.writeByte=function(a){for(n=n<<8|a&255,r+=8,s+=1;r>=6;)_(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(_(n<<6-r),n=0,r=0),s%3!=0){const a=3-s%3;for(let c=0;c<a;c+=1)o+="="}},d.toString=function(){return o},d},m1=function(n){const r=n;let s=0,o=0,d=0;const _={};_.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;o=o<<6|f(c.charCodeAt(0)),d+=6}const a=o>>>d-8&255;return d-=8,a};const f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return _},g1=function(n,r){const s=n,o=r,d=new Array(n*r),_={};_.setPixel=function(h,g,u){d[g*s+h]=u},_.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(o),h.writeByte(0);const g=2,u=a(g);h.writeByte(g);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 g=h;let u=0,b=0;const C={};return C.write=function(A,x){if(A>>>x)throw"length over";for(;u+x>=8;)g.writeByte(255&(A<<u|b)),x-=8-u,A>>>=8-u,b=0,u=0;b=A<<u|b,u=u+x},C.flush=function(){u>0&&g.writeByte(b)},C},a=function(h){const g=1<<h,u=(1<<h)+1;let b=h+1;const C=c();for(let m=0;m<g;m+=1)C.add(String.fromCharCode(m));C.add(String.fromCharCode(g)),C.add(String.fromCharCode(u));const A=Rg(),x=f(A);x.write(g,b);let y=0,v=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const m=String.fromCharCode(d[y]);y+=1,C.contains(v+m)?v=v+m:(x.write(C.indexOf(v),b),C.size()<4095&&(C.size()==1<<b&&(b+=1),C.add(v+m)),v=m)}return x.write(C.indexOf(v),b),x.write(u,b),x.flush(),A.toByteArray()},c=function(){const h={};let g=0;const u={};return u.add=function(b){if(u.contains(b))throw"dup key:"+b;h[b]=g,g+=1},u.size=function(){return g},u.indexOf=function(b){return h[b]},u.contains=function(b){return typeof h[b]<"u"},u};return _},_1=function(n,r,s){const o=g1(n,r);for(let a=0;a<r;a+=1)for(let c=0;c<n;c+=1)o.setPixel(c,a,s(c,a));const d=Rg();o.write(d);const _=p1(),f=d.toByteArray();for(let a=0;a<f.length;a+=1)_.writeByte(f[a]);return _.flush(),"data:image/gif;base64,"+_};gs.stringToBytes;const ps=[{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}],Dg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},sh=[...ps,Dg],v1={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},y1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},Mg=[v1,y1],lh=[...sh,...Mg],S1=ps.map(n=>n.name),Lg=sh.map(n=>n.name);Mg.map(n=>n.name);lh.map(n=>n.name);lh.filter(n=>n.dispatchable).map(n=>n.name);function b1(n){return Lg.includes(n)}const C1="zh-CN",w1="pm-final-only",Og=[{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"}],x1=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function E1(){const n={};for(const r of Lg)n[r]={permissionMode:"default",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function k1({sidebar:n,children:r}){const[s,o]=ne.useState(!1);return T.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[T.jsxs("aside",{className:"app-sidebar",children:[T.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),T.jsx("div",{className:"sidebar-content",children:n})]}),T.jsx("main",{className:"app-main",children:r})]})}const Se={getAppPreferences(){return we("/api/settings/preferences")},updateAppPreferences(n){return we("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return we("/api/diagnostics/runtime")},getCurrentProject(){return we("/api/projects/current")},pullCurrentProject(){return we("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return we("/api/projects/recent")},connectProject(n){return we("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return we("/api/tasks")},createTask(n){return we("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return we(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return we(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return we("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return we(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const o=new URLSearchParams({path:r,taskSlug:n});return we(`/api/projects/harness/file?${o.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),we(`/api/projects/harness/repository-diff?${s.toString()}`)},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return we(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return we("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return we("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return we("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return we("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return we("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return we("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return we("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getTaskStatus(n){return we(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return we(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return we(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return we(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),we(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return we("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return we(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return we("/api/translation/state")},getTranslatorSession(){return we("/api/translation/session")},ensureTranslatorSession(n={}){return we("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return we("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return we("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return we("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return we("/api/translation/session/stop",{method:"POST"})},browseTranslationSourceFiles(n={}){const r=new URLSearchParams;n.path&&r.set("path",n.path),n.query&&r.set("query",n.query),n.limit!==void 0&&r.set("limit",String(n.limit));const s=r.toString()?`?${r.toString()}`:"";return we(`/api/translation/source-files${s}`)},createFileTranslation(n){return we("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return we(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return we("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return we("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return we(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return we("/api/gateway/status")},updateGatewaySettings(n){return we("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return we("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return we("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return we("/api/gateway/binding/reset",{method:"POST"})}};async function we(n,r={}){var d,_,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const a=await o.json().catch(()=>null),c=(d=a==null?void 0:a.error)!=null&&d.hint?`${a.error.message} ${a.error.hint}`:((_=a==null?void 0:a.error)==null?void 0:_.message)??`Request failed: ${o.status}`,h=(f=a==null?void 0:a.error)==null?void 0:f.runtime,g=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${g}`)}return o.json()}var Eu={exports:{}},Sm;function A1(){return Sm||(Sm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const _=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(_._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,_=d._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),b=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(b/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),s})()))})(Eu)),Eu.exports}var T1=A1(),ku={exports:{}},bm;function R1(){return bm||(bm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(g){try{const u=new URL(g),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 g.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,u,b,C={}){this._terminal=g,this._regex=u,this._handler=b,this._options=C}provideLinks(g,u){const b=h.computeLink(g,this._regex,this._terminal,this._handler);u(this._addCallbacks(b))}_addCallbacks(g){return g.map((u=>(u.leave=this._options.leave,u.hover=(b,C)=>{if(this._options.hover){const{range:A}=u;this._options.hover(b,C,A)}},u)))}};class h{static computeLink(u,b,C,A){const x=new RegExp(b.source,(b.flags||"")+"g"),[y,v]=h._getWindowedLineStrings(u-1,C),m=y.join("");let S;const k=[];for(;S=x.exec(m);){const M=S[0];if(!c(M))continue;const[R,D]=h._mapStrIdx(C,v,0,S.index),[E,L]=h._mapStrIdx(C,R,D,M.length);if(R===-1||D===-1||E===-1||L===-1)continue;const O={start:{x:D+1,y:R+1},end:{x:L,y:E+1}};k.push({range:O,text:M,activate:A})}return k}static _getWindowedLineStrings(u,b){let C,A=u,x=u,y=0,v="";const m=[];if(C=b.buffer.active.getLine(u)){const S=C.translateToString(!0);if(C.isWrapped&&S[0]!==" "){for(y=0;(C=b.buffer.active.getLine(--A))&&y<2048&&(v=C.translateToString(!0),y+=v.length,m.push(v),C.isWrapped&&v.indexOf(" ")===-1););m.reverse()}for(m.push(S),y=0;(C=b.buffer.active.getLine(++x))&&C.isWrapped&&y<2048&&(v=C.translateToString(!0),y+=v.length,m.push(v),v.indexOf(" ")===-1););}return[m,A]}static _mapStrIdx(u,b,C,A){const x=u.buffer.active,y=x.getNullCell();let v=C;for(;A;){const m=x.getLine(b);if(!m)return[-1,-1];for(let S=v;S<m.length;++S){m.getCell(S,y);const k=y.getChars();if(y.getWidth()&&(A-=k.length||1,S===m.length-1&&k==="")){const M=x.getLine(b+1);M&&M.isWrapped&&(M.getCell(0,y),y.getWidth()===2&&(A+=1))}if(A<0)return[b,S]}b++,v=0}return[b,v]}}a.LinkComputer=h}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(g,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(g=h,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,b=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),_})()))})(ku)),ku.exports}var D1=R1(),Au={exports:{}},Cm;function M1(){return Cm||(Cm=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),b=c(9924),C=c(844),A=c(4725),x=c(2585),y=c(3656);let v=a.AccessibilityManager=class extends C.Disposable{constructor(m,S,k,M){super(),this._terminal=m,this._coreBrowserService=k,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new 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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
51
+ `}return J.substring(0,J.length-1)},g.renderTo2dContext=function(D,E){E=E||2;const L=g.getModuleCount();for(let O=0;O<L;O++)for(let I=0;I<L;I++)D.fillStyle=g.isDark(O,I)?"black":"white",D.fillRect(I*E,O*E,E,E)},g};gs.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};gs.createStringToBytes=function(n,r){const s=(function(){const d=m1(n),_=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const a={};for(;;){const c=d.read();if(c==-1)break;const h=_(),g=_(),u=_(),b=String.fromCharCode(c<<8|h),C=g<<8|u;a[b]=C,f+=1}if(f!=r)throw f+" != "+r;return a})(),o=63;return function(d){const _=[];for(let f=0;f<d.length;f+=1){const a=d.charCodeAt(f);if(a<128)_.push(a);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?_.push(c):(_.push(c>>>8),_.push(c&255)):_.push(o)}}return _}};const Vt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},wl={L:1,M:0,Q:3,H:2},Xi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Qi=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,o=21522,d={},_=function(f){let a=0;for(;f!=0;)a+=1,f>>>=1;return a};return d.getBCHTypeInfo=function(f){let a=f<<10;for(;_(a)-_(r)>=0;)a^=r<<_(a)-_(r);return(f<<10|a)^o},d.getBCHTypeNumber=function(f){let a=f<<12;for(;_(a)-_(s)>=0;)a^=s<<_(a)-_(s);return f<<12|a},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case Xi.PATTERN000:return function(a,c){return(a+c)%2==0};case Xi.PATTERN001:return function(a,c){return a%2==0};case Xi.PATTERN010:return function(a,c){return c%3==0};case Xi.PATTERN011:return function(a,c){return(a+c)%3==0};case Xi.PATTERN100:return function(a,c){return(Math.floor(a/2)+Math.floor(c/3))%2==0};case Xi.PATTERN101:return function(a,c){return a*c%2+a*c%3==0};case Xi.PATTERN110:return function(a,c){return(a*c%2+a*c%3)%2==0};case Xi.PATTERN111:return function(a,c){return(a*c%3+(a+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let a=Al([1],0);for(let c=0;c<f;c+=1)a=a.multiply(Al([1,Ji.gexp(c)],0));return a},d.getLengthInBits=function(f,a){if(1<=a&&a<10)switch(f){case Vt.MODE_NUMBER:return 10;case Vt.MODE_ALPHA_NUM:return 9;case Vt.MODE_8BIT_BYTE:return 8;case Vt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(a<27)switch(f){case Vt.MODE_NUMBER:return 12;case Vt.MODE_ALPHA_NUM:return 11;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(a<41)switch(f){case Vt.MODE_NUMBER:return 14;case Vt.MODE_ALPHA_NUM:return 13;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+a},d.getLostPoint=function(f){const a=f.getModuleCount();let c=0;for(let u=0;u<a;u+=1)for(let b=0;b<a;b+=1){let C=0;const A=f.isDark(u,b);for(let x=-1;x<=1;x+=1)if(!(u+x<0||a<=u+x))for(let y=-1;y<=1;y+=1)b+y<0||a<=b+y||x==0&&y==0||A==f.isDark(u+x,b+y)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<a-1;u+=1)for(let b=0;b<a-1;b+=1){let C=0;f.isDark(u,b)&&(C+=1),f.isDark(u+1,b)&&(C+=1),f.isDark(u,b+1)&&(C+=1),f.isDark(u+1,b+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<a;u+=1)for(let b=0;b<a-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<a;u+=1)for(let b=0;b<a-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<a;u+=1)for(let b=0;b<a;b+=1)f.isDark(b,u)&&(h+=1);const g=Math.abs(100*h/a/a-50)/5;return c+=g*10,c},d})(),Ji=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),Al=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const _=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)_[f]=n[f+d];return _})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const _=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let a=0;a<d.getLength();a+=1)_[f+a]^=Ji.gexp(Ji.glog(o.getAt(f))+Ji.glog(d.getAt(a)));return Al(_,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const _=Ji.glog(o.getAt(0))-Ji.glog(d.getAt(0)),f=new Array(o.getLength());for(let a=0;a<o.getLength();a+=1)f[a]=o.getAt(a);for(let a=0;a<d.getLength();a+=1)f[a]^=Ji.gexp(Ji.glog(d.getAt(a))+_);return Al(f,0).mod(d)},o},vm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,_){const f={};return f.totalCount=d,f.dataCount=_,f},s={},o=function(d,_){switch(_){case wl.L:return n[(d-1)*4+0];case wl.M:return n[(d-1)*4+1];case wl.Q:return n[(d-1)*4+2];case wl.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,_){const f=o(d,_);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+_;const a=f.length/3,c=[];for(let h=0;h<a;h+=1){const g=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let C=0;C<g;C+=1)c.push(r(u,b))}return c},s})(),ym=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let _=0;_<d;_+=1)s.putBit((o>>>d-_-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},u1=function(n){const r=Vt.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const a=s;let c=0;for(;c+2<a.length;)f.put(d(a.substring(c,c+3)),10),c+=3;c<a.length&&(a.length-c==1?f.put(d(a.substring(c,c+1)),4):a.length-c==2&&f.put(d(a.substring(c,c+2)),7))};const d=function(f){let a=0;for(let c=0;c<f.length;c+=1)a=a*10+_(f.charAt(c));return a},_=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},h1=function(n){const r=Vt.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(_){return s.length},o.write=function(_){const f=s;let a=0;for(;a+1<f.length;)_.put(d(f.charAt(a))*45+d(f.charAt(a+1)),11),a+=2;a<f.length&&_.put(d(f.charAt(a)),6)};const d=function(_){if("0"<=_&&_<="9")return _.charCodeAt(0)-48;if("A"<=_&&_<="Z")return _.charCodeAt(0)-65+10;switch(_){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+_}};return o},f1=function(n){const r=Vt.MODE_8BIT_BYTE,s=gs.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let _=0;_<s.length;_+=1)d.put(s[_],8)},o},d1=function(n){const r=Vt.MODE_KANJI,s=gs.stringToBytes;(function(_,f){const a=s(_);if(a.length!=2||(a[0]<<8|a[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(_){return~~(o.length/2)},d.write=function(_){const f=o;let a=0;for(;a+1<f.length;){let c=(255&f[a])<<8|255&f[a+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(a+1)+"/"+c;c=(c>>>8&255)*192+(c&255),_.put(c,13),a+=2}if(a<f.length)throw"illegal char at "+(a+1)},d},Rg=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,o,d){o=o||0,d=d||s.length;for(let _=0;_<d;_+=1)r.writeByte(s[_+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},p1=function(){let n=0,r=0,s=0,o="";const d={},_=function(a){o+=String.fromCharCode(f(a&63))},f=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return d.writeByte=function(a){for(n=n<<8|a&255,r+=8,s+=1;r>=6;)_(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(_(n<<6-r),n=0,r=0),s%3!=0){const a=3-s%3;for(let c=0;c<a;c+=1)o+="="}},d.toString=function(){return o},d},m1=function(n){const r=n;let s=0,o=0,d=0;const _={};_.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;o=o<<6|f(c.charCodeAt(0)),d+=6}const a=o>>>d-8&255;return d-=8,a};const f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return _},g1=function(n,r){const s=n,o=r,d=new Array(n*r),_={};_.setPixel=function(h,g,u){d[g*s+h]=u},_.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(o),h.writeByte(0);const g=2,u=a(g);h.writeByte(g);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 g=h;let u=0,b=0;const C={};return C.write=function(A,x){if(A>>>x)throw"length over";for(;u+x>=8;)g.writeByte(255&(A<<u|b)),x-=8-u,A>>>=8-u,b=0,u=0;b=A<<u|b,u=u+x},C.flush=function(){u>0&&g.writeByte(b)},C},a=function(h){const g=1<<h,u=(1<<h)+1;let b=h+1;const C=c();for(let m=0;m<g;m+=1)C.add(String.fromCharCode(m));C.add(String.fromCharCode(g)),C.add(String.fromCharCode(u));const A=Rg(),x=f(A);x.write(g,b);let y=0,v=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const m=String.fromCharCode(d[y]);y+=1,C.contains(v+m)?v=v+m:(x.write(C.indexOf(v),b),C.size()<4095&&(C.size()==1<<b&&(b+=1),C.add(v+m)),v=m)}return x.write(C.indexOf(v),b),x.write(u,b),x.flush(),A.toByteArray()},c=function(){const h={};let g=0;const u={};return u.add=function(b){if(u.contains(b))throw"dup key:"+b;h[b]=g,g+=1},u.size=function(){return g},u.indexOf=function(b){return h[b]},u.contains=function(b){return typeof h[b]<"u"},u};return _},_1=function(n,r,s){const o=g1(n,r);for(let a=0;a<r;a+=1)for(let c=0;c<n;c+=1)o.setPixel(c,a,s(c,a));const d=Rg();o.write(d);const _=p1(),f=d.toByteArray();for(let a=0;a<f.length;a+=1)_.writeByte(f[a]);return _.flush(),"data:image/gif;base64,"+_};gs.stringToBytes;const ps=[{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}],Dg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},sh=[...ps,Dg],v1={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},y1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},Mg=[v1,y1],lh=[...sh,...Mg],S1=ps.map(n=>n.name),Lg=sh.map(n=>n.name);Mg.map(n=>n.name);lh.map(n=>n.name);lh.filter(n=>n.dispatchable).map(n=>n.name);function b1(n){return Lg.includes(n)}const C1="zh-CN",w1="pm-final-only",Og=[{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"}],x1=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function E1(){const n={};for(const r of Lg)n[r]={permissionMode:"default",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function k1({sidebar:n,children:r}){const[s,o]=ie.useState(!1);return T.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[T.jsxs("aside",{className:"app-sidebar",children:[T.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),T.jsx("div",{className:"sidebar-content",children:n})]}),T.jsx("main",{className:"app-main",children:r})]})}const Se={getAppPreferences(){return xe("/api/settings/preferences")},updateAppPreferences(n){return xe("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return xe("/api/diagnostics/runtime")},getCurrentProject(){return xe("/api/projects/current")},pullCurrentProject(){return xe("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return xe("/api/projects/recent")},connectProject(n){return xe("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return xe("/api/tasks")},createTask(n){return xe("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return xe(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return xe(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return xe("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return xe(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const o=new URLSearchParams({path:r,taskSlug:n});return xe(`/api/projects/harness/file?${o.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),xe(`/api/projects/harness/repository-diff?${s.toString()}`)},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return xe(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return xe("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return xe("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return xe("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return xe("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return xe("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return xe("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return xe("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return xe("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return xe("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return xe("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return xe("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getTaskStatus(n){return xe(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return xe(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return xe(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return xe(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return xe(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return xe(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),xe(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return xe(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return xe(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return xe(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return xe("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return xe(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return xe(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return xe(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return xe("/api/translation/state")},getTranslatorSession(){return xe("/api/translation/session")},ensureTranslatorSession(n={}){return xe("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return xe("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return xe("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return xe("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return xe("/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 xe(`/api/translation/source-files${s}`)},createFileTranslation(n){return xe("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return xe(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return xe("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return xe("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return xe(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return xe("/api/gateway/status")},updateGatewaySettings(n){return xe("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return xe("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return xe("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return xe("/api/gateway/binding/reset",{method:"POST"})}};async function xe(n,r={}){var d,_,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const a=await o.json().catch(()=>null),c=(d=a==null?void 0:a.error)!=null&&d.hint?`${a.error.message} ${a.error.hint}`:((_=a==null?void 0:a.error)==null?void 0:_.message)??`Request failed: ${o.status}`,h=(f=a==null?void 0:a.error)==null?void 0:f.runtime,g=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${g}`)}return o.json()}var Eu={exports:{}},Sm;function A1(){return Sm||(Sm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const _=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(_._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,_=d._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),b=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(b/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),s})()))})(Eu)),Eu.exports}var T1=A1(),ku={exports:{}},bm;function R1(){return bm||(bm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(g){try{const u=new URL(g),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 g.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,u,b,C={}){this._terminal=g,this._regex=u,this._handler=b,this._options=C}provideLinks(g,u){const b=h.computeLink(g,this._regex,this._terminal,this._handler);u(this._addCallbacks(b))}_addCallbacks(g){return g.map((u=>(u.leave=this._options.leave,u.hover=(b,C)=>{if(this._options.hover){const{range:A}=u;this._options.hover(b,C,A)}},u)))}};class h{static computeLink(u,b,C,A){const x=new RegExp(b.source,(b.flags||"")+"g"),[y,v]=h._getWindowedLineStrings(u-1,C),m=y.join("");let S;const k=[];for(;S=x.exec(m);){const M=S[0];if(!c(M))continue;const[R,D]=h._mapStrIdx(C,v,0,S.index),[E,L]=h._mapStrIdx(C,R,D,M.length);if(R===-1||D===-1||E===-1||L===-1)continue;const O={start:{x:D+1,y:R+1},end:{x:L,y:E+1}};k.push({range:O,text:M,activate:A})}return k}static _getWindowedLineStrings(u,b){let C,A=u,x=u,y=0,v="";const m=[];if(C=b.buffer.active.getLine(u)){const S=C.translateToString(!0);if(C.isWrapped&&S[0]!==" "){for(y=0;(C=b.buffer.active.getLine(--A))&&y<2048&&(v=C.translateToString(!0),y+=v.length,m.push(v),C.isWrapped&&v.indexOf(" ")===-1););m.reverse()}for(m.push(S),y=0;(C=b.buffer.active.getLine(++x))&&C.isWrapped&&y<2048&&(v=C.translateToString(!0),y+=v.length,m.push(v),v.indexOf(" ")===-1););}return[m,A]}static _mapStrIdx(u,b,C,A){const x=u.buffer.active,y=x.getNullCell();let v=C;for(;A;){const m=x.getLine(b);if(!m)return[-1,-1];for(let S=v;S<m.length;++S){m.getCell(S,y);const k=y.getChars();if(y.getWidth()&&(A-=k.length||1,S===m.length-1&&k==="")){const M=x.getLine(b+1);M&&M.isWrapped&&(M.getCell(0,y),y.getWidth()===2&&(A+=1))}if(A<0)return[b,S]}b++,v=0}return[b,v]}}a.LinkComputer=h}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(g,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(g=h,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,b=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),_})()))})(ku)),ku.exports}var D1=R1(),Au={exports:{}},Cm;function M1(){return Cm||(Cm=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),b=c(9924),C=c(844),A=c(4725),x=c(2585),y=c(3656);let v=a.AccessibilityManager=class extends C.Disposable{constructor(m,S,k,M){super(),this._terminal=m,this._coreBrowserService=k,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new 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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
52
52
  `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(m){for(let S=0;S<m;S++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
53
53
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,S){this._liveRegionDebouncer.refresh(m,S,this._terminal.rows)}_renderRows(m,S){const k=this._terminal.buffer,M=k.lines.length.toString();for(let R=m;R<=S;R++){const D=k.lines.get(k.ydisp+R),E=[],L=(D==null?void 0:D.translateToString(!0,void 0,void 0,E))||"",O=(k.ydisp+R+1).toString(),I=this._rowElements[R];I&&(L.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=L,this._rowColumns.set(I,E)),I.setAttribute("aria-posinset",O),I.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,S){const k=m.target,M=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==M)return;let R,D;if(S===0?(R=k,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}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(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:m.anchorNode,offset:m.anchorOffset},k={node:m.focusNode,offset:m.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,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 M=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:M,offset:((L=M.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(k.node))return;const R=({node:O,offset:I})=>{const F=O instanceof Text?O.parentNode:O;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(F);if(!W)return console.warn("columns is null. Race condition?"),null;let Y=I<W.length?W[I]:W.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++U,Y=0),{row:U,column:Y}},D=R(S),E=R(k);if(D&&E){if(D.row>E.row||D.row===E.row&&D.column>=E.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(E.row-D.row)*this._terminal.cols-D.column+E.column)}}_handleResize(m){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>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=v=h([g(1,x.IInstantiationService),g(2,A.ICoreBrowserService),g(3,A.IRenderService)],v)},3614:(f,a)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function h(b,C){return C?"\x1B[200~"+b+"\x1B[201~":b}function g(b,C,A,x){b=h(b=c(b),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(b,!0),C.value=""}function u(b,C,A){const x=A.getBoundingClientRect(),y=b.clientX-x.left-10,v=b.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${y}px`,C.style.top=`${v}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(b,C){b.clipboardData&&b.clipboardData.setData("text/plain",C.selectionText),b.preventDefault()},a.handlePasteEvent=function(b,C,A,x){b.stopPropagation(),b.clipboardData&&g(b.clipboardData.getData("text/plain"),C,A,x)},a.paste=g,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(b,C,A,x,y){u(b,C,A),y&&x.rightClickSelect(b),C.value=x.selectionText,C.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,u,b){this._css.set(g,u,b)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,b){this._color.set(g,u,b)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,g,u){c.addEventListener(h,g,u);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(h,g,u))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(v,m,S,k){var M,R=arguments.length,D=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,m,S,k);else for(var E=v.length-1;E>=0;E--)(M=v[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},g=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=c(3656),b=c(8460),C=c(844),A=c(2585),x=c(4725);let y=a.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(v,m,S,k,M){super(),this._element=v,this._mouseService=m,this._renderService=S,this._bufferService=k,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const m=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;const S=v.composedPath();for(let k=0;k<S.length;k++){const M=S[k];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,m){var k,M;this._activeProviderReplies&&m||((k=this._activeProviderReplies)==null||k.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let S=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())m?(M=this._activeProviderReplies)!=null&&M.get(R)&&(S=this._checkLinkProviderResult(R,v,S)):D.provideLinks(v.y,(E=>{var O,I;if(this._isMouseOut)return;const L=E==null?void 0:E.map((F=>({link:F})));(O=this._activeProviderReplies)==null||O.set(R,L),S=this._checkLinkProviderResult(R,v,S),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,m){const S=new Set;for(let k=0;k<m.size;k++){const M=m.get(k);if(M)for(let R=0;R<M.length;R++){const D=M[R],E=D.link.range.start.y<v?0:D.link.range.start.x,L=D.link.range.end.y>v?this._bufferService.cols:D.link.range.end.x;for(let O=E;O<=L;O++){if(S.has(O)){M.splice(R--,1);break}S.add(O)}}}}_checkLinkProviderResult(v,m,S){var R;if(!this._activeProviderReplies)return S;const k=this._activeProviderReplies.get(v);let M=!1;for(let D=0;D<v;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(M=!0);if(!M&&k){const D=k.find((E=>this._linkAtPosition(E.link,m)));D&&(S=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let D=0;D<this._activeProviderReplies.size;D++){const E=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((L=>this._linkAtPosition(L.link,m)));if(E){S=!0,this._handleNewLink(E);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const m=this._positionFromMouseEvent(v,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,m){this._currentLink&&this._lastMouseEvent&&(!v||!m||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(v.link,m)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var S,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.pointerCursor},set:S=>{var k;(k=this._currentLink)!=null&&k.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,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.underline},set:S=>{var k,M,R;(k=this._currentLink)!=null&&k.state&&((R=(M=this._currentLink)==null?void 0:M.state)==null?void 0:R.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(k,M),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,m,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(S,m.text)}_fireUnderlineEvent(v,m){const S=v.range,k=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(v,m,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(S,m.text)}_linkAtPosition(v,m){const S=v.range.start.y*this._bufferService.cols+v.range.start.x,k=v.range.end.y*this._bufferService.cols+v.range.end.x,M=m.y*this._bufferService.cols+m.x;return S<=M&&M<=k}_positionFromMouseEvent(v,m,S){const k=S.getCoords(v,m,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,m,S,k,M){return{x1:v,y1:m,x2:S,y2:k,cols:this._bufferService.cols,fg:M}}};a.Linkifier=y=h([g(1,x.IMouseService),g(2,x.IRenderService),g(3,A.IBufferService),g(4,x.ILinkProviderService)],y)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(x,y,v,m){var S,k=arguments.length,M=k<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,y,v,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(k<3?S(M):k>3?S(y,v,M):S(y,v))||M);return k>3&&M&&Object.defineProperty(y,v,M),M},g=this&&this.__param||function(x,y){return function(v,m){y(v,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),b=c(2585);let C=a.OscLinkProvider=class{constructor(x,y,v){this._bufferService=x,this._optionsService=y,this._oscLinkService=v}provideLinks(x,y){var L;const v=this._bufferService.buffer.lines.get(x-1);if(!v)return void y(void 0);const m=[],S=this._optionsService.rawOptions.linkHandler,k=new u.CellData,M=v.getTrimmedLength();let R=-1,D=-1,E=!1;for(let O=0;O<M;O++)if(D!==-1||v.hasContent(O)){if(v.loadCell(O,k),k.hasExtendedAttrs()&&k.extended.urlId){if(D===-1){D=O,R=k.extended.urlId;continue}E=k.extended.urlId!==R}else D!==-1&&(E=!0);if(E||D!==-1&&O===M-1){const I=(L=this._oscLinkService.getLinkData(R))==null?void 0:L.uri;if(I){const F={start:{x:D+1,y:x},end:{x:O+(E||O!==M-1?0:1),y:x}};let U=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const W=new URL(I);["http:","https:"].includes(W.protocol)||(U=!0)}catch{U=!0}U||m.push({text:I,range:F,activate:(W,Y)=>S?S.activate(W,Y,F):A(0,Y),hover:(W,Y)=>{var V;return(V=S==null?void 0:S.hover)==null?void 0:V.call(S,W,Y,F)},leave:(W,Y)=>{var V;return(V=S==null?void 0:S.leave)==null?void 0:V.call(S,W,Y,F)}})}E=!1,k.hasExtendedAttrs()&&k.extended.urlId?(D=O,R=k.extended.urlId):(D=-1,R=-1)}}y(m)}};function A(x,y){if(confirm(`Do you want to navigate to ${y}?
54
54
 
55
- WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=C=h([g(0,b.IBufferService),g(1,b.IOptionsService),g(2,b.IOscLinkService)],C)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),g=c(3656),u=c(3551),b=c(9042),C=c(3730),A=c(1680),x=c(3107),y=c(5744),v=c(2950),m=c(1296),S=c(428),k=c(4269),M=c(5114),R=c(8934),D=c(3230),E=c(9312),L=c(4725),O=c(6731),I=c(8055),F=c(8969),U=c(8460),W=c(844),Y=c(6114),V=c(8437),K=c(2584),J=c(7399),z=c(5941),j=c(9074),H=c(2585),G=c(5435),N=c(4567),Z=c(779);class ue extends F.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(X={}){super(X),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,fe)=>this.refresh(q,fe)))),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,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,W.toDisposable)((()=>{var q,fe;this._customKeyEventHandler=void 0,(fe=(q=this.element)==null?void 0:q.parentNode)==null||fe.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const q of X){let fe,ce="";switch(q.index){case 256:fe="foreground",ce="10";break;case 257:fe="background",ce="11";break;case 258:fe="cursor",ce="12";break;default:fe="ansi",ce="4;"+q.index}switch(q.type){case 0:const de=I.color.toColorRGB(fe==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[fe]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ce};${(0,z.toRgbString)(de)}${K.C1_ESCAPED.ST}`);break;case 1:if(fe==="ansi")this._themeService.modifyColors((re=>re.ansi[q.index]=I.channels.toColor(...q.color)));else{const re=fe;this._themeService.modifyColors((Ce=>Ce[re]=I.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.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 X=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(X);if(!q)return;const fe=Math.min(this.buffer.x,this.cols-1),ce=this._renderService.dimensions.css.cell.height,de=q.getWidth(fe),re=this._renderService.dimensions.css.cell.width*de,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Ee=fe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ee+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=re+"px",this.textarea.style.height=ce+"px",this.textarea.style.lineHeight=ce+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const X=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,g.addDisposableDomListener)(this.element,"paste",X)),Y.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var fe;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((fe=this.element)==null?void 0:fe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.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"),X.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),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),Y.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(M.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,g.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(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(L.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(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.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(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&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(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,q=this.element;function fe(re){const Ce=X._mouseService.getMouseReportCoords(re,X.screenElement);if(!Ce)return!1;let Ee,xe;switch(re.overrideType||re.type){case"mousemove":xe=32,re.buttons===void 0?(Ee=3,re.button!==void 0&&(Ee=re.button<3?re.button:3)):Ee=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":xe=0,Ee=re.button<3?re.button:3;break;case"mousedown":xe=1,Ee=re.button<3?re.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(re)===!1||X.viewport.getLinesScrolled(re)===0)return!1;xe=re.deltaY<0?0:1,Ee=4;break;default:return!1}return!(xe===void 0||Ee===void 0||Ee>4)&&X.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Ee,action:xe,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const ce={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:re=>(fe(re),re.buttons||(this._document.removeEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.removeEventListener("mousemove",ce.mousedrag)),this.cancel(re)),wheel:re=>(fe(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&fe(re)},mousemove:re=>{re.buttons||fe(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),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&re?ce.mousemove||(q.addEventListener("mousemove",de.mousemove),ce.mousemove=de.mousemove):(q.removeEventListener("mousemove",ce.mousemove),ce.mousemove=null),16&re?ce.wheel||(q.addEventListener("wheel",de.wheel,{passive:!1}),ce.wheel=de.wheel):(q.removeEventListener("wheel",ce.wheel),ce.wheel=null),2&re?ce.mouseup||(ce.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ce.mouseup),ce.mouseup=null),4&re?ce.mousedrag||(ce.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ce.mousedrag),ce.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(q,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return fe(re),ce.mouseup&&this._document.addEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.addEventListener("mousemove",ce.mousedrag),this.cancel(re)}))),this.register((0,g.addDisposableDomListener)(q,"wheel",(re=>{if(!ce.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(re)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(re);if(Ce===0)return;const Ee=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let xe="";for(let dt=0;dt<Math.abs(Ce);dt++)xe+=Ee;return this.coreService.triggerDataEvent(xe,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(q,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(q,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(X,q){var fe;(fe=this._renderService)==null||fe.refreshRows(X,q)}updateCursorStyle(X){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(X)?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(X,q,fe=0){var ce;fe===1?(super.scrollLines(X,q,fe),this.refresh(0,this.rows-1)):(ce=this.viewport)==null||ce.scrollLines(X)}paste(X){(0,h.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,q,fe){this._selectionService.setSelection(X,q,fe)}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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,q){var fe;(fe=this._selectionService)==null||fe.selectLines(X,q)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!q&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const fe=(0,J.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),fe.type===3||fe.type===2){const ce=this.rows-1;return this.scrollLines(fe.type===2?-ce:ce),this.cancel(X,!0)}return fe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(fe.cancel&&this.cancel(X,!0),!fe.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(fe.key!==K.C0.ETX&&fe.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:fe.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(fe.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,q){const fe=X.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||X.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||X.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?fe:fe&&(!q.keyCode||q.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)q=X.charCode;else if(X.which===null||X.which===void 0)q=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;q=X.which}return!(!q||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=X.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(X),!0}return!1}resize(X,q){X!==this.cols||q!==this.rows?super.resize(X,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,q){var fe,ce;(fe=this._charSizeService)==null||fe.measure(),(ce=this.viewport)==null||ce.syncScrollArea(!0)}clear(){var X;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}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var q,fe;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(fe=this.viewport)==null||fe.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),fe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${fe};${q}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ce=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${de};${ce}t`)}}cancel(X,q){if(this.options.cancelEvents||q)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=ue},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=u-this._lastRefreshMs,C=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(v,m,S,k){var M,R=arguments.length,D=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,m,S,k);else for(var E=v.length-1;E>=0;E--)(M=v[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},g=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),b=c(4725),C=c(8460),A=c(844),x=c(2585);let y=a.Viewport=class extends A.Disposable{constructor(v,m,S,k,M,R,D,E){super(),this._viewportElement=v,this._scrollArea=m,this._bufferService=S,this._optionsService=k,this._charSizeService=M,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,m){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const m=this._getPixelsScrolled(v);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(v,m){var E;let S,k="";const M=[],R=m??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let L=v;L<R;L++){const O=D.get(L);if(!O)continue;const I=(E=D.get(L+1))==null?void 0:E.isWrapped;if(k+=O.translateToString(!I),!I||L===D.length-1){const F=document.createElement("div");F.textContent=k,M.push(F),k.length>0&&(S=F),k=""}}return{bufferElements:M,cursorElement:S}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(v,m){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&m.altKey||S==="ctrl"&&m.ctrlKey||S==="shift"&&m.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const m=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}};a.Viewport=y=h([g(2,x.IBufferService),g(3,x.IOptionsService),g(4,b.ICharSizeService),g(5,b.IRenderService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],y)},3107:function(f,a,c){var h=this&&this.__decorate||function(x,y,v,m){var S,k=arguments.length,M=k<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,y,v,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(k<3?S(M):k>3?S(y,v,M):S(y,v))||M);return k>3&&M&&Object.defineProperty(y,v,M),M},g=this&&this.__param||function(x,y){return function(v,m){y(v,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),C=c(2585);let A=a.BufferDecorationRenderer=class extends b.Disposable{constructor(x,y,v,m,S){super(),this._screenElement=x,this._bufferService=y,this._coreBrowserService=v,this._decorationService=m,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((k=>this._removeDecoration(k)))),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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var m;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((m=x==null?void 0:x.options)==null?void 0:m.layer)==="top"),y.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(x.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 v=x.options.x??0;return v&&v>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(x,y),y}_refreshStyle(x){const y=x.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let v=this._decorationElements.get(x);v||(v=this._createElement(x),x.element=v,this._decorationElements.set(x,v),this._container.appendChild(v),x.onDispose((()=>{this._decorationElements.delete(x),v.remove()}))),v.style.top=y*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(v)}}_refreshXPosition(x,y=x.element){if(!y)return;const v=x.options.x??0;(x.options.anchor||"left")==="right"?y.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var y;(y=this._decorationElements.get(x))==null||y.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=A=h([g(1,C.IBufferService),g(2,u.ICoreBrowserService),g(3,C.IDecorationService),g(4,u.IRenderService)],A)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(S,k,M,R){var D,E=arguments.length,L=E<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,k,M,R);else for(var O=S.length-1;O>=0;O--)(D=S[O])&&(L=(E<3?D(L):E>3?D(k,M,L):D(k,M))||L);return E>3&&L&&Object.defineProperty(k,M,L),L},g=this&&this.__param||function(S,k){return function(M,R){k(M,R,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),C=c(844),A=c(2585),x={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let m=a.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,M,R,D,E,L){var I;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=M,this._decorationService=R,this._renderService=D,this._optionsService=E,this._coreBrowserService=L,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),k=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=S,y.center=k,y.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=y.left,v.right=y.left+y.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);x.left=k,x.center=k,x.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(v[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-x[S.position||"full"]/2),y[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=m=h([g(2,A.IBufferService),g(3,A.IDecorationService),g(4,b.IRenderService),g(5,A.IOptionsService),g(6,b.ICoreBrowserService)],m)},2950:function(f,a,c){var h=this&&this.__decorate||function(x,y,v,m){var S,k=arguments.length,M=k<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,y,v,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(k<3?S(M):k>3?S(y,v,M):S(y,v))||M);return k>3&&M&&Object.defineProperty(y,v,M),M},g=this&&this.__param||function(x,y){return function(v,m){y(v,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),b=c(2585),C=c(2584);let A=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,y,v,m,S,k){this._textarea=x,this._compositionView=y,this._bufferService=v,this._optionsService=m,this._coreService=S,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),v.length>0&&this._coreService.triggerDataEvent(v,!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 x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,v=y.replace(x,"");this._dataAlreadySent=v,y.length>x.length?this._coreService.triggerDataEvent(v,!0):y.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):y.length===x.length&&y!==x&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=A=h([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,b.ICoreService),g(5,u.IRenderService)],A)},9806:(f,a)=>{function c(h,g,u){const b=u.getBoundingClientRect(),C=h.getComputedStyle(u),A=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[g.clientX-b.left-A,g.clientY-b.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,g,u,b,C,A,x,y,v){if(!A)return;const m=c(h,g,u);return m?(m[0]=Math.ceil((m[0]+(v?x/2:0))/x),m[1]=Math.ceil(m[1]/y),m[0]=Math.min(Math.max(m[0],1),b+(v?1:0)),m[1]=Math.min(Math.max(m[1],1),C),m):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function g(y,v,m,S){const k=y-u(y,m),M=v-u(v,m),R=Math.abs(k-M)-(function(D,E,L){let O=0;const I=D-u(D,L),F=E-u(E,L);for(let U=0;U<Math.abs(I-F);U++){const W=b(D,E)==="A"?-1:1,Y=L.buffer.lines.get(I+W*U);Y!=null&&Y.isWrapped&&O++}return O})(y,v,m);return x(R,A(b(y,v),S))}function u(y,v){let m=0,S=v.buffer.lines.get(y),k=S==null?void 0:S.isWrapped;for(;k&&y>=0&&y<v.rows;)m++,S=v.buffer.lines.get(--y),k=S==null?void 0:S.isWrapped;return m}function b(y,v){return y>v?"A":"B"}function C(y,v,m,S,k,M){let R=y,D=v,E="";for(;R!==m||D!==S;)R+=k?1:-1,k&&R>M.cols-1?(E+=M.buffer.translateBufferLineToString(D,!1,y,R),R=0,y=0,D++):!k&&R<0&&(E+=M.buffer.translateBufferLineToString(D,!1,0,y+1),R=M.cols-1,y=R,D--);return E+M.buffer.translateBufferLineToString(D,!1,y,R)}function A(y,v){const m=v?"O":"[";return h.C0.ESC+m+y}function x(y,v){y=Math.floor(y);let m="";for(let S=0;S<y;S++)m+=v;return m}a.moveToCellSequence=function(y,v,m,S){const k=m.buffer.x,M=m.buffer.y;if(!m.buffer.hasScrollback)return(function(E,L,O,I,F,U){return g(L,I,F,U).length===0?"":x(C(E,L,E,L-u(L,F),!1,F).length,A("D",U))})(k,M,0,v,m,S)+g(M,v,m,S)+(function(E,L,O,I,F,U){let W;W=g(L,I,F,U).length>0?I-u(I,F):L;const Y=I,V=(function(K,J,z,j,H,G){let N;return N=g(z,j,H,G).length>0?j-u(j,H):J,K<z&&N<=j||K>=z&&N<j?"C":"D"})(E,L,O,I,F,U);return x(C(E,W,O,Y,V==="C",F).length,A(V,U))})(k,M,y,v,m,S);let R;if(M===v)return R=k>y?"D":"C",x(Math.abs(k-y),A(R,S));R=M>v?"D":"C";const D=Math.abs(M-v);return x((function(E,L){return L.cols-E})(M>v?y:k,m)+(D-1)*m.cols+1+((M>v?k:y)-1),A(R,S))}},1296:function(f,a,c){var h=this&&this.__decorate||function(U,W,Y,V){var K,J=arguments.length,z=J<3?W:V===null?V=Object.getOwnPropertyDescriptor(W,Y):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,W,Y,V);else for(var j=U.length-1;j>=0;j--)(K=U[j])&&(z=(J<3?K(z):J>3?K(W,Y,z):K(W,Y))||z);return J>3&&z&&Object.defineProperty(W,Y,z),z},g=this&&this.__param||function(U,W){return function(Y,V){W(Y,V,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),b=c(2550),C=c(2223),A=c(6171),x=c(6052),y=c(4725),v=c(8055),m=c(8460),S=c(844),k=c(2585),M="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",E="xterm-bg-",L="xterm-focus",O="xterm-selection";let I=1,F=a.DomRenderer=class extends S.Disposable{constructor(U,W,Y,V,K,J,z,j,H,G,N,Z,ue){super(),this._terminal=U,this._document=W,this._element=Y,this._screenElement=V,this._viewportElement=K,this._helperContainer=J,this._linkifier2=z,this._charSizeService=H,this._optionsService=G,this._bufferService=N,this._coreBrowserService=Z,this._themeService=ue,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ve=>this._injectCss(ve)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ve=>this._handleLinkHover(ve)))),this.register(this._linkifier2.onHideLinkUnderline((ve=>this._handleLinkLeave(ve)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(M+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 U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),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/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${R} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(U.foreground,.5).css};}`,W+=`${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 Y=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;W+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${V} { 50% { box-shadow: none; }}`,W+=`@keyframes ${K} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,W+=`${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[J,z]of U.ansi.entries())W+=`${this._terminalSelector} .${D}${J} { color: ${z.css}; }${this._terminalSelector} .${D}${J}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${J} { background-color: ${z.css}; }`;W+=`${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${E}${C.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,W){for(let Y=this._rowElements.length;Y<=W;Y++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,W){this._refreshRowElements(U,W),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,W,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,W,Y),this.renderRows(0,this._bufferService.rows-1),!U||!W)return;this._selectionRenderModel.update(this._terminal,U,W,Y);const V=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(Y){const H=U[0]>W[0];j.appendChild(this._createSelectionElement(J,H?W[0]:U[0],H?U[0]:W[0],z-J+1))}else{const H=V===J?U[0]:0,G=J===K?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(J,H,G));const N=z-J-1;if(j.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,N)),J!==z){const Z=K===z?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,Z))}}this._selectionContainer.appendChild(j)}_createSelectionElement(U,W,Y,V=1){const K=this._document.createElement("div"),J=W*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(Y-W);return J+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-J),K.style.height=V*this.dimensions.css.cell.height+"px",K.style.top=U*this.dimensions.css.cell.height+"px",K.style.left=`${J}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 U of this._rowElements)U.replaceChildren()}renderRows(U,W){const Y=this._bufferService.buffer,V=Y.ybase+Y.y,K=Math.min(Y.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=W;H++){const G=H+Y.ydisp,N=this._rowElements[H],Z=Y.lines.get(G);if(!N||!Z)break;N.replaceChildren(...this._rowFactory.createRow(Z,G,G===V,z,j,K,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,W,Y,V,K,J){Y<0&&(U=0),V<0&&(W=0);const z=this._bufferService.rows-1;Y=Math.max(Math.min(Y,z),0),V=Math.max(Math.min(V,z),0),K=Math.min(K,this._bufferService.cols);const j=this._bufferService.buffer,H=j.ybase+j.y,G=Math.min(j.x,K-1),N=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let ve=Y;ve<=V;++ve){const X=ve+j.ydisp,q=this._rowElements[ve],fe=j.lines.get(X);if(!q||!fe)break;q.replaceChildren(...this._rowFactory.createRow(fe,X,X===H,Z,ue,G,N,this.dimensions.css.cell.width,this._widthCache,J?ve===Y?U:0:-1,J?(ve===V?W:K)-1:-1))}}};a.DomRenderer=F=h([g(7,k.IInstantiationService),g(8,y.ICharSizeService),g(9,k.IOptionsService),g(10,k.IBufferService),g(11,y.ICoreBrowserService),g(12,y.IThemeService)],F)},3787:function(f,a,c){var h=this&&this.__decorate||function(R,D,E,L){var O,I=arguments.length,F=I<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,E,L);else for(var U=R.length-1;U>=0;U--)(O=R[U])&&(F=(I<3?O(F):I>3?O(D,E,F):O(D,E))||F);return I>3&&F&&Object.defineProperty(D,E,F),F},g=this&&this.__param||function(R,D){return function(E,L){D(E,L,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),C=c(511),A=c(2585),x=c(8055),y=c(4725),v=c(4269),m=c(6171),S=c(3734);let k=a.DomRendererRowFactory=class{constructor(R,D,E,L,O,I,F){this._document=R,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=L,this._coreService=O,this._decorationService=I,this._themeService=F,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,E){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=E}createRow(R,D,E,L,O,I,F,U,W,Y,V){const K=[],J=this._characterJoinerService.getJoinedCharacters(D),z=this._themeService.colors;let j,H=R.getNoBgTrimmedLength();E&&H<I+1&&(H=I+1);let G=0,N="",Z=0,ue=0,ve=0,X=!1,q=0,fe=!1,ce=0;const de=[],re=Y!==-1&&V!==-1;for(let Ce=0;Ce<H;Ce++){R.loadCell(Ce,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let xe=!1,dt=Ce,Re=this._workCell;if(J.length>0&&Ce===J[0][0]){xe=!0;const Ue=J.shift();Re=new v.JoinedCellData(this._workCell,R.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),dt=Ue[1]-1,Ee=Re.getWidth()}const en=this._isCellInSelection(Ce,D),qt=E&&Ce===I,Kt=re&&Ce>=Y&&Ce<=V;let tn=!1;this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{tn=!0}));let wn=Re.getChars()||b.WHITESPACE_CELL_CHAR;if(wn===" "&&(Re.isUnderline()||Re.isOverline())&&(wn=" "),ce=Ee*U-W.get(wn,Re.isBold(),Re.isItalic()),j){if(G&&(en&&fe||!en&&!fe&&Re.bg===Z)&&(en&&fe&&z.selectionForeground||Re.fg===ue)&&Re.extended.ext===ve&&Kt===X&&ce===q&&!qt&&!xe&&!tn){Re.isInvisible()?N+=b.WHITESPACE_CELL_CHAR:N+=wn,G++;continue}G&&(j.textContent=N),j=this._document.createElement("span"),G=0,N=""}else j=this._document.createElement("span");if(Z=Re.bg,ue=Re.fg,ve=Re.extended.ext,X=Kt,q=ce,fe=en,xe&&I>=Ce&&I<=dt&&(I=Ce),!this._coreService.isCursorHidden&&qt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&de.push("xterm-cursor-blink"),de.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(Re.isBold()&&de.push("xterm-bold"),Re.isItalic()&&de.push("xterm-italic"),Re.isDim()&&de.push("xterm-dim"),N=Re.isInvisible()?b.WHITESPACE_CELL_CHAR:Re.getChars()||b.WHITESPACE_CELL_CHAR,Re.isUnderline()&&(de.push(`xterm-underline-${Re.extended.underlineStyle}`),N===" "&&(N=" "),!Re.isUnderlineColorDefault()))if(Re.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Re.getUnderlineColor()).join(",")})`;else{let Ue=Re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Re.isBold()&&Ue<8&&(Ue+=8),j.style.textDecorationColor=z.ansi[Ue].css}Re.isOverline()&&(de.push("xterm-overline"),N===" "&&(N=" ")),Re.isStrikethrough()&&de.push("xterm-strikethrough"),Kt&&(j.style.textDecoration="underline");let wt=Re.getFgColor(),pt=Re.getFgColorMode(),At=Re.getBgColor(),se=Re.getBgColorMode();const ye=!!Re.isInverse();if(ye){const Ue=wt;wt=At,At=Ue;const et=pt;pt=se,se=et}let ke,Be,je,mt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{Ue.options.layer!=="top"&&mt||(Ue.backgroundColorRGB&&(se=50331648,At=Ue.backgroundColorRGB.rgba>>8&16777215,ke=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&(pt=50331648,wt=Ue.foregroundColorRGB.rgba>>8&16777215,Be=Ue.foregroundColorRGB),mt=Ue.options.layer==="top")})),!mt&&en&&(ke=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,At=ke.rgba>>8&16777215,se=50331648,mt=!0,z.selectionForeground&&(pt=50331648,wt=z.selectionForeground.rgba>>8&16777215,Be=z.selectionForeground)),mt&&de.push("xterm-decoration-top"),se){case 16777216:case 33554432:je=z.ansi[At],de.push(`xterm-bg-${At}`);break;case 50331648:je=x.channels.toColor(At>>16,At>>8&255,255&At),this._addStyle(j,`background-color:#${M((At>>>0).toString(16),"0",6)}`);break;default:ye?(je=z.foreground,de.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):je=z.background}switch(ke||Re.isDim()&&(ke=x.color.multiplyOpacity(je,.5)),pt){case 16777216:case 33554432:Re.isBold()&&wt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(wt+=8),this._applyMinimumContrast(j,je,z.ansi[wt],Re,ke,void 0)||de.push(`xterm-fg-${wt}`);break;case 50331648:const Ue=x.channels.toColor(wt>>16&255,wt>>8&255,255&wt);this._applyMinimumContrast(j,je,Ue,Re,ke,Be)||this._addStyle(j,`color:#${M(wt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,je,z.foreground,Re,ke,Be)||ye&&de.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}de.length&&(j.className=de.join(" "),de.length=0),qt||xe||tn?j.textContent=N:G++,ce!==this.defaultSpacing&&(j.style.letterSpacing=`${ce}px`),K.push(j),Ce=dt}return j&&G&&(j.textContent=N),K}_applyMinimumContrast(R,D,E,L,O,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const F=this._getContrastCache(L);let U;if(O||I||(U=F.getColor(D.rgba,E.rgba)),U===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);U=x.color.ensureContrastRatio(O||D,I||E,W),F.setColor((O||D).rgba,(I||E).rgba,U??null)}return!!U&&(this._addStyle(R,`color:${U.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const E=this._selectionStart,L=this._selectionEnd;return!(!E||!L)&&(this._columnSelectMode?E[0]<=L[0]?R>=E[0]&&D>=E[1]&&R<L[0]&&D<=L[1]:R<E[0]&&D>=E[1]&&R>=L[0]&&D<=L[1]:D>E[1]&&D<L[1]||E[1]===L[1]&&D===E[1]&&R>=E[0]&&R<L[0]||E[1]<L[1]&&D===L[1]&&R<L[0]||E[1]<L[1]&&D===E[1]&&R>=E[0])}};function M(R,D,E){for(;R.length<E;)R=D+R;return R}a.DomRendererRowFactory=k=h([g(1,y.ICharacterJoinerService),g(2,A.IOptionsService),g(3,y.ICoreBrowserService),g(4,A.ICoreService),g(5,A.IDecorationService),g(6,y.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[g,u,b,C],this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(b),this._container.appendChild(C),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,g,u){c===this._font&&h===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,g){let u=0;if(!h&&!g&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const A=this._measure(c,0);return A>0&&(this._flat[u]=A),A}let b=c;h&&(b+="B"),g&&(b+="I");let C=this._holey.get(b);if(C===void 0){let A=0;h&&(A|=1),g&&(A|=2),C=this._measure(c,A),C>0&&this._holey.set(b,C)}return C}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=h,a.allowRescaling=function(g,u,b,C){return u===1&&b>Math.ceil(1.5*C)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(A){return 57344<=A&&A<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(u){return 9472<=u&&u<=9631})(g)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(g,u,b=0){return(g-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,u,b,C=!1){if(this.selectionStart=u,this.selectionEnd=b,!u||!b||u[0]===b[0]&&u[1]===b[1])return void this.clear();const A=g.buffers.active.ydisp,x=u[1]-A,y=b[1]-A,v=Math.max(x,0),m=Math.min(y,g.rows-1);v>=g.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=y,this.viewportCappedStartRow=v,this.viewportCappedEndRow=m,this.startCol=u[0],this.endCol=b[0])}isCellSelected(g,u,b){return!!this.hasSelection&&(b-=g.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)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),b=c(8460),C=c(844);let A=a.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new y(m,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};a.CharSizeService=A=h([g(2,u.IOptionsService)],A);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class y extends x{constructor(S,k,M){super(),this._document=S,this._parentElement=k,this._optionsService=M,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends x{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))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,a,c){var h=this&&this.__decorate||function(v,m,S,k){var M,R=arguments.length,D=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,m,S,k);else for(var E=v.length-1;E>=0;E--)(M=v[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},g=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),b=c(643),C=c(511),A=c(2585);class x extends u.AttributeData{constructor(m,S,k){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let y=a.CharacterJoinerService=class Bg{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(m){const S={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(S),S.id}deregister(m){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===m)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(m);if(!S||S.length===0)return[];const k=[],M=S.translateToString(!0);let R=0,D=0,E=0,L=S.getFg(0),O=S.getBg(0);for(let I=0;I<S.getTrimmedLength();I++)if(S.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==O){if(I-R>1){const F=this._getJoinedRanges(M,E,D,S,R);for(let U=0;U<F.length;U++)k.push(F[U])}R=I,E=D,L=this._workCell.fg,O=this._workCell.bg}D+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(M,E,D,S,R);for(let F=0;F<I.length;F++)k.push(I[F])}return k}_getJoinedRanges(m,S,k,M,R){const D=m.substring(S,k);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const O=this._characterJoiners[L].handler(D);for(let I=0;I<O.length;I++)Bg._mergeRanges(E,O[I])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,M,R),E}_stringRangesToCellRanges(m,S,k){let M=0,R=!1,D=0,E=m[M];if(E){for(let L=k;L<this._bufferService.cols;L++){const O=S.getWidth(L),I=S.getString(L).length||b.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!R&&E[0]<=D&&(E[0]=L,R=!0),E[1]<=D){if(E[1]=L,E=m[++M],!E)break;E[0]<=D?(E[0]=L,R=!0):R=!1}D+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(m,S){let k=!1;for(let M=0;M<m.length;M++){const R=m[M];if(k){if(S[1]<=R[0])return m[M-1][1]=S[1],m;if(S[1]<=R[1])return m[M-1][1]=Math.max(S[1],R[1]),m.splice(M,1),m;m.splice(M,1),M--}else{if(S[1]<=R[0])return m.splice(M,0,S),m;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),m;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?m[m.length-1][1]=S[1]:m.push(S),m}};a.CharacterJoinerService=y=h([g(0,A.IBufferService)],y)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),g=c(8460),u=c(3656);class b extends h.Disposable{constructor(x,y,v){super(),this._textarea=x,this._window=y,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=b;class C extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const C=this.linkProviders.indexOf(b);C!==-1&&this.linkProviders.splice(C,1)}}}}a.LinkProviderService=g},8934:function(f,a,c){var h=this&&this.__decorate||function(A,x,y,v){var m,S=arguments.length,k=S<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,x,y,v);else for(var M=A.length-1;M>=0;M--)(m=A[M])&&(k=(S<3?m(k):S>3?m(x,y,k):m(x,y))||k);return S>3&&k&&Object.defineProperty(x,y,k),k},g=this&&this.__param||function(A,x){return function(y,v){x(y,v,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),b=c(9806);let C=a.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,y,v,m){return(0,b.getCoords)(window,A,x,y,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(A,x){const y=(0,b.getCoordsRelativeToElement)(window,A,x);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])}}};a.MouseService=C=h([g(0,u.IRenderService),g(1,u.ICharSizeService)],C)},3230:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(6193),b=c(4725),C=c(8460),A=c(844),x=c(7226),y=c(2585);let v=a.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,S,k,M,R,D,E,L){super(),this._rowCount=m,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((O,I)=>this._renderRows(O,I)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,S),this.register(E.onWindowChange((O=>this._registerIntersectionObserver(O,S))))}_registerIntersectionObserver(m,S){if("IntersectionObserver"in m){const k=new m.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,S,this._rowCount))}_renderRows(m,S){this._renderer.value&&(m=Math.min(m,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(m,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:m,end:S}),this._onRender.fire({start:m,end:S}),this._isNextRenderRedrawOnly=!0)}resize(m,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,S;this._renderer.value&&((S=(m=this._renderer.value).clearTextureAtlas)==null||S.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(m,S)})):this._renderer.value.handleResize(m,S),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)==null||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)==null||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)==null||m.handleFocus()}handleSelectionChanged(m,S,k){var M;this._selectionState.start=m,this._selectionState.end=S,this._selectionState.columnSelectMode=k,(M=this._renderer.value)==null||M.handleSelectionChanged(m,S,k)}handleCursorMove(){var m;(m=this._renderer.value)==null||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)==null||m.clear()}};a.RenderService=v=h([g(2,y.IOptionsService),g(3,b.ICharSizeService),g(4,y.IDecorationService),g(5,y.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],v)},9312:function(f,a,c){var h=this&&this.__decorate||function(E,L,O,I){var F,U=arguments.length,W=U<3?L:I===null?I=Object.getOwnPropertyDescriptor(L,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,L,O,I);else for(var Y=E.length-1;Y>=0;Y--)(F=E[Y])&&(W=(U<3?F(W):U>3?F(L,O,W):F(L,O))||W);return U>3&&W&&Object.defineProperty(L,O,W),W},g=this&&this.__param||function(E,L){return function(O,I){L(O,I,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),b=c(9504),C=c(456),A=c(4725),x=c(8460),y=c(844),v=c(6114),m=c(4841),S=c(511),k=c(2585),M=" ",R=new RegExp(M,"g");let D=a.SelectionService=class extends y.Disposable{constructor(E,L,O,I,F,U,W,Y,V){super(),this._element=E,this._screenElement=L,this._linkifier=O,this._bufferService=I,this._coreService=F,this._mouseService=U,this._optionsService=W,this._renderService=Y,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 x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=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 C.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 E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!E||!L||E[0]===L[0]&&E[1]===L[1])}get selectionText(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!E||!L)return"";const O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===L[0])return"";const F=E[0]<L[0]?E[0]:L[0],U=E[0]<L[0]?L[0]:E[0];for(let W=E[1];W<=L[1];W++){const Y=O.translateBufferLineToString(W,!0,F,U);I.push(Y)}}else{const F=E[1]===L[1]?L[0]:void 0;I.push(O.translateBufferLineToString(E[1],!0,E[0],F));for(let U=E[1]+1;U<=L[1]-1;U++){const W=O.lines.get(U),Y=O.translateBufferLineToString(U,!0);W!=null&&W.isWrapped?I[I.length-1]+=Y:I.push(Y)}if(E[1]!==L[1]){const U=O.lines.get(L[1]),W=O.translateBufferLineToString(L[1],!0,0,L[0]);U&&U.isWrapped?I[I.length-1]+=W:I.push(W)}}return I.map((F=>F.replace(R," "))).join(v.isWindows?`\r
55
+ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=C=h([g(0,b.IBufferService),g(1,b.IOptionsService),g(2,b.IOscLinkService)],C)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),g=c(3656),u=c(3551),b=c(9042),C=c(3730),A=c(1680),x=c(3107),y=c(5744),v=c(2950),m=c(1296),S=c(428),k=c(4269),M=c(5114),R=c(8934),D=c(3230),E=c(9312),L=c(4725),O=c(6731),I=c(8055),F=c(8969),U=c(8460),W=c(844),Y=c(6114),V=c(8437),K=c(2584),J=c(7399),z=c(5941),j=c(9074),H=c(2585),G=c(5435),N=c(4567),Z=c(779);class ue extends F.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(X={}){super(X),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,fe)=>this.refresh(q,fe)))),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,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,W.toDisposable)((()=>{var q,fe;this._customKeyEventHandler=void 0,(fe=(q=this.element)==null?void 0:q.parentNode)==null||fe.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const q of X){let fe,ce="";switch(q.index){case 256:fe="foreground",ce="10";break;case 257:fe="background",ce="11";break;case 258:fe="cursor",ce="12";break;default:fe="ansi",ce="4;"+q.index}switch(q.type){case 0:const de=I.color.toColorRGB(fe==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[fe]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ce};${(0,z.toRgbString)(de)}${K.C1_ESCAPED.ST}`);break;case 1:if(fe==="ansi")this._themeService.modifyColors((se=>se.ansi[q.index]=I.channels.toColor(...q.color)));else{const se=fe;this._themeService.modifyColors((Ce=>Ce[se]=I.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.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 X=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(X);if(!q)return;const fe=Math.min(this.buffer.x,this.cols-1),ce=this._renderService.dimensions.css.cell.height,de=q.getWidth(fe),se=this._renderService.dimensions.css.cell.width*de,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,ke=fe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ke+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=se+"px",this.textarea.style.height=ce+"px",this.textarea.style.lineHeight=ce+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const X=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,g.addDisposableDomListener)(this.element,"paste",X)),Y.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var fe;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((fe=this.element)==null?void 0:fe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.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"),X.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),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),Y.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(M.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,g.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(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(L.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(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.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(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&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(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,q=this.element;function fe(se){const Ce=X._mouseService.getMouseReportCoords(se,X.screenElement);if(!Ce)return!1;let ke,Ee;switch(se.overrideType||se.type){case"mousemove":Ee=32,se.buttons===void 0?(ke=3,se.button!==void 0&&(ke=se.button<3?se.button:3)):ke=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":Ee=0,ke=se.button<3?se.button:3;break;case"mousedown":Ee=1,ke=se.button<3?se.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(se)===!1||X.viewport.getLinesScrolled(se)===0)return!1;Ee=se.deltaY<0?0:1,ke=4;break;default:return!1}return!(Ee===void 0||ke===void 0||ke>4)&&X.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:ke,action:Ee,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const ce={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:se=>(fe(se),se.buttons||(this._document.removeEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.removeEventListener("mousemove",ce.mousedrag)),this.cancel(se)),wheel:se=>(fe(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&fe(se)},mousemove:se=>{se.buttons||fe(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?ce.mousemove||(q.addEventListener("mousemove",de.mousemove),ce.mousemove=de.mousemove):(q.removeEventListener("mousemove",ce.mousemove),ce.mousemove=null),16&se?ce.wheel||(q.addEventListener("wheel",de.wheel,{passive:!1}),ce.wheel=de.wheel):(q.removeEventListener("wheel",ce.wheel),ce.wheel=null),2&se?ce.mouseup||(ce.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ce.mouseup),ce.mouseup=null),4&se?ce.mousedrag||(ce.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ce.mousedrag),ce.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(q,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return fe(se),ce.mouseup&&this._document.addEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.addEventListener("mousemove",ce.mousedrag),this.cancel(se)}))),this.register((0,g.addDisposableDomListener)(q,"wheel",(se=>{if(!ce.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(se);if(Ce===0)return;const ke=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let Ee="";for(let ht=0;ht<Math.abs(Ce);ht++)Ee+=ke;return this.coreService.triggerDataEvent(Ee,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(q,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(q,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(X,q){var fe;(fe=this._renderService)==null||fe.refreshRows(X,q)}updateCursorStyle(X){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(X)?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(X,q,fe=0){var ce;fe===1?(super.scrollLines(X,q,fe),this.refresh(0,this.rows-1)):(ce=this.viewport)==null||ce.scrollLines(X)}paste(X){(0,h.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,q,fe){this._selectionService.setSelection(X,q,fe)}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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,q){var fe;(fe=this._selectionService)==null||fe.selectLines(X,q)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!q&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const fe=(0,J.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),fe.type===3||fe.type===2){const ce=this.rows-1;return this.scrollLines(fe.type===2?-ce:ce),this.cancel(X,!0)}return fe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(fe.cancel&&this.cancel(X,!0),!fe.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(fe.key!==K.C0.ETX&&fe.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:fe.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(fe.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,q){const fe=X.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||X.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||X.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?fe:fe&&(!q.keyCode||q.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)q=X.charCode;else if(X.which===null||X.which===void 0)q=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;q=X.which}return!(!q||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=X.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(X),!0}return!1}resize(X,q){X!==this.cols||q!==this.rows?super.resize(X,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,q){var fe,ce;(fe=this._charSizeService)==null||fe.measure(),(ce=this.viewport)==null||ce.syncScrollArea(!0)}clear(){var X;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}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var q,fe;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(fe=this.viewport)==null||fe.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),fe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${fe};${q}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ce=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${de};${ce}t`)}}cancel(X,q){if(this.options.cancelEvents||q)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=ue},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=u-this._lastRefreshMs,C=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(v,m,S,k){var M,R=arguments.length,D=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,m,S,k);else for(var E=v.length-1;E>=0;E--)(M=v[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},g=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),b=c(4725),C=c(8460),A=c(844),x=c(2585);let y=a.Viewport=class extends A.Disposable{constructor(v,m,S,k,M,R,D,E){super(),this._viewportElement=v,this._scrollArea=m,this._bufferService=S,this._optionsService=k,this._charSizeService=M,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,m){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const m=this._getPixelsScrolled(v);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(v,m){var E;let S,k="";const M=[],R=m??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let L=v;L<R;L++){const O=D.get(L);if(!O)continue;const I=(E=D.get(L+1))==null?void 0:E.isWrapped;if(k+=O.translateToString(!I),!I||L===D.length-1){const F=document.createElement("div");F.textContent=k,M.push(F),k.length>0&&(S=F),k=""}}return{bufferElements:M,cursorElement:S}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(v,m){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&m.altKey||S==="ctrl"&&m.ctrlKey||S==="shift"&&m.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const m=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}};a.Viewport=y=h([g(2,x.IBufferService),g(3,x.IOptionsService),g(4,b.ICharSizeService),g(5,b.IRenderService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],y)},3107:function(f,a,c){var h=this&&this.__decorate||function(x,y,v,m){var S,k=arguments.length,M=k<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,y,v,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(k<3?S(M):k>3?S(y,v,M):S(y,v))||M);return k>3&&M&&Object.defineProperty(y,v,M),M},g=this&&this.__param||function(x,y){return function(v,m){y(v,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),C=c(2585);let A=a.BufferDecorationRenderer=class extends b.Disposable{constructor(x,y,v,m,S){super(),this._screenElement=x,this._bufferService=y,this._coreBrowserService=v,this._decorationService=m,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((k=>this._removeDecoration(k)))),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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var m;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((m=x==null?void 0:x.options)==null?void 0:m.layer)==="top"),y.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(x.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 v=x.options.x??0;return v&&v>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(x,y),y}_refreshStyle(x){const y=x.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let v=this._decorationElements.get(x);v||(v=this._createElement(x),x.element=v,this._decorationElements.set(x,v),this._container.appendChild(v),x.onDispose((()=>{this._decorationElements.delete(x),v.remove()}))),v.style.top=y*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(v)}}_refreshXPosition(x,y=x.element){if(!y)return;const v=x.options.x??0;(x.options.anchor||"left")==="right"?y.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var y;(y=this._decorationElements.get(x))==null||y.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=A=h([g(1,C.IBufferService),g(2,u.ICoreBrowserService),g(3,C.IDecorationService),g(4,u.IRenderService)],A)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(S,k,M,R){var D,E=arguments.length,L=E<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,k,M,R);else for(var O=S.length-1;O>=0;O--)(D=S[O])&&(L=(E<3?D(L):E>3?D(k,M,L):D(k,M))||L);return E>3&&L&&Object.defineProperty(k,M,L),L},g=this&&this.__param||function(S,k){return function(M,R){k(M,R,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),C=c(844),A=c(2585),x={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let m=a.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,M,R,D,E,L){var I;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=M,this._decorationService=R,this._renderService=D,this._optionsService=E,this._coreBrowserService=L,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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),k=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=S,y.center=k,y.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=y.left,v.right=y.left+y.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);x.left=k,x.center=k,x.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(v[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-x[S.position||"full"]/2),y[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=m=h([g(2,A.IBufferService),g(3,A.IDecorationService),g(4,b.IRenderService),g(5,A.IOptionsService),g(6,b.ICoreBrowserService)],m)},2950:function(f,a,c){var h=this&&this.__decorate||function(x,y,v,m){var S,k=arguments.length,M=k<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,y,v,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(k<3?S(M):k>3?S(y,v,M):S(y,v))||M);return k>3&&M&&Object.defineProperty(y,v,M),M},g=this&&this.__param||function(x,y){return function(v,m){y(v,m,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),b=c(2585),C=c(2584);let A=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,y,v,m,S,k){this._textarea=x,this._compositionView=y,this._bufferService=v,this._optionsService=m,this._coreService=S,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),v.length>0&&this._coreService.triggerDataEvent(v,!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 x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,v=y.replace(x,"");this._dataAlreadySent=v,y.length>x.length?this._coreService.triggerDataEvent(v,!0):y.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):y.length===x.length&&y!==x&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=A=h([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,b.ICoreService),g(5,u.IRenderService)],A)},9806:(f,a)=>{function c(h,g,u){const b=u.getBoundingClientRect(),C=h.getComputedStyle(u),A=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[g.clientX-b.left-A,g.clientY-b.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,g,u,b,C,A,x,y,v){if(!A)return;const m=c(h,g,u);return m?(m[0]=Math.ceil((m[0]+(v?x/2:0))/x),m[1]=Math.ceil(m[1]/y),m[0]=Math.min(Math.max(m[0],1),b+(v?1:0)),m[1]=Math.min(Math.max(m[1],1),C),m):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function g(y,v,m,S){const k=y-u(y,m),M=v-u(v,m),R=Math.abs(k-M)-(function(D,E,L){let O=0;const I=D-u(D,L),F=E-u(E,L);for(let U=0;U<Math.abs(I-F);U++){const W=b(D,E)==="A"?-1:1,Y=L.buffer.lines.get(I+W*U);Y!=null&&Y.isWrapped&&O++}return O})(y,v,m);return x(R,A(b(y,v),S))}function u(y,v){let m=0,S=v.buffer.lines.get(y),k=S==null?void 0:S.isWrapped;for(;k&&y>=0&&y<v.rows;)m++,S=v.buffer.lines.get(--y),k=S==null?void 0:S.isWrapped;return m}function b(y,v){return y>v?"A":"B"}function C(y,v,m,S,k,M){let R=y,D=v,E="";for(;R!==m||D!==S;)R+=k?1:-1,k&&R>M.cols-1?(E+=M.buffer.translateBufferLineToString(D,!1,y,R),R=0,y=0,D++):!k&&R<0&&(E+=M.buffer.translateBufferLineToString(D,!1,0,y+1),R=M.cols-1,y=R,D--);return E+M.buffer.translateBufferLineToString(D,!1,y,R)}function A(y,v){const m=v?"O":"[";return h.C0.ESC+m+y}function x(y,v){y=Math.floor(y);let m="";for(let S=0;S<y;S++)m+=v;return m}a.moveToCellSequence=function(y,v,m,S){const k=m.buffer.x,M=m.buffer.y;if(!m.buffer.hasScrollback)return(function(E,L,O,I,F,U){return g(L,I,F,U).length===0?"":x(C(E,L,E,L-u(L,F),!1,F).length,A("D",U))})(k,M,0,v,m,S)+g(M,v,m,S)+(function(E,L,O,I,F,U){let W;W=g(L,I,F,U).length>0?I-u(I,F):L;const Y=I,V=(function(K,J,z,j,H,G){let N;return N=g(z,j,H,G).length>0?j-u(j,H):J,K<z&&N<=j||K>=z&&N<j?"C":"D"})(E,L,O,I,F,U);return x(C(E,W,O,Y,V==="C",F).length,A(V,U))})(k,M,y,v,m,S);let R;if(M===v)return R=k>y?"D":"C",x(Math.abs(k-y),A(R,S));R=M>v?"D":"C";const D=Math.abs(M-v);return x((function(E,L){return L.cols-E})(M>v?y:k,m)+(D-1)*m.cols+1+((M>v?k:y)-1),A(R,S))}},1296:function(f,a,c){var h=this&&this.__decorate||function(U,W,Y,V){var K,J=arguments.length,z=J<3?W:V===null?V=Object.getOwnPropertyDescriptor(W,Y):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,W,Y,V);else for(var j=U.length-1;j>=0;j--)(K=U[j])&&(z=(J<3?K(z):J>3?K(W,Y,z):K(W,Y))||z);return J>3&&z&&Object.defineProperty(W,Y,z),z},g=this&&this.__param||function(U,W){return function(Y,V){W(Y,V,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),b=c(2550),C=c(2223),A=c(6171),x=c(6052),y=c(4725),v=c(8055),m=c(8460),S=c(844),k=c(2585),M="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",E="xterm-bg-",L="xterm-focus",O="xterm-selection";let I=1,F=a.DomRenderer=class extends S.Disposable{constructor(U,W,Y,V,K,J,z,j,H,G,N,Z,ue){super(),this._terminal=U,this._document=W,this._element=Y,this._screenElement=V,this._viewportElement=K,this._helperContainer=J,this._linkifier2=z,this._charSizeService=H,this._optionsService=G,this._bufferService=N,this._coreBrowserService=Z,this._themeService=ue,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ve=>this._injectCss(ve)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ve=>this._handleLinkHover(ve)))),this.register(this._linkifier2.onHideLinkUnderline((ve=>this._handleLinkLeave(ve)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(M+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 U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),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/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${R} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(U.foreground,.5).css};}`,W+=`${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 Y=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;W+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${V} { 50% { box-shadow: none; }}`,W+=`@keyframes ${K} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,W+=`${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[J,z]of U.ansi.entries())W+=`${this._terminalSelector} .${D}${J} { color: ${z.css}; }${this._terminalSelector} .${D}${J}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${J} { background-color: ${z.css}; }`;W+=`${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${E}${C.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,W){for(let Y=this._rowElements.length;Y<=W;Y++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,W){this._refreshRowElements(U,W),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,W,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,W,Y),this.renderRows(0,this._bufferService.rows-1),!U||!W)return;this._selectionRenderModel.update(this._terminal,U,W,Y);const V=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(Y){const H=U[0]>W[0];j.appendChild(this._createSelectionElement(J,H?W[0]:U[0],H?U[0]:W[0],z-J+1))}else{const H=V===J?U[0]:0,G=J===K?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(J,H,G));const N=z-J-1;if(j.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,N)),J!==z){const Z=K===z?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,Z))}}this._selectionContainer.appendChild(j)}_createSelectionElement(U,W,Y,V=1){const K=this._document.createElement("div"),J=W*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(Y-W);return J+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-J),K.style.height=V*this.dimensions.css.cell.height+"px",K.style.top=U*this.dimensions.css.cell.height+"px",K.style.left=`${J}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 U of this._rowElements)U.replaceChildren()}renderRows(U,W){const Y=this._bufferService.buffer,V=Y.ybase+Y.y,K=Math.min(Y.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=W;H++){const G=H+Y.ydisp,N=this._rowElements[H],Z=Y.lines.get(G);if(!N||!Z)break;N.replaceChildren(...this._rowFactory.createRow(Z,G,G===V,z,j,K,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,W,Y,V,K,J){Y<0&&(U=0),V<0&&(W=0);const z=this._bufferService.rows-1;Y=Math.max(Math.min(Y,z),0),V=Math.max(Math.min(V,z),0),K=Math.min(K,this._bufferService.cols);const j=this._bufferService.buffer,H=j.ybase+j.y,G=Math.min(j.x,K-1),N=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let ve=Y;ve<=V;++ve){const X=ve+j.ydisp,q=this._rowElements[ve],fe=j.lines.get(X);if(!q||!fe)break;q.replaceChildren(...this._rowFactory.createRow(fe,X,X===H,Z,ue,G,N,this.dimensions.css.cell.width,this._widthCache,J?ve===Y?U:0:-1,J?(ve===V?W:K)-1:-1))}}};a.DomRenderer=F=h([g(7,k.IInstantiationService),g(8,y.ICharSizeService),g(9,k.IOptionsService),g(10,k.IBufferService),g(11,y.ICoreBrowserService),g(12,y.IThemeService)],F)},3787:function(f,a,c){var h=this&&this.__decorate||function(R,D,E,L){var O,I=arguments.length,F=I<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,E,L);else for(var U=R.length-1;U>=0;U--)(O=R[U])&&(F=(I<3?O(F):I>3?O(D,E,F):O(D,E))||F);return I>3&&F&&Object.defineProperty(D,E,F),F},g=this&&this.__param||function(R,D){return function(E,L){D(E,L,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),C=c(511),A=c(2585),x=c(8055),y=c(4725),v=c(4269),m=c(6171),S=c(3734);let k=a.DomRendererRowFactory=class{constructor(R,D,E,L,O,I,F){this._document=R,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=L,this._coreService=O,this._decorationService=I,this._themeService=F,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,E){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=E}createRow(R,D,E,L,O,I,F,U,W,Y,V){const K=[],J=this._characterJoinerService.getJoinedCharacters(D),z=this._themeService.colors;let j,H=R.getNoBgTrimmedLength();E&&H<I+1&&(H=I+1);let G=0,N="",Z=0,ue=0,ve=0,X=!1,q=0,fe=!1,ce=0;const de=[],se=Y!==-1&&V!==-1;for(let Ce=0;Ce<H;Ce++){R.loadCell(Ce,this._workCell);let ke=this._workCell.getWidth();if(ke===0)continue;let Ee=!1,ht=Ce,De=this._workCell;if(J.length>0&&Ce===J[0][0]){Ee=!0;const Ue=J.shift();De=new v.JoinedCellData(this._workCell,R.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),ht=Ue[1]-1,ke=De.getWidth()}const tn=this._isCellInSelection(Ce,D),qt=E&&Ce===I,Kt=se&&Ce>=Y&&Ce<=V;let nn=!1;this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{nn=!0}));let xn=De.getChars()||b.WHITESPACE_CELL_CHAR;if(xn===" "&&(De.isUnderline()||De.isOverline())&&(xn=" "),ce=ke*U-W.get(xn,De.isBold(),De.isItalic()),j){if(G&&(tn&&fe||!tn&&!fe&&De.bg===Z)&&(tn&&fe&&z.selectionForeground||De.fg===ue)&&De.extended.ext===ve&&Kt===X&&ce===q&&!qt&&!Ee&&!nn){De.isInvisible()?N+=b.WHITESPACE_CELL_CHAR:N+=xn,G++;continue}G&&(j.textContent=N),j=this._document.createElement("span"),G=0,N=""}else j=this._document.createElement("span");if(Z=De.bg,ue=De.fg,ve=De.extended.ext,X=Kt,q=ce,fe=tn,Ee&&I>=Ce&&I<=ht&&(I=Ce),!this._coreService.isCursorHidden&&qt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&de.push("xterm-cursor-blink"),de.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(De.isBold()&&de.push("xterm-bold"),De.isItalic()&&de.push("xterm-italic"),De.isDim()&&de.push("xterm-dim"),N=De.isInvisible()?b.WHITESPACE_CELL_CHAR:De.getChars()||b.WHITESPACE_CELL_CHAR,De.isUnderline()&&(de.push(`xterm-underline-${De.extended.underlineStyle}`),N===" "&&(N=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let Ue=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&Ue<8&&(Ue+=8),j.style.textDecorationColor=z.ansi[Ue].css}De.isOverline()&&(de.push("xterm-overline"),N===" "&&(N=" ")),De.isStrikethrough()&&de.push("xterm-strikethrough"),Kt&&(j.style.textDecoration="underline");let wt=De.getFgColor(),ft=De.getFgColorMode(),At=De.getBgColor(),ne=De.getBgColorMode();const ye=!!De.isInverse();if(ye){const Ue=wt;wt=At,At=Ue;const Je=ft;ft=ne,ne=Je}let Ae,Be,Ne,dt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{Ue.options.layer!=="top"&&dt||(Ue.backgroundColorRGB&&(ne=50331648,At=Ue.backgroundColorRGB.rgba>>8&16777215,Ae=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&(ft=50331648,wt=Ue.foregroundColorRGB.rgba>>8&16777215,Be=Ue.foregroundColorRGB),dt=Ue.options.layer==="top")})),!dt&&tn&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,At=Ae.rgba>>8&16777215,ne=50331648,dt=!0,z.selectionForeground&&(ft=50331648,wt=z.selectionForeground.rgba>>8&16777215,Be=z.selectionForeground)),dt&&de.push("xterm-decoration-top"),ne){case 16777216:case 33554432:Ne=z.ansi[At],de.push(`xterm-bg-${At}`);break;case 50331648:Ne=x.channels.toColor(At>>16,At>>8&255,255&At),this._addStyle(j,`background-color:#${M((At>>>0).toString(16),"0",6)}`);break;default:ye?(Ne=z.foreground,de.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=z.background}switch(Ae||De.isDim()&&(Ae=x.color.multiplyOpacity(Ne,.5)),ft){case 16777216:case 33554432:De.isBold()&&wt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(wt+=8),this._applyMinimumContrast(j,Ne,z.ansi[wt],De,Ae,void 0)||de.push(`xterm-fg-${wt}`);break;case 50331648:const Ue=x.channels.toColor(wt>>16&255,wt>>8&255,255&wt);this._applyMinimumContrast(j,Ne,Ue,De,Ae,Be)||this._addStyle(j,`color:#${M(wt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ne,z.foreground,De,Ae,Be)||ye&&de.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}de.length&&(j.className=de.join(" "),de.length=0),qt||Ee||nn?j.textContent=N:G++,ce!==this.defaultSpacing&&(j.style.letterSpacing=`${ce}px`),K.push(j),Ce=ht}return j&&G&&(j.textContent=N),K}_applyMinimumContrast(R,D,E,L,O,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const F=this._getContrastCache(L);let U;if(O||I||(U=F.getColor(D.rgba,E.rgba)),U===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);U=x.color.ensureContrastRatio(O||D,I||E,W),F.setColor((O||D).rgba,(I||E).rgba,U??null)}return!!U&&(this._addStyle(R,`color:${U.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const E=this._selectionStart,L=this._selectionEnd;return!(!E||!L)&&(this._columnSelectMode?E[0]<=L[0]?R>=E[0]&&D>=E[1]&&R<L[0]&&D<=L[1]:R<E[0]&&D>=E[1]&&R>=L[0]&&D<=L[1]:D>E[1]&&D<L[1]||E[1]===L[1]&&D===E[1]&&R>=E[0]&&R<L[0]||E[1]<L[1]&&D===L[1]&&R<L[0]||E[1]<L[1]&&D===E[1]&&R>=E[0])}};function M(R,D,E){for(;R.length<E;)R=D+R;return R}a.DomRendererRowFactory=k=h([g(1,y.ICharacterJoinerService),g(2,A.IOptionsService),g(3,y.ICoreBrowserService),g(4,A.ICoreService),g(5,A.IDecorationService),g(6,y.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[g,u,b,C],this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(b),this._container.appendChild(C),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,g,u){c===this._font&&h===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,g){let u=0;if(!h&&!g&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const A=this._measure(c,0);return A>0&&(this._flat[u]=A),A}let b=c;h&&(b+="B"),g&&(b+="I");let C=this._holey.get(b);if(C===void 0){let A=0;h&&(A|=1),g&&(A|=2),C=this._measure(c,A),C>0&&this._holey.set(b,C)}return C}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=h,a.allowRescaling=function(g,u,b,C){return u===1&&b>Math.ceil(1.5*C)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(A){return 57344<=A&&A<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(u){return 9472<=u&&u<=9631})(g)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(g,u,b=0){return(g-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,u,b,C=!1){if(this.selectionStart=u,this.selectionEnd=b,!u||!b||u[0]===b[0]&&u[1]===b[1])return void this.clear();const A=g.buffers.active.ydisp,x=u[1]-A,y=b[1]-A,v=Math.max(x,0),m=Math.min(y,g.rows-1);v>=g.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=y,this.viewportCappedStartRow=v,this.viewportCappedEndRow=m,this.startCol=u[0],this.endCol=b[0])}isCellSelected(g,u,b){return!!this.hasSelection&&(b-=g.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)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),b=c(8460),C=c(844);let A=a.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new y(m,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};a.CharSizeService=A=h([g(2,u.IOptionsService)],A);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class y extends x{constructor(S,k,M){super(),this._document=S,this._parentElement=k,this._optionsService=M,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends x{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))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,a,c){var h=this&&this.__decorate||function(v,m,S,k){var M,R=arguments.length,D=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,m,S,k);else for(var E=v.length-1;E>=0;E--)(M=v[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},g=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),b=c(643),C=c(511),A=c(2585);class x extends u.AttributeData{constructor(m,S,k){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let y=a.CharacterJoinerService=class Bg{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(m){const S={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(S),S.id}deregister(m){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===m)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(m);if(!S||S.length===0)return[];const k=[],M=S.translateToString(!0);let R=0,D=0,E=0,L=S.getFg(0),O=S.getBg(0);for(let I=0;I<S.getTrimmedLength();I++)if(S.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==O){if(I-R>1){const F=this._getJoinedRanges(M,E,D,S,R);for(let U=0;U<F.length;U++)k.push(F[U])}R=I,E=D,L=this._workCell.fg,O=this._workCell.bg}D+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(M,E,D,S,R);for(let F=0;F<I.length;F++)k.push(I[F])}return k}_getJoinedRanges(m,S,k,M,R){const D=m.substring(S,k);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const O=this._characterJoiners[L].handler(D);for(let I=0;I<O.length;I++)Bg._mergeRanges(E,O[I])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,M,R),E}_stringRangesToCellRanges(m,S,k){let M=0,R=!1,D=0,E=m[M];if(E){for(let L=k;L<this._bufferService.cols;L++){const O=S.getWidth(L),I=S.getString(L).length||b.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!R&&E[0]<=D&&(E[0]=L,R=!0),E[1]<=D){if(E[1]=L,E=m[++M],!E)break;E[0]<=D?(E[0]=L,R=!0):R=!1}D+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(m,S){let k=!1;for(let M=0;M<m.length;M++){const R=m[M];if(k){if(S[1]<=R[0])return m[M-1][1]=S[1],m;if(S[1]<=R[1])return m[M-1][1]=Math.max(S[1],R[1]),m.splice(M,1),m;m.splice(M,1),M--}else{if(S[1]<=R[0])return m.splice(M,0,S),m;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),m;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?m[m.length-1][1]=S[1]:m.push(S),m}};a.CharacterJoinerService=y=h([g(0,A.IBufferService)],y)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),g=c(8460),u=c(3656);class b extends h.Disposable{constructor(x,y,v){super(),this._textarea=x,this._window=y,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=b;class C extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const C=this.linkProviders.indexOf(b);C!==-1&&this.linkProviders.splice(C,1)}}}}a.LinkProviderService=g},8934:function(f,a,c){var h=this&&this.__decorate||function(A,x,y,v){var m,S=arguments.length,k=S<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,x,y,v);else for(var M=A.length-1;M>=0;M--)(m=A[M])&&(k=(S<3?m(k):S>3?m(x,y,k):m(x,y))||k);return S>3&&k&&Object.defineProperty(x,y,k),k},g=this&&this.__param||function(A,x){return function(y,v){x(y,v,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),b=c(9806);let C=a.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,y,v,m){return(0,b.getCoords)(window,A,x,y,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(A,x){const y=(0,b.getCoordsRelativeToElement)(window,A,x);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])}}};a.MouseService=C=h([g(0,u.IRenderService),g(1,u.ICharSizeService)],C)},3230:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(6193),b=c(4725),C=c(8460),A=c(844),x=c(7226),y=c(2585);let v=a.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,S,k,M,R,D,E,L){super(),this._rowCount=m,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((O,I)=>this._renderRows(O,I)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,S),this.register(E.onWindowChange((O=>this._registerIntersectionObserver(O,S))))}_registerIntersectionObserver(m,S){if("IntersectionObserver"in m){const k=new m.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,S,this._rowCount))}_renderRows(m,S){this._renderer.value&&(m=Math.min(m,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(m,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:m,end:S}),this._onRender.fire({start:m,end:S}),this._isNextRenderRedrawOnly=!0)}resize(m,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,S;this._renderer.value&&((S=(m=this._renderer.value).clearTextureAtlas)==null||S.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(m,S)})):this._renderer.value.handleResize(m,S),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)==null||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)==null||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)==null||m.handleFocus()}handleSelectionChanged(m,S,k){var M;this._selectionState.start=m,this._selectionState.end=S,this._selectionState.columnSelectMode=k,(M=this._renderer.value)==null||M.handleSelectionChanged(m,S,k)}handleCursorMove(){var m;(m=this._renderer.value)==null||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)==null||m.clear()}};a.RenderService=v=h([g(2,y.IOptionsService),g(3,b.ICharSizeService),g(4,y.IDecorationService),g(5,y.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],v)},9312:function(f,a,c){var h=this&&this.__decorate||function(E,L,O,I){var F,U=arguments.length,W=U<3?L:I===null?I=Object.getOwnPropertyDescriptor(L,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,L,O,I);else for(var Y=E.length-1;Y>=0;Y--)(F=E[Y])&&(W=(U<3?F(W):U>3?F(L,O,W):F(L,O))||W);return U>3&&W&&Object.defineProperty(L,O,W),W},g=this&&this.__param||function(E,L){return function(O,I){L(O,I,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),b=c(9504),C=c(456),A=c(4725),x=c(8460),y=c(844),v=c(6114),m=c(4841),S=c(511),k=c(2585),M=" ",R=new RegExp(M,"g");let D=a.SelectionService=class extends y.Disposable{constructor(E,L,O,I,F,U,W,Y,V){super(),this._element=E,this._screenElement=L,this._linkifier=O,this._bufferService=I,this._coreService=F,this._mouseService=U,this._optionsService=W,this._renderService=Y,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 x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=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 C.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 E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!E||!L||E[0]===L[0]&&E[1]===L[1])}get selectionText(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!E||!L)return"";const O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===L[0])return"";const F=E[0]<L[0]?E[0]:L[0],U=E[0]<L[0]?L[0]:E[0];for(let W=E[1];W<=L[1];W++){const Y=O.translateBufferLineToString(W,!0,F,U);I.push(Y)}}else{const F=E[1]===L[1]?L[0]:void 0;I.push(O.translateBufferLineToString(E[1],!0,E[0],F));for(let U=E[1]+1;U<=L[1]-1;U++){const W=O.lines.get(U),Y=O.translateBufferLineToString(U,!0);W!=null&&W.isWrapped?I[I.length-1]+=Y:I.push(Y)}if(E[1]!==L[1]){const U=O.lines.get(L[1]),W=O.translateBufferLineToString(L[1],!0,0,L[0]);U&&U.isWrapped?I[I.length-1]+=W:I.push(W)}}return I.map((F=>F.replace(R," "))).join(v.isWindows?`\r
56
56
  `:`
57
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&E&&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(E){const L=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(O&&I&&L)&&this._areCoordsInSelection(L,O,I)}isCellInSelection(E,L){const O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!O||!I)&&this._areCoordsInSelection([E,L],O,I)}_areCoordsInSelection(E,L,O){return E[1]>L[1]&&E[1]<O[1]||L[1]===O[1]&&E[1]===L[1]&&E[0]>=L[0]&&E[0]<O[0]||L[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||L[1]<O[1]&&E[1]===L[1]&&E[0]>=L[0]}_selectWordAtCursor(E,L){var F,U;const O=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,L){this._model.clearSelection(),E=Math.max(E,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const L=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(E){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=O?0:(L>O&&(L-=O),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(E){return v.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const L=this._getMouseBufferCoords(E);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(E){return E.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const I=O.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const L=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const I=(0,b.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,O=!(!E||!L||E[0]===L[0]&&E[1]===L[1]);O?E&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,L,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,L,O)}_fireOnSelectionChange(E,L,O){this._oldSelectionStart=E,this._oldSelectionEnd=L,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(E,L){let O=L;for(let I=0;L>=I;I++){const F=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:F>1&&L!==I&&(O+=F-1)}return O}setSelection(E,L,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,L],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,L,O=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(E[1]);if(!U)return;const W=F.translateBufferLineToString(E[1],!1);let Y=this._convertViewportColToCharacterIndex(U,E[0]),V=Y;const K=E[0]-Y;let J=0,z=0,j=0,H=0;if(W.charAt(Y)===" "){for(;Y>0&&W.charAt(Y-1)===" ";)Y--;for(;V<W.length&&W.charAt(V+1)===" ";)V++}else{let Z=E[0],ue=E[0];U.getWidth(Z)===0&&(J++,Z--),U.getWidth(ue)===2&&(z++,ue++);const ve=U.getString(ue).length;for(ve>1&&(H+=ve-1,V+=ve-1);Z>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(Z-1,this._workCell));){U.loadCell(Z-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,Z--):X>1&&(j+=X-1,Y-=X-1),Y--,Z--}for(;ue<U.length&&V+1<W.length&&!this._isCharWordSeparator(U.loadCell(ue+1,this._workCell));){U.loadCell(ue+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ue++):X>1&&(H+=X-1,V+=X-1),V++,ue++}}V++;let G=Y+K-J+j,N=Math.min(this._bufferService.cols,V-Y+J+z-j-H);if(L||W.slice(Y,V).trim()!==""){if(O&&G===0&&U.getCodePoint(0)!==32){const Z=F.lines.get(E[1]-1);if(Z&&U.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(ue){const ve=this._bufferService.cols-ue.start;G-=ve,N+=ve}}}if(I&&G+N===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const Z=F.lines.get(E[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ue=this._getWordAt([0,E[1]+1],!1,!1,!0);ue&&(N+=ue.length)}}return{start:G,length:N}}}_selectWordAt(E,L){const O=this._getWordAt(E,L);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[O.start,E[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(E){const L=this._getWordAt(E,!0);if(L){let O=E[1];for(;L.start<0;)L.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const L=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(O,this._bufferService.cols)}};a.SelectionService=D=h([g(3,k.IBufferService),g(4,k.ICoreService),g(5,A.IMouseService),g(6,k.IOptionsService),g(7,A.IRenderService),g(8,A.ICoreBrowserService)],D)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(D,E,L,O){var I,F=arguments.length,U=F<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,L):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,E,L,O);else for(var W=D.length-1;W>=0;W--)(I=D[W])&&(U=(F<3?I(U):F>3?I(E,L,U):I(E,L))||U);return F>3&&U&&Object.defineProperty(E,L,U),U},g=this&&this.__param||function(D,E){return function(L,O){E(L,O,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),C=c(8460),A=c(844),x=c(2585),y=b.css.toColor("#ffffff"),v=b.css.toColor("#000000"),m=b.css.toColor("#ffffff"),S=b.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[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")],E=[0,95,135,175,215,255];for(let L=0;L<216;L++){const O=E[L/36%6|0],I=E[L/6%6|0],F=E[L%6];D.push({css:b.channels.toCss(O,I,F),rgba:b.channels.toRgba(O,I,F)})}for(let L=0;L<24;L++){const O=8+10*L;D.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return D})());let M=a.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:v,cursor:m,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:b.color.blend(v,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:b.color.blend(v,k),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const E=this._colors;if(E.foreground=R(D.foreground,y),E.background=R(D.background,v),E.cursor=R(D.cursor,m),E.cursorAccent=R(D.cursorAccent,S),E.selectionBackgroundTransparent=R(D.selectionBackground,k),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?R(D.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=R(D.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=R(D.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=R(D.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=R(D.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=R(D.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=R(D.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=R(D.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=R(D.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=R(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=R(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=R(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=R(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=R(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=R(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=R(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=R(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const L=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let O=0;O<L;O++)E.ansi[O+16]=R(D.extendedAnsi[O],a.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,E){if(D!==void 0)try{return b.css.toColor(D)}catch{}return E}a.ThemeService=M=h([g(0,x.IOptionsService)],M)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),g=c(844);class u extends g.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const A=new Array(C);for(let x=0;x<Math.min(C,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let A=this._length;A<C;A++)this._array[A]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,A){this._array[this._getCyclicIndex(C)]=A}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,A,...x){if(A){for(let y=C;y<this._length-A;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+A)];this._length-=A,this.onDeleteEmitter.fire({index:C,amount:A})}for(let y=this._length-1;y>=C;y--)this._array[this._getCyclicIndex(y+x.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<x.length;y++)this._array[this._getCyclicIndex(C+y)]=x[y];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const y=this._length+x.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,A,x){if(!(A<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let v=A-1;v>=0;v--)this.set(C+v+x,this.get(C+v));const y=C+A+x-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<A;y++)this.set(C+y+x,this.get(C+y))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}a.CircularList=u},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,g=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const b in h)u[b]=g<=1?h[b]:h[b]&&c(h[b],g-1);return u}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,g=0,u=0;var b,C,A,x,y;function v(S){const k=S.toString(16);return k.length<2?"0"+k:k}function m(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,M,R,D){return D!==void 0?`#${v(k)}${v(M)}${v(R)}${v(D)}`:`#${v(k)}${v(M)}${v(R)}`},S.toRgba=function(k,M,R,D=255){return(k<<24|M<<16|R<<8|D)>>>0},S.toColor=function(k,M,R,D){return{css:S.toCss(k,M,R,D),rgba:S.toRgba(k,M,R,D)}}})(b||(a.channels=b={})),(function(S){function k(M,R){return u=Math.round(255*R),[c,h,g]=y.toChannels(M.rgba),{css:b.toCss(c,h,g,u),rgba:b.toRgba(c,h,g,u)}}S.blend=function(M,R){if(u=(255&R.rgba)/255,u===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,E=R.rgba>>16&255,L=R.rgba>>8&255,O=M.rgba>>24&255,I=M.rgba>>16&255,F=M.rgba>>8&255;return c=O+Math.round((D-O)*u),h=I+Math.round((E-I)*u),g=F+Math.round((L-F)*u),{css:b.toCss(c,h,g),rgba:b.toRgba(c,h,g)}},S.isOpaque=function(M){return(255&M.rgba)==255},S.ensureContrastRatio=function(M,R,D){const E=y.ensureContrastRatio(M.rgba,R.rgba,D);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},S.opaque=function(M){const R=(255|M.rgba)>>>0;return[c,h,g]=y.toChannels(R),{css:b.toCss(c,h,g),rgba:R}},S.opacity=k,S.multiplyOpacity=function(M,R){return u=255&M.rgba,k(M,u*R/255)},S.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(C||(a.color=C={})),(function(S){let k,M;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(k=D,k.globalCompositeOperation="copy",M=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),b.toColor(c,h,g);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),u=parseInt(R.slice(4,5).repeat(2),16),b.toColor(c,h,g,u);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),h=parseInt(D[2]),g=parseInt(D[3]),u=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),b.toColor(c,h,g,u);if(!k||!M)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=M,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,g,u]=k.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,h,g,u),css:R}}})(A||(a.css=A={})),(function(S){function k(M,R,D){const E=M/255,L=R/255,O=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}S.relativeLuminance=function(M){return k(M>>16&255,M>>8&255,255&M)},S.relativeLuminance2=k})(x||(a.rgb=x={})),(function(S){function k(R,D,E){const L=R>>24&255,O=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));for(;Y<E&&(F>0||U>0||W>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),W-=Math.max(0,Math.ceil(.1*W)),Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));return(F<<24|U<<16|W<<8|255)>>>0}function M(R,D,E){const L=R>>24&255,O=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));for(;Y<E&&(F<255||U<255||W<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));return(F<<24|U<<16|W<<8|255)>>>0}S.blend=function(R,D){if(u=(255&D)/255,u===1)return D;const E=D>>24&255,L=D>>16&255,O=D>>8&255,I=R>>24&255,F=R>>16&255,U=R>>8&255;return c=I+Math.round((E-I)*u),h=F+Math.round((L-F)*u),g=U+Math.round((O-U)*u),b.toRgba(c,h,g)},S.ensureContrastRatio=function(R,D,E){const L=x.relativeLuminance(R>>8),O=x.relativeLuminance(D>>8);if(m(L,O)<E){if(O<L){const U=k(R,D,E),W=m(L,x.relativeLuminance(U>>8));if(W<E){const Y=M(R,D,E);return W>m(L,x.relativeLuminance(Y>>8))?U:Y}return U}const I=M(R,D,E),F=m(L,x.relativeLuminance(I>>8));if(F<E){const U=k(R,D,E);return F>m(L,x.relativeLuminance(U>>8))?I:U}return I}},S.reduceLuminance=k,S.increaseLuminance=M,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(y||(a.rgba=y={})),a.toPaddedHex=v,a.contrastRatio=m},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),g=c(2585),u=c(4348),b=c(7866),C=c(744),A=c(7302),x=c(6975),y=c(8460),v=c(1753),m=c(1480),S=c(7994),k=c(9282),M=c(5435),R=c(5981),D=c(2660);let E=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((I=>{var F;(F=this._onScrollApi)==null||F.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const F in I)this.optionsService.options[F]=I[F]}constructor(I){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 A.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.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((F=>{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((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,F){this._writeBuffer.write(I,F)}writeSync(I,F){this._logService.logLevel<=g.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,F)}input(I,F=!0){this.coreService.triggerDataEvent(I,F)}resize(I,F){isNaN(I)||isNaN(F)||(I=Math.max(I,C.MINIMUM_COLS),F=Math.max(F,C.MINIMUM_ROWS),this._bufferService.resize(I,F))}scroll(I,F=!1){this._bufferService.scroll(I,F)}scrollLines(I,F,U){this._bufferService.scrollLines(I,F,U)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const F=I-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(I,F){return this._inputHandler.registerEscHandler(I,F)}registerDcsHandler(I,F){return this._inputHandler.registerDcsHandler(I,F)}registerCsiHandler(I,F){return this._inputHandler.registerCsiHandler(I,F)}registerOscHandler(I,F){return this._inputHandler.registerOscHandler(I,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?I=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of I)F.dispose()}))}}}a.CoreTerminal=L},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((g=>h.fire(g)))},a.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(J,z,j,H){var G,N=arguments.length,Z=N<3?z:H===null?H=Object.getOwnPropertyDescriptor(z,j):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(J,z,j,H);else for(var ue=J.length-1;ue>=0;ue--)(G=J[ue])&&(Z=(N<3?G(Z):N>3?G(z,j,Z):G(z,j))||Z);return N>3&&Z&&Object.defineProperty(z,j,Z),Z},g=this&&this.__param||function(J,z){return function(j,H){z(j,H,J)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),C=c(2015),A=c(844),x=c(482),y=c(8437),v=c(8460),m=c(643),S=c(511),k=c(3734),M=c(2585),R=c(1480),D=c(6242),E=c(6351),L=c(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function F(J,z){if(J>24)return z.setWinLines||!1;switch(J){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 U;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(a.WindowsOptionsReportType=U={}));let W=0;class Y extends A.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,H,G,N,Z,ue,ve,X=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=H,this._logService=G,this._optionsService=N,this._oscLinkService=Z,this._coreMouseService=ue,this._unicodeService=ve,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new S.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 v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,fe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:fe.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,fe,ce)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:fe,data:ce})})),this._parser.setDcsHandlerFallback(((q,fe,ce)=>{fe==="HOOK"&&(ce=ce.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:fe,payload:ce})})),this._parser.setPrintHandler(((q,fe,ce)=>this.print(q,fe,ce))),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 D.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new D.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new D.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new D.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new D.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new D.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new D.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new D.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new D.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new D.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new D.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 E.DcsHandler(((q,fe)=>this.requestStatusString(q,fe))))}_preserveStack(z,j,H,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=H,this._parseStack.position=G}_logSlowResolvingAsync(z){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,H)=>setTimeout((()=>H("#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 H,G=this._activeBuffer.x,N=this._activeBuffer.y,Z=0;const ue=this._parseStack.paused;if(ue){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(H),H;G=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>I&&(Z=this._parseStack.position+I)}if(this._logService.logLevel<=M.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<I&&(this._parseBuffer=new Uint32Array(Math.min(z.length,I))),ue||this._dirtyRowTracker.clearRange(),z.length>I)for(let q=Z;q<z.length;q+=I){const fe=q+I<z.length?q+I:z.length,ce=typeof z=="string"?this._stringDecoder.decode(z.substring(q,fe),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,fe),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,ce))return this._preserveStack(G,N,ce,q),this._logSlowResolvingAsync(H),H}else if(!ue){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,q))return this._preserveStack(G,N,q,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===G&&this._activeBuffer.y===N||this._onCursorMove.fire();const ve=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ve,this._bufferService.rows-1))}print(z,j,H){let G,N;const Z=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,ve=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,fe=this._curAttrData;let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&H-j>0&&ce.getWidth(this._activeBuffer.x-1)===2&&ce.setCellFromCodepoint(this._activeBuffer.x-1,0,1,fe);let de=this._parser.precedingJoinState;for(let re=j;re<H;++re){if(G=z[re],G<127&&Z){const dt=Z[String.fromCharCode(G)];dt&&(G=dt.charCodeAt(0))}const Ce=this._unicodeService.charProperties(G,de);N=R.UnicodeService.extractWidth(Ce);const Ee=R.UnicodeService.extractShouldJoin(Ce),xe=Ee?R.UnicodeService.extractWidth(de):0;if(de=Ce,ue&&this._onA11yChar.fire((0,x.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-xe>ve){if(X){const dt=ce;let Re=this._activeBuffer.x-xe;for(this._activeBuffer.x=xe,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),ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),xe>0&&ce instanceof y.BufferLine&&ce.copyCellsFrom(dt,Re,0,xe,!1);Re<ve;)dt.setCellFromCodepoint(Re++,0,1,fe)}else if(this._activeBuffer.x=ve-1,N===2)continue}if(Ee&&this._activeBuffer.x){const dt=ce.getWidth(this._activeBuffer.x-1)?1:2;ce.addCodepointToCell(this._activeBuffer.x-dt,G,N);for(let Re=N-xe;--Re>=0;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,fe)}else if(q&&(ce.insertCells(this._activeBuffer.x,N-xe,this._activeBuffer.getNullCell(fe)),ce.getWidth(ve-1)===2&&ce.setCellFromCodepoint(ve-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,fe)),ce.setCellFromCodepoint(this._activeBuffer.x++,G,N,fe),N>0)for(;--N;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,fe)}this._parser.precedingJoinState=de,this._activeBuffer.x<ve&&H-j>0&&ce.getWidth(this._activeBuffer.x)===0&&!ce.hasContent(this._activeBuffer.x)&&ce.setCellFromCodepoint(this._activeBuffer.x,0,1,fe),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,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||j(H)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new E.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new D.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,H,G=!1,N=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Z.replaceCells(j,H,this._activeBuffer.getNullCell(this._eraseAttrData()),N),G&&(Z.isWrapped=!1)}_resetBufferLine(z,j=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),H.isWrapped=!1)}eraseInDisplay(z,j=!1){let H;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);H<this._bufferService.rows;H++)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(H);break;case 1:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(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 H=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;j--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(H,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 H=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;j--;)this._activeBuffer.lines.splice(H,1),this._activeBuffer.lines.splice(G,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=z.params[0]||1,G=R.UnicodeService.extractWidth(j),N=this._activeBuffer.x-G,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),ue=new Uint32Array(Z.length*H);let ve=0;for(let q=0;q<Z.length;){const fe=Z.codePointAt(q)||0;ue[ve++]=fe,q+=fe>65535?2:1}let X=ve;for(let q=1;q<H;++q)ue.copyWithin(X,0,ve),X+=ve;return this.print(ue,0,X),!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 H=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:N}=this._coreMouseService,Z=this._coreService,{buffers:ue,cols:ve}=this._bufferService,{active:X,alt:q}=ue,fe=this._optionsService.rawOptions,ce=Ee=>Ee?1:2,de=z.params[0];return re=de,Ce=j?de===2?4:de===4?ce(Z.modes.insertMode):de===12?3:de===20?ce(fe.convertEol):0:de===1?ce(H.applicationCursorKeys):de===3?fe.windowOptions.setWinLines?ve===80?2:ve===132?1:0:0:de===6?ce(H.origin):de===7?ce(H.wraparound):de===8?3:de===9?ce(G==="X10"):de===12?ce(fe.cursorBlink):de===25?ce(!Z.isCursorHidden):de===45?ce(H.reverseWraparound):de===66?ce(H.applicationKeypad):de===67?4:de===1e3?ce(G==="VT200"):de===1002?ce(G==="DRAG"):de===1003?ce(G==="ANY"):de===1004?ce(H.sendFocus):de===1005?4:de===1006?ce(N==="SGR"):de===1015?4:de===1016?ce(N==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ce(X===q):de===2004?ce(H.bracketedPasteMode):0,Z.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${re};${Ce}$y`),!0;var re,Ce}_updateAttrColor(z,j,H,G,N){return j===2?(z|=50331648,z&=-16777216,z|=k.AttributeData.fromColorRGB([H,G,N])):j===5&&(z&=-50331904,z|=33554432|255&H),z}_extractColor(z,j,H){const G=[0,0,-1,0,0,0];let N=0,Z=0;do{if(G[Z+N]=z.params[j+Z],z.hasSubParams(j+Z)){const ue=z.getSubParams(j+Z);let ve=0;do G[1]===5&&(N=1),G[Z+ve+1+N]=ue[ve];while(++ve<ue.length&&ve+Z+1+N<G.length);break}if(G[1]===5&&Z+N>=2||G[1]===2&&Z+N>=5)break;G[1]&&(N=1)}while(++Z+j<z.length&&Z+N<G.length);for(let ue=2;ue<G.length;++ue)G[ue]===-1&&(G[ue]=0);switch(G[0]){case 38:H.fg=this._updateAttrColor(H.fg,G[1],G[3],G[4],G[5]);break;case 48:H.bg=this._updateAttrColor(H.bg,G[1],G[3],G[4],G[5]);break;case 58:H.extended=H.extended.clone(),H.extended.underlineColor=this._updateAttrColor(H.extended.underlineColor,G[1],G[3],G[4],G[5])}return Z}_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 H;const G=this._curAttrData;for(let N=0;N<j;N++)H=z.params[N],H>=30&&H<=37?(G.fg&=-50331904,G.fg|=16777216|H-30):H>=40&&H<=47?(G.bg&=-50331904,G.bg|=16777216|H-40):H>=90&&H<=97?(G.fg&=-50331904,G.fg|=16777224|H-90):H>=100&&H<=107?(G.bg&=-50331904,G.bg|=16777224|H-100):H===0?this._processSGR0(G):H===1?G.fg|=134217728:H===3?G.bg|=67108864:H===4?(G.fg|=268435456,this._processUnderline(z.hasSubParams(N)?z.getSubParams(N)[0]:1,G)):H===5?G.fg|=536870912:H===7?G.fg|=67108864:H===8?G.fg|=1073741824:H===9?G.fg|=2147483648:H===2?G.bg|=134217728:H===21?this._processUnderline(2,G):H===22?(G.fg&=-134217729,G.bg&=-134217729):H===23?G.bg&=-67108865:H===24?(G.fg&=-268435457,this._processUnderline(0,G)):H===25?G.fg&=-536870913:H===27?G.fg&=-67108865:H===28?G.fg&=-1073741825:H===29?G.fg&=2147483647:H===39?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):H===49?(G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?N+=this._extractColor(z,N,G):H===53?G.bg|=1073741824:H===55?G.bg&=-1073741825:H===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):H===100?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);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,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${H}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${H}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 H=j%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(z){const j=z.params[0]||1;let H;return(z.length<2||(H=z.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(z){if(!F(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(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.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=[],H=z.split(";");for(;H.length>1;){const G=H.shift(),N=H.shift();if(/^\d+$/.exec(G)){const Z=parseInt(G);if(K(Z))if(N==="?")j.push({type:0,index:Z});else{const ue=(0,L.parseColor)(N);ue&&j.push({type:1,index:Z,color:ue})}}}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 H=z.split(":");let G;const N=H.findIndex((Z=>Z.startsWith("id=")));return N!==-1&&(G=H[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,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 H=z.split(";");for(let G=0;G<H.length&&!(j>=this._specialColors.length);++G,++j)if(H[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const N=(0,L.parseColor)(H[G]);N&&this._onColor.fire([{type:1,index:this._specialColors[j],color:N}])}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=[],H=z.split(";");for(let G=0;G<H.length;++G)if(/^\d+$/.exec(H[G])){const N=parseInt(H[G]);K(N)&&j.push({type:2,index:N})}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(O[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=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 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 H=this._activeBuffer.ybase+this._activeBuffer.y+j,G=this._activeBuffer.lines.get(H);G&&(G.fill(z),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const H=this._bufferService.buffer,G=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}a.InputHandler=Y;let V=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){J<this.start?this.start=J:J>this.end&&(this.end=J)}markRangeDirty(J,z){J>z&&(W=J,J=z,z=W),J<this.start&&(this.start=J),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(J){return 0<=J&&J<256}V=h([g(0,M.IBufferService)],V)},844:(f,a)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,u,b){this._data[g]||(this._data[g]={}),this._data[g][u]=b}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,g,u,b,C){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(u,b,C)}get(h,g,u,b){var C;return(C=this._data.get(h,g))==null?void 0:C.get(u,b)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)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])===g);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,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,u=this._array.length-1;for(;u>=g;){let b=g+u>>1;const C=this._getKey(this._array[b]);if(C>h)u=b-1;else{if(!(C<h)){for(;b>0&&this._getKey(this._array[b-1])===h;)b--;return b}g=b+1}}return g}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let A=0,x=0,y=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),v=C.timeRemaining(),1.5*x>v)return y-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-A))}ms`),void this._start();y=v}this.clear()}}class u extends g{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const A=Date.now()+C;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),b=u==null?void 0:u.get(g.cols-1),C=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);C&&b&&(C.isWrapped=b[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&b[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,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}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),u=c(3734),b=c(8437),C=c(4634),A=c(511),x=c(643),y=c(4863),v=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(m,S,k){this._hasScrollback=m,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.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(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,S){return new b.BufferLine(this._bufferService.cols,this.getNullCell(m),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const S=m+this._optionsService.rawOptions.scrollback;return S>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:S}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=b.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(m))}}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(m,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA);let M=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<m)for(let E=0;E<this.lines.length;E++)M+=+this.lines.get(E).resize(m,k);let D=0;if(this._rows<S)for(let E=this._rows;E<S;E++)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(m,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(m,k)));else for(let E=this._rows;E>S;E--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const E=this.lines.length-R;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=R}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,S-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(m,S),this._cols>m))for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(m,k);this._cols=m,this._rows=S,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,S){this._cols!==m&&(m>this._cols?this._reflowLarger(m,S):this._reflowSmaller(m,S))}_reflowLarger(m,S){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(k.length>0){const M=(0,C.reflowLargerCreateNewLayout)(this.lines,k);(0,C.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(m,S,M.countRemoved)}}_reflowLargerAdjustViewport(m,S,k){const M=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new b.BufferLine(m,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(m,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA),M=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=m)continue;const L=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),L.unshift(E);const O=this.ybase+this.y;if(O>=D&&O<D+L.length)continue;const I=L[L.length-1].getTrimmedLength(),F=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,m),U=F.length-L.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const Y=[];for(let H=0;H<U;H++){const G=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);Y.push(G)}Y.length>0&&(M.push({start:D+L.length+R,newLines:Y}),R+=Y.length),L.push(...Y);let V=F.length-1,K=F[V];K===0&&(V--,K=F[V]);let J=L.length-U-1,z=I;for(;J>=0;){const H=Math.min(z,K);if(L[V]===void 0)break;if(L[V].copyCellsFrom(L[J],z-H,K-H,H,!0),K-=H,K===0&&(V--,K=F[V]),z-=H,z===0){J--;const G=Math.max(J,0);z=(0,C.getWrappedLineTrimmedLength)(L,G,this._cols)}}for(let H=0;H<L.length;H++)F[H]<m&&L[H].setCell(F[H],k);let j=U-W;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+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+S-1)}if(M.length>0){const D=[],E=[];for(let V=0;V<this.lines.length;V++)E.push(this.lines.get(V));const L=this.lines.length;let O=L-1,I=0,F=M[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let U=0;for(let V=Math.min(this.lines.maxLength-1,L+R-1);V>=0;V--)if(F&&F.start>O+U){for(let K=F.newLines.length-1;K>=0;K--)this.lines.set(V--,F.newLines[K]);V++,D.push({index:O+1,amount:F.newLines.length}),U+=F.newLines.length,F=M[++I]}else this.lines.set(V,E[O--]);let W=0;for(let V=D.length-1;V>=0;V--)D[V].index+=W,this.lines.onInsertEmitter.fire(D[V]),W+=D[V].amount;const Y=Math.max(0,L+R-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(m,S,k=0,M){const R=this.lines.get(m);return R?R.translateToString(S,k,M):""}getWrappedRangeForLine(m){let S=m,k=m;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===m&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const S=new y.Marker(m);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),u=c(643),b=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class A{constructor(y,v,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const S=v||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let k=0;k<y;++k)this.setCell(k,S);this.length=y}get(y){const v=this._data[3*y+0],m=2097151&v;return[this._data[3*y+1],2097152&v?this._combined[y]:m?(0,b.stringFromCodePoint)(m):"",v>>22,2097152&v?this._combined[y].charCodeAt(this._combined[y].length-1):m]}set(y,v){this._data[3*y+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=v[1],this._data[3*y+0]=2097152|y|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[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 v=this._data[3*y+0];return 2097152&v?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&v}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const v=this._data[3*y+0];return 2097152&v?this._combined[y]:2097151&v?(0,b.stringFromCodePoint)(2097151&v):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,v){return C=3*y,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[y]),268435456&v.bg&&(v.extended=this._extendedAttrs[y]),v}setCell(y,v){2097152&v.content&&(this._combined[y]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[y]=v.extended),this._data[3*y+0]=v.content,this._data[3*y+1]=v.fg,this._data[3*y+2]=v.bg}setCellFromCodepoint(y,v,m,S){268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=v|m<<22,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}addCodepointToCell(y,v,m){let S=this._data[3*y+0];2097152&S?this._combined[y]+=(0,b.stringFromCodePoint)(v):2097151&S?(this._combined[y]=(0,b.stringFromCodePoint)(2097151&S)+(0,b.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,m&&(S&=-12582913,S|=m<<22),this._data[3*y+0]=S}insertCells(y,v,m){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length-y){const S=new g.CellData;for(let k=this.length-y-v-1;k>=0;--k)this.setCell(y+v+k,this.loadCell(y+k,S));for(let k=0;k<v;++k)this.setCell(y+k,m)}else for(let S=y;S<this.length;++S)this.setCell(S,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(y,v,m){if(y%=this.length,v<this.length-y){const S=new g.CellData;for(let k=0;k<this.length-y-v;++k)this.setCell(y+k,this.loadCell(y+v+k,S));for(let k=this.length-v;k<this.length;++k)this.setCell(k,m)}else for(let S=y;S<this.length;++S)this.setCell(S,m);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,m)}replaceCells(y,v,m,S=!1){if(S)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,m);y<v&&y<this.length;)this.isProtected(y)||this.setCell(y,m),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,m);y<v&&y<this.length;)this.setCell(y++,m)}resize(y,v){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const S=new Uint32Array(m);S.set(this._data),this._data=S}for(let S=this.length;S<y;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,m);const S=Object.keys(this._combined);for(let M=0;M<S.length;M++){const R=parseInt(S[M],10);R>=y&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let M=0;M<k.length;M++){const R=parseInt(k[M],10);R>=y&&delete this._extendedAttrs[R]}}return this.length=y,4*m*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,v=!1){if(v)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,y);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,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 v in y._combined)this._combined[v]=y._combined[v];this._extendedAttrs={};for(const v in y._extendedAttrs)this._extendedAttrs[v]=y._extendedAttrs[v];this.isWrapped=y.isWrapped}clone(){const y=new A(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const v in this._combined)y._combined[v]=this._combined[v];for(const v in this._extendedAttrs)y._extendedAttrs[v]=this._extendedAttrs[v];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,v,m,S,k){const M=y._data;if(k)for(let D=S-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(v+D)+E];268435456&M[3*(v+D)+2]&&(this._extendedAttrs[m+D]=y._extendedAttrs[v+D])}else for(let D=0;D<S;D++){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(v+D)+E];268435456&M[3*(v+D)+2]&&(this._extendedAttrs[m+D]=y._extendedAttrs[v+D])}const R=Object.keys(y._combined);for(let D=0;D<R.length;D++){const E=parseInt(R[D],10);E>=v&&(this._combined[E-v+m]=y._combined[E])}}translateToString(y,v,m,S){v=v??0,m=m??this.length,y&&(m=Math.min(m,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;v<m;){const M=this._data[3*v+0],R=2097151&M,D=2097152&M?this._combined[v]:R?(0,b.stringFromCodePoint)(R):u.WHITESPACE_CELL_CHAR;if(k+=D,S)for(let E=0;E<D.length;++E)S.push(v);v+=M>>22||1}return S&&S.push(v),k}}a.BufferLine=A},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,g,u){if(g===h.length-1)return h[g].getTrimmedLength();const b=!h[g].hasContent(u-1)&&h[g].getWidth(u-1)===1,C=h[g+1].getWidth(0)===2;return b&&C?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,g,u,b,C){const A=[];for(let x=0;x<h.length-1;x++){let y=x,v=h.get(++y);if(!v.isWrapped)continue;const m=[h.get(x)];for(;y<h.length&&v.isWrapped;)m.push(v),v=h.get(++y);if(b>=x&&b<y){x+=m.length-1;continue}let S=0,k=c(m,S,g),M=1,R=0;for(;M<m.length;){const E=c(m,M,g),L=E-R,O=u-k,I=Math.min(L,O);m[S].copyCellsFrom(m[M],R,k,I,!1),k+=I,k===u&&(S++,k=0),R+=I,R===E&&(M++,R=0),k===0&&S!==0&&m[S-1].getWidth(u-1)===2&&(m[S].copyCellsFrom(m[S-1],u-1,k++,1,!1),m[S-1].setCell(u-1,C))}m[S].replaceCells(k,u,C);let D=0;for(let E=m.length-1;E>0&&(E>S||m[E].getTrimmedLength()===0);E--)D++;D>0&&(A.push(x+m.length-D),A.push(D)),x+=m.length-1}return A},a.reflowLargerCreateNewLayout=function(h,g){const u=[];let b=0,C=g[b],A=0;for(let x=0;x<h.length;x++)if(C===x){const y=g[++b];h.onDeleteEmitter.fire({index:x-A,amount:y}),x+=y-1,A+=y,C=g[++b]}else u.push(x);return{layout:u,countRemoved:A}},a.reflowLargerApplyNewLayout=function(h,g){const u=[];for(let b=0;b<g.length;b++)u.push(h.get(g[b]));for(let b=0;b<u.length;b++)h.set(b,u[b]);h.length=g.length},a.reflowSmallerGetNewLineLengths=function(h,g,u){const b=[],C=h.map(((v,m)=>c(h,m,g))).reduce(((v,m)=>v+m));let A=0,x=0,y=0;for(;y<C;){if(C-y<u){b.push(C-y);break}A+=u;const v=c(h,x,g);A>v&&(A-=v,x++);const m=h[x].getWidth(A-1)===2;m&&A--;const S=m?u-1:u;b.push(S),y+=S}return b},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),g=c(844),u=c(9092);class b extends g.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}a.BufferSet=b},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),g=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(A){const x=new b;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[g.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[g.CHAR_DATA_CHAR_INDEX].length===2){const y=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const v=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(y-55296)+v-56320+65536|A[g.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[g.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=b},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),g=c(844);class u{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}a.Marker=u,u._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
57
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&E&&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(E){const L=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(O&&I&&L)&&this._areCoordsInSelection(L,O,I)}isCellInSelection(E,L){const O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!O||!I)&&this._areCoordsInSelection([E,L],O,I)}_areCoordsInSelection(E,L,O){return E[1]>L[1]&&E[1]<O[1]||L[1]===O[1]&&E[1]===L[1]&&E[0]>=L[0]&&E[0]<O[0]||L[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||L[1]<O[1]&&E[1]===L[1]&&E[0]>=L[0]}_selectWordAtCursor(E,L){var F,U;const O=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,L){this._model.clearSelection(),E=Math.max(E,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const L=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(E){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=O?0:(L>O&&(L-=O),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(E){return v.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const L=this._getMouseBufferCoords(E);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(E){return E.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const I=O.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const L=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const I=(0,b.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,O=!(!E||!L||E[0]===L[0]&&E[1]===L[1]);O?E&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,L,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,L,O)}_fireOnSelectionChange(E,L,O){this._oldSelectionStart=E,this._oldSelectionEnd=L,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(E,L){let O=L;for(let I=0;L>=I;I++){const F=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:F>1&&L!==I&&(O+=F-1)}return O}setSelection(E,L,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,L],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,L,O=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(E[1]);if(!U)return;const W=F.translateBufferLineToString(E[1],!1);let Y=this._convertViewportColToCharacterIndex(U,E[0]),V=Y;const K=E[0]-Y;let J=0,z=0,j=0,H=0;if(W.charAt(Y)===" "){for(;Y>0&&W.charAt(Y-1)===" ";)Y--;for(;V<W.length&&W.charAt(V+1)===" ";)V++}else{let Z=E[0],ue=E[0];U.getWidth(Z)===0&&(J++,Z--),U.getWidth(ue)===2&&(z++,ue++);const ve=U.getString(ue).length;for(ve>1&&(H+=ve-1,V+=ve-1);Z>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(Z-1,this._workCell));){U.loadCell(Z-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,Z--):X>1&&(j+=X-1,Y-=X-1),Y--,Z--}for(;ue<U.length&&V+1<W.length&&!this._isCharWordSeparator(U.loadCell(ue+1,this._workCell));){U.loadCell(ue+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ue++):X>1&&(H+=X-1,V+=X-1),V++,ue++}}V++;let G=Y+K-J+j,N=Math.min(this._bufferService.cols,V-Y+J+z-j-H);if(L||W.slice(Y,V).trim()!==""){if(O&&G===0&&U.getCodePoint(0)!==32){const Z=F.lines.get(E[1]-1);if(Z&&U.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(ue){const ve=this._bufferService.cols-ue.start;G-=ve,N+=ve}}}if(I&&G+N===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const Z=F.lines.get(E[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ue=this._getWordAt([0,E[1]+1],!1,!1,!0);ue&&(N+=ue.length)}}return{start:G,length:N}}}_selectWordAt(E,L){const O=this._getWordAt(E,L);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[O.start,E[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(E){const L=this._getWordAt(E,!0);if(L){let O=E[1];for(;L.start<0;)L.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const L=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(O,this._bufferService.cols)}};a.SelectionService=D=h([g(3,k.IBufferService),g(4,k.ICoreService),g(5,A.IMouseService),g(6,k.IOptionsService),g(7,A.IRenderService),g(8,A.ICoreBrowserService)],D)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(D,E,L,O){var I,F=arguments.length,U=F<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,L):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,E,L,O);else for(var W=D.length-1;W>=0;W--)(I=D[W])&&(U=(F<3?I(U):F>3?I(E,L,U):I(E,L))||U);return F>3&&U&&Object.defineProperty(E,L,U),U},g=this&&this.__param||function(D,E){return function(L,O){E(L,O,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),C=c(8460),A=c(844),x=c(2585),y=b.css.toColor("#ffffff"),v=b.css.toColor("#000000"),m=b.css.toColor("#ffffff"),S=b.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[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")],E=[0,95,135,175,215,255];for(let L=0;L<216;L++){const O=E[L/36%6|0],I=E[L/6%6|0],F=E[L%6];D.push({css:b.channels.toCss(O,I,F),rgba:b.channels.toRgba(O,I,F)})}for(let L=0;L<24;L++){const O=8+10*L;D.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return D})());let M=a.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:v,cursor:m,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:b.color.blend(v,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:b.color.blend(v,k),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const E=this._colors;if(E.foreground=R(D.foreground,y),E.background=R(D.background,v),E.cursor=R(D.cursor,m),E.cursorAccent=R(D.cursorAccent,S),E.selectionBackgroundTransparent=R(D.selectionBackground,k),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?R(D.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=R(D.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=R(D.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=R(D.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=R(D.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=R(D.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=R(D.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=R(D.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=R(D.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=R(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=R(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=R(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=R(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=R(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=R(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=R(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=R(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const L=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let O=0;O<L;O++)E.ansi[O+16]=R(D.extendedAnsi[O],a.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,E){if(D!==void 0)try{return b.css.toColor(D)}catch{}return E}a.ThemeService=M=h([g(0,x.IOptionsService)],M)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),g=c(844);class u extends g.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const A=new Array(C);for(let x=0;x<Math.min(C,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let A=this._length;A<C;A++)this._array[A]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,A){this._array[this._getCyclicIndex(C)]=A}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,A,...x){if(A){for(let y=C;y<this._length-A;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+A)];this._length-=A,this.onDeleteEmitter.fire({index:C,amount:A})}for(let y=this._length-1;y>=C;y--)this._array[this._getCyclicIndex(y+x.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<x.length;y++)this._array[this._getCyclicIndex(C+y)]=x[y];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const y=this._length+x.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,A,x){if(!(A<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let v=A-1;v>=0;v--)this.set(C+v+x,this.get(C+v));const y=C+A+x-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<A;y++)this.set(C+y+x,this.get(C+y))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}a.CircularList=u},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,g=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const b in h)u[b]=g<=1?h[b]:h[b]&&c(h[b],g-1);return u}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,g=0,u=0;var b,C,A,x,y;function v(S){const k=S.toString(16);return k.length<2?"0"+k:k}function m(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,M,R,D){return D!==void 0?`#${v(k)}${v(M)}${v(R)}${v(D)}`:`#${v(k)}${v(M)}${v(R)}`},S.toRgba=function(k,M,R,D=255){return(k<<24|M<<16|R<<8|D)>>>0},S.toColor=function(k,M,R,D){return{css:S.toCss(k,M,R,D),rgba:S.toRgba(k,M,R,D)}}})(b||(a.channels=b={})),(function(S){function k(M,R){return u=Math.round(255*R),[c,h,g]=y.toChannels(M.rgba),{css:b.toCss(c,h,g,u),rgba:b.toRgba(c,h,g,u)}}S.blend=function(M,R){if(u=(255&R.rgba)/255,u===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,E=R.rgba>>16&255,L=R.rgba>>8&255,O=M.rgba>>24&255,I=M.rgba>>16&255,F=M.rgba>>8&255;return c=O+Math.round((D-O)*u),h=I+Math.round((E-I)*u),g=F+Math.round((L-F)*u),{css:b.toCss(c,h,g),rgba:b.toRgba(c,h,g)}},S.isOpaque=function(M){return(255&M.rgba)==255},S.ensureContrastRatio=function(M,R,D){const E=y.ensureContrastRatio(M.rgba,R.rgba,D);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},S.opaque=function(M){const R=(255|M.rgba)>>>0;return[c,h,g]=y.toChannels(R),{css:b.toCss(c,h,g),rgba:R}},S.opacity=k,S.multiplyOpacity=function(M,R){return u=255&M.rgba,k(M,u*R/255)},S.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(C||(a.color=C={})),(function(S){let k,M;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(k=D,k.globalCompositeOperation="copy",M=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),b.toColor(c,h,g);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),u=parseInt(R.slice(4,5).repeat(2),16),b.toColor(c,h,g,u);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),h=parseInt(D[2]),g=parseInt(D[3]),u=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),b.toColor(c,h,g,u);if(!k||!M)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=M,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,g,u]=k.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,h,g,u),css:R}}})(A||(a.css=A={})),(function(S){function k(M,R,D){const E=M/255,L=R/255,O=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}S.relativeLuminance=function(M){return k(M>>16&255,M>>8&255,255&M)},S.relativeLuminance2=k})(x||(a.rgb=x={})),(function(S){function k(R,D,E){const L=R>>24&255,O=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));for(;Y<E&&(F>0||U>0||W>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),W-=Math.max(0,Math.ceil(.1*W)),Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));return(F<<24|U<<16|W<<8|255)>>>0}function M(R,D,E){const L=R>>24&255,O=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));for(;Y<E&&(F<255||U<255||W<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Y=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,O,I));return(F<<24|U<<16|W<<8|255)>>>0}S.blend=function(R,D){if(u=(255&D)/255,u===1)return D;const E=D>>24&255,L=D>>16&255,O=D>>8&255,I=R>>24&255,F=R>>16&255,U=R>>8&255;return c=I+Math.round((E-I)*u),h=F+Math.round((L-F)*u),g=U+Math.round((O-U)*u),b.toRgba(c,h,g)},S.ensureContrastRatio=function(R,D,E){const L=x.relativeLuminance(R>>8),O=x.relativeLuminance(D>>8);if(m(L,O)<E){if(O<L){const U=k(R,D,E),W=m(L,x.relativeLuminance(U>>8));if(W<E){const Y=M(R,D,E);return W>m(L,x.relativeLuminance(Y>>8))?U:Y}return U}const I=M(R,D,E),F=m(L,x.relativeLuminance(I>>8));if(F<E){const U=k(R,D,E);return F>m(L,x.relativeLuminance(U>>8))?I:U}return I}},S.reduceLuminance=k,S.increaseLuminance=M,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(y||(a.rgba=y={})),a.toPaddedHex=v,a.contrastRatio=m},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),g=c(2585),u=c(4348),b=c(7866),C=c(744),A=c(7302),x=c(6975),y=c(8460),v=c(1753),m=c(1480),S=c(7994),k=c(9282),M=c(5435),R=c(5981),D=c(2660);let E=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((I=>{var F;(F=this._onScrollApi)==null||F.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const F in I)this.optionsService.options[F]=I[F]}constructor(I){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 A.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.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((F=>{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((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,F){this._writeBuffer.write(I,F)}writeSync(I,F){this._logService.logLevel<=g.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,F)}input(I,F=!0){this.coreService.triggerDataEvent(I,F)}resize(I,F){isNaN(I)||isNaN(F)||(I=Math.max(I,C.MINIMUM_COLS),F=Math.max(F,C.MINIMUM_ROWS),this._bufferService.resize(I,F))}scroll(I,F=!1){this._bufferService.scroll(I,F)}scrollLines(I,F,U){this._bufferService.scrollLines(I,F,U)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const F=I-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(I,F){return this._inputHandler.registerEscHandler(I,F)}registerDcsHandler(I,F){return this._inputHandler.registerDcsHandler(I,F)}registerCsiHandler(I,F){return this._inputHandler.registerCsiHandler(I,F)}registerOscHandler(I,F){return this._inputHandler.registerOscHandler(I,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?I=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of I)F.dispose()}))}}}a.CoreTerminal=L},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((g=>h.fire(g)))},a.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(J,z,j,H){var G,N=arguments.length,Z=N<3?z:H===null?H=Object.getOwnPropertyDescriptor(z,j):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(J,z,j,H);else for(var ue=J.length-1;ue>=0;ue--)(G=J[ue])&&(Z=(N<3?G(Z):N>3?G(z,j,Z):G(z,j))||Z);return N>3&&Z&&Object.defineProperty(z,j,Z),Z},g=this&&this.__param||function(J,z){return function(j,H){z(j,H,J)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),C=c(2015),A=c(844),x=c(482),y=c(8437),v=c(8460),m=c(643),S=c(511),k=c(3734),M=c(2585),R=c(1480),D=c(6242),E=c(6351),L=c(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function F(J,z){if(J>24)return z.setWinLines||!1;switch(J){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 U;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(a.WindowsOptionsReportType=U={}));let W=0;class Y extends A.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,H,G,N,Z,ue,ve,X=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=H,this._logService=G,this._optionsService=N,this._oscLinkService=Z,this._coreMouseService=ue,this._unicodeService=ve,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new S.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 v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,fe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:fe.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,fe,ce)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:fe,data:ce})})),this._parser.setDcsHandlerFallback(((q,fe,ce)=>{fe==="HOOK"&&(ce=ce.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:fe,payload:ce})})),this._parser.setPrintHandler(((q,fe,ce)=>this.print(q,fe,ce))),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 D.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new D.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new D.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new D.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new D.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new D.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new D.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new D.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new D.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new D.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new D.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 E.DcsHandler(((q,fe)=>this.requestStatusString(q,fe))))}_preserveStack(z,j,H,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=H,this._parseStack.position=G}_logSlowResolvingAsync(z){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,H)=>setTimeout((()=>H("#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 H,G=this._activeBuffer.x,N=this._activeBuffer.y,Z=0;const ue=this._parseStack.paused;if(ue){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(H),H;G=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>I&&(Z=this._parseStack.position+I)}if(this._logService.logLevel<=M.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<I&&(this._parseBuffer=new Uint32Array(Math.min(z.length,I))),ue||this._dirtyRowTracker.clearRange(),z.length>I)for(let q=Z;q<z.length;q+=I){const fe=q+I<z.length?q+I:z.length,ce=typeof z=="string"?this._stringDecoder.decode(z.substring(q,fe),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,fe),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,ce))return this._preserveStack(G,N,ce,q),this._logSlowResolvingAsync(H),H}else if(!ue){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,q))return this._preserveStack(G,N,q,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===G&&this._activeBuffer.y===N||this._onCursorMove.fire();const ve=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ve,this._bufferService.rows-1))}print(z,j,H){let G,N;const Z=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,ve=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,fe=this._curAttrData;let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&H-j>0&&ce.getWidth(this._activeBuffer.x-1)===2&&ce.setCellFromCodepoint(this._activeBuffer.x-1,0,1,fe);let de=this._parser.precedingJoinState;for(let se=j;se<H;++se){if(G=z[se],G<127&&Z){const ht=Z[String.fromCharCode(G)];ht&&(G=ht.charCodeAt(0))}const Ce=this._unicodeService.charProperties(G,de);N=R.UnicodeService.extractWidth(Ce);const ke=R.UnicodeService.extractShouldJoin(Ce),Ee=ke?R.UnicodeService.extractWidth(de):0;if(de=Ce,ue&&this._onA11yChar.fire((0,x.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-Ee>ve){if(X){const ht=ce;let De=this._activeBuffer.x-Ee;for(this._activeBuffer.x=Ee,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),ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ee>0&&ce instanceof y.BufferLine&&ce.copyCellsFrom(ht,De,0,Ee,!1);De<ve;)ht.setCellFromCodepoint(De++,0,1,fe)}else if(this._activeBuffer.x=ve-1,N===2)continue}if(ke&&this._activeBuffer.x){const ht=ce.getWidth(this._activeBuffer.x-1)?1:2;ce.addCodepointToCell(this._activeBuffer.x-ht,G,N);for(let De=N-Ee;--De>=0;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,fe)}else if(q&&(ce.insertCells(this._activeBuffer.x,N-Ee,this._activeBuffer.getNullCell(fe)),ce.getWidth(ve-1)===2&&ce.setCellFromCodepoint(ve-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,fe)),ce.setCellFromCodepoint(this._activeBuffer.x++,G,N,fe),N>0)for(;--N;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,fe)}this._parser.precedingJoinState=de,this._activeBuffer.x<ve&&H-j>0&&ce.getWidth(this._activeBuffer.x)===0&&!ce.hasContent(this._activeBuffer.x)&&ce.setCellFromCodepoint(this._activeBuffer.x,0,1,fe),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,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||j(H)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new E.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new D.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,H,G=!1,N=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Z.replaceCells(j,H,this._activeBuffer.getNullCell(this._eraseAttrData()),N),G&&(Z.isWrapped=!1)}_resetBufferLine(z,j=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),H.isWrapped=!1)}eraseInDisplay(z,j=!1){let H;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);H<this._bufferService.rows;H++)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(H);break;case 1:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(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 H=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;j--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(H,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 H=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;j--;)this._activeBuffer.lines.splice(H,1),this._activeBuffer.lines.splice(G,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 H=z.params[0]||1,G=R.UnicodeService.extractWidth(j),N=this._activeBuffer.x-G,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),ue=new Uint32Array(Z.length*H);let ve=0;for(let q=0;q<Z.length;){const fe=Z.codePointAt(q)||0;ue[ve++]=fe,q+=fe>65535?2:1}let X=ve;for(let q=1;q<H;++q)ue.copyWithin(X,0,ve),X+=ve;return this.print(ue,0,X),!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 H=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:N}=this._coreMouseService,Z=this._coreService,{buffers:ue,cols:ve}=this._bufferService,{active:X,alt:q}=ue,fe=this._optionsService.rawOptions,ce=ke=>ke?1:2,de=z.params[0];return se=de,Ce=j?de===2?4:de===4?ce(Z.modes.insertMode):de===12?3:de===20?ce(fe.convertEol):0:de===1?ce(H.applicationCursorKeys):de===3?fe.windowOptions.setWinLines?ve===80?2:ve===132?1:0:0:de===6?ce(H.origin):de===7?ce(H.wraparound):de===8?3:de===9?ce(G==="X10"):de===12?ce(fe.cursorBlink):de===25?ce(!Z.isCursorHidden):de===45?ce(H.reverseWraparound):de===66?ce(H.applicationKeypad):de===67?4:de===1e3?ce(G==="VT200"):de===1002?ce(G==="DRAG"):de===1003?ce(G==="ANY"):de===1004?ce(H.sendFocus):de===1005?4:de===1006?ce(N==="SGR"):de===1015?4:de===1016?ce(N==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ce(X===q):de===2004?ce(H.bracketedPasteMode):0,Z.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${se};${Ce}$y`),!0;var se,Ce}_updateAttrColor(z,j,H,G,N){return j===2?(z|=50331648,z&=-16777216,z|=k.AttributeData.fromColorRGB([H,G,N])):j===5&&(z&=-50331904,z|=33554432|255&H),z}_extractColor(z,j,H){const G=[0,0,-1,0,0,0];let N=0,Z=0;do{if(G[Z+N]=z.params[j+Z],z.hasSubParams(j+Z)){const ue=z.getSubParams(j+Z);let ve=0;do G[1]===5&&(N=1),G[Z+ve+1+N]=ue[ve];while(++ve<ue.length&&ve+Z+1+N<G.length);break}if(G[1]===5&&Z+N>=2||G[1]===2&&Z+N>=5)break;G[1]&&(N=1)}while(++Z+j<z.length&&Z+N<G.length);for(let ue=2;ue<G.length;++ue)G[ue]===-1&&(G[ue]=0);switch(G[0]){case 38:H.fg=this._updateAttrColor(H.fg,G[1],G[3],G[4],G[5]);break;case 48:H.bg=this._updateAttrColor(H.bg,G[1],G[3],G[4],G[5]);break;case 58:H.extended=H.extended.clone(),H.extended.underlineColor=this._updateAttrColor(H.extended.underlineColor,G[1],G[3],G[4],G[5])}return Z}_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 H;const G=this._curAttrData;for(let N=0;N<j;N++)H=z.params[N],H>=30&&H<=37?(G.fg&=-50331904,G.fg|=16777216|H-30):H>=40&&H<=47?(G.bg&=-50331904,G.bg|=16777216|H-40):H>=90&&H<=97?(G.fg&=-50331904,G.fg|=16777224|H-90):H>=100&&H<=107?(G.bg&=-50331904,G.bg|=16777224|H-100):H===0?this._processSGR0(G):H===1?G.fg|=134217728:H===3?G.bg|=67108864:H===4?(G.fg|=268435456,this._processUnderline(z.hasSubParams(N)?z.getSubParams(N)[0]:1,G)):H===5?G.fg|=536870912:H===7?G.fg|=67108864:H===8?G.fg|=1073741824:H===9?G.fg|=2147483648:H===2?G.bg|=134217728:H===21?this._processUnderline(2,G):H===22?(G.fg&=-134217729,G.bg&=-134217729):H===23?G.bg&=-67108865:H===24?(G.fg&=-268435457,this._processUnderline(0,G)):H===25?G.fg&=-536870913:H===27?G.fg&=-67108865:H===28?G.fg&=-1073741825:H===29?G.fg&=2147483647:H===39?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):H===49?(G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?N+=this._extractColor(z,N,G):H===53?G.bg|=1073741824:H===55?G.bg&=-1073741825:H===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):H===100?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);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,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${H}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${H}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 H=j%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(z){const j=z.params[0]||1;let H;return(z.length<2||(H=z.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(z){if(!F(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(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.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=[],H=z.split(";");for(;H.length>1;){const G=H.shift(),N=H.shift();if(/^\d+$/.exec(G)){const Z=parseInt(G);if(K(Z))if(N==="?")j.push({type:0,index:Z});else{const ue=(0,L.parseColor)(N);ue&&j.push({type:1,index:Z,color:ue})}}}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 H=z.split(":");let G;const N=H.findIndex((Z=>Z.startsWith("id=")));return N!==-1&&(G=H[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,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 H=z.split(";");for(let G=0;G<H.length&&!(j>=this._specialColors.length);++G,++j)if(H[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const N=(0,L.parseColor)(H[G]);N&&this._onColor.fire([{type:1,index:this._specialColors[j],color:N}])}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=[],H=z.split(";");for(let G=0;G<H.length;++G)if(/^\d+$/.exec(H[G])){const N=parseInt(H[G]);K(N)&&j.push({type:2,index:N})}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(O[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=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 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 H=this._activeBuffer.ybase+this._activeBuffer.y+j,G=this._activeBuffer.lines.get(H);G&&(G.fill(z),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const H=this._bufferService.buffer,G=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}a.InputHandler=Y;let V=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){J<this.start?this.start=J:J>this.end&&(this.end=J)}markRangeDirty(J,z){J>z&&(W=J,J=z,z=W),J<this.start&&(this.start=J),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(J){return 0<=J&&J<256}V=h([g(0,M.IBufferService)],V)},844:(f,a)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,u,b){this._data[g]||(this._data[g]={}),this._data[g][u]=b}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,g,u,b,C){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(u,b,C)}get(h,g,u,b){var C;return(C=this._data.get(h,g))==null?void 0:C.get(u,b)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)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])===g);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,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,u=this._array.length-1;for(;u>=g;){let b=g+u>>1;const C=this._getKey(this._array[b]);if(C>h)u=b-1;else{if(!(C<h)){for(;b>0&&this._getKey(this._array[b-1])===h;)b--;return b}g=b+1}}return g}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let A=0,x=0,y=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),v=C.timeRemaining(),1.5*x>v)return y-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-A))}ms`),void this._start();y=v}this.clear()}}class u extends g{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const A=Date.now()+C;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),b=u==null?void 0:u.get(g.cols-1),C=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);C&&b&&(C.isWrapped=b[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&b[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,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}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),u=c(3734),b=c(8437),C=c(4634),A=c(511),x=c(643),y=c(4863),v=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(m,S,k){this._hasScrollback=m,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.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(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,S){return new b.BufferLine(this._bufferService.cols,this.getNullCell(m),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const S=m+this._optionsService.rawOptions.scrollback;return S>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:S}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=b.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(m))}}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(m,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA);let M=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<m)for(let E=0;E<this.lines.length;E++)M+=+this.lines.get(E).resize(m,k);let D=0;if(this._rows<S)for(let E=this._rows;E<S;E++)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(m,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(m,k)));else for(let E=this._rows;E>S;E--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const E=this.lines.length-R;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=R}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,S-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(m,S),this._cols>m))for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(m,k);this._cols=m,this._rows=S,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,S){this._cols!==m&&(m>this._cols?this._reflowLarger(m,S):this._reflowSmaller(m,S))}_reflowLarger(m,S){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(k.length>0){const M=(0,C.reflowLargerCreateNewLayout)(this.lines,k);(0,C.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(m,S,M.countRemoved)}}_reflowLargerAdjustViewport(m,S,k){const M=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new b.BufferLine(m,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(m,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA),M=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=m)continue;const L=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),L.unshift(E);const O=this.ybase+this.y;if(O>=D&&O<D+L.length)continue;const I=L[L.length-1].getTrimmedLength(),F=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,m),U=F.length-L.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const Y=[];for(let H=0;H<U;H++){const G=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);Y.push(G)}Y.length>0&&(M.push({start:D+L.length+R,newLines:Y}),R+=Y.length),L.push(...Y);let V=F.length-1,K=F[V];K===0&&(V--,K=F[V]);let J=L.length-U-1,z=I;for(;J>=0;){const H=Math.min(z,K);if(L[V]===void 0)break;if(L[V].copyCellsFrom(L[J],z-H,K-H,H,!0),K-=H,K===0&&(V--,K=F[V]),z-=H,z===0){J--;const G=Math.max(J,0);z=(0,C.getWrappedLineTrimmedLength)(L,G,this._cols)}}for(let H=0;H<L.length;H++)F[H]<m&&L[H].setCell(F[H],k);let j=U-W;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+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+S-1)}if(M.length>0){const D=[],E=[];for(let V=0;V<this.lines.length;V++)E.push(this.lines.get(V));const L=this.lines.length;let O=L-1,I=0,F=M[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let U=0;for(let V=Math.min(this.lines.maxLength-1,L+R-1);V>=0;V--)if(F&&F.start>O+U){for(let K=F.newLines.length-1;K>=0;K--)this.lines.set(V--,F.newLines[K]);V++,D.push({index:O+1,amount:F.newLines.length}),U+=F.newLines.length,F=M[++I]}else this.lines.set(V,E[O--]);let W=0;for(let V=D.length-1;V>=0;V--)D[V].index+=W,this.lines.onInsertEmitter.fire(D[V]),W+=D[V].amount;const Y=Math.max(0,L+R-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(m,S,k=0,M){const R=this.lines.get(m);return R?R.translateToString(S,k,M):""}getWrappedRangeForLine(m){let S=m,k=m;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===m&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const S=new y.Marker(m);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),u=c(643),b=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class A{constructor(y,v,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const S=v||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let k=0;k<y;++k)this.setCell(k,S);this.length=y}get(y){const v=this._data[3*y+0],m=2097151&v;return[this._data[3*y+1],2097152&v?this._combined[y]:m?(0,b.stringFromCodePoint)(m):"",v>>22,2097152&v?this._combined[y].charCodeAt(this._combined[y].length-1):m]}set(y,v){this._data[3*y+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=v[1],this._data[3*y+0]=2097152|y|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[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 v=this._data[3*y+0];return 2097152&v?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&v}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const v=this._data[3*y+0];return 2097152&v?this._combined[y]:2097151&v?(0,b.stringFromCodePoint)(2097151&v):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,v){return C=3*y,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[y]),268435456&v.bg&&(v.extended=this._extendedAttrs[y]),v}setCell(y,v){2097152&v.content&&(this._combined[y]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[y]=v.extended),this._data[3*y+0]=v.content,this._data[3*y+1]=v.fg,this._data[3*y+2]=v.bg}setCellFromCodepoint(y,v,m,S){268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=v|m<<22,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}addCodepointToCell(y,v,m){let S=this._data[3*y+0];2097152&S?this._combined[y]+=(0,b.stringFromCodePoint)(v):2097151&S?(this._combined[y]=(0,b.stringFromCodePoint)(2097151&S)+(0,b.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,m&&(S&=-12582913,S|=m<<22),this._data[3*y+0]=S}insertCells(y,v,m){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length-y){const S=new g.CellData;for(let k=this.length-y-v-1;k>=0;--k)this.setCell(y+v+k,this.loadCell(y+k,S));for(let k=0;k<v;++k)this.setCell(y+k,m)}else for(let S=y;S<this.length;++S)this.setCell(S,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(y,v,m){if(y%=this.length,v<this.length-y){const S=new g.CellData;for(let k=0;k<this.length-y-v;++k)this.setCell(y+k,this.loadCell(y+v+k,S));for(let k=this.length-v;k<this.length;++k)this.setCell(k,m)}else for(let S=y;S<this.length;++S)this.setCell(S,m);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,m)}replaceCells(y,v,m,S=!1){if(S)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,m);y<v&&y<this.length;)this.isProtected(y)||this.setCell(y,m),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,m);y<v&&y<this.length;)this.setCell(y++,m)}resize(y,v){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const S=new Uint32Array(m);S.set(this._data),this._data=S}for(let S=this.length;S<y;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,m);const S=Object.keys(this._combined);for(let M=0;M<S.length;M++){const R=parseInt(S[M],10);R>=y&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let M=0;M<k.length;M++){const R=parseInt(k[M],10);R>=y&&delete this._extendedAttrs[R]}}return this.length=y,4*m*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,v=!1){if(v)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,y);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,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 v in y._combined)this._combined[v]=y._combined[v];this._extendedAttrs={};for(const v in y._extendedAttrs)this._extendedAttrs[v]=y._extendedAttrs[v];this.isWrapped=y.isWrapped}clone(){const y=new A(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const v in this._combined)y._combined[v]=this._combined[v];for(const v in this._extendedAttrs)y._extendedAttrs[v]=this._extendedAttrs[v];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,v,m,S,k){const M=y._data;if(k)for(let D=S-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(v+D)+E];268435456&M[3*(v+D)+2]&&(this._extendedAttrs[m+D]=y._extendedAttrs[v+D])}else for(let D=0;D<S;D++){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(v+D)+E];268435456&M[3*(v+D)+2]&&(this._extendedAttrs[m+D]=y._extendedAttrs[v+D])}const R=Object.keys(y._combined);for(let D=0;D<R.length;D++){const E=parseInt(R[D],10);E>=v&&(this._combined[E-v+m]=y._combined[E])}}translateToString(y,v,m,S){v=v??0,m=m??this.length,y&&(m=Math.min(m,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;v<m;){const M=this._data[3*v+0],R=2097151&M,D=2097152&M?this._combined[v]:R?(0,b.stringFromCodePoint)(R):u.WHITESPACE_CELL_CHAR;if(k+=D,S)for(let E=0;E<D.length;++E)S.push(v);v+=M>>22||1}return S&&S.push(v),k}}a.BufferLine=A},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,g,u){if(g===h.length-1)return h[g].getTrimmedLength();const b=!h[g].hasContent(u-1)&&h[g].getWidth(u-1)===1,C=h[g+1].getWidth(0)===2;return b&&C?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,g,u,b,C){const A=[];for(let x=0;x<h.length-1;x++){let y=x,v=h.get(++y);if(!v.isWrapped)continue;const m=[h.get(x)];for(;y<h.length&&v.isWrapped;)m.push(v),v=h.get(++y);if(b>=x&&b<y){x+=m.length-1;continue}let S=0,k=c(m,S,g),M=1,R=0;for(;M<m.length;){const E=c(m,M,g),L=E-R,O=u-k,I=Math.min(L,O);m[S].copyCellsFrom(m[M],R,k,I,!1),k+=I,k===u&&(S++,k=0),R+=I,R===E&&(M++,R=0),k===0&&S!==0&&m[S-1].getWidth(u-1)===2&&(m[S].copyCellsFrom(m[S-1],u-1,k++,1,!1),m[S-1].setCell(u-1,C))}m[S].replaceCells(k,u,C);let D=0;for(let E=m.length-1;E>0&&(E>S||m[E].getTrimmedLength()===0);E--)D++;D>0&&(A.push(x+m.length-D),A.push(D)),x+=m.length-1}return A},a.reflowLargerCreateNewLayout=function(h,g){const u=[];let b=0,C=g[b],A=0;for(let x=0;x<h.length;x++)if(C===x){const y=g[++b];h.onDeleteEmitter.fire({index:x-A,amount:y}),x+=y-1,A+=y,C=g[++b]}else u.push(x);return{layout:u,countRemoved:A}},a.reflowLargerApplyNewLayout=function(h,g){const u=[];for(let b=0;b<g.length;b++)u.push(h.get(g[b]));for(let b=0;b<u.length;b++)h.set(b,u[b]);h.length=g.length},a.reflowSmallerGetNewLineLengths=function(h,g,u){const b=[],C=h.map(((v,m)=>c(h,m,g))).reduce(((v,m)=>v+m));let A=0,x=0,y=0;for(;y<C;){if(C-y<u){b.push(C-y);break}A+=u;const v=c(h,x,g);A>v&&(A-=v,x++);const m=h[x].getWidth(A-1)===2;m&&A--;const S=m?u-1:u;b.push(S),y+=S}return b},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),g=c(844),u=c(9092);class b extends g.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}a.BufferSet=b},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),g=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(A){const x=new b;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[g.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[g.CHAR_DATA_CHAR_INDEX].length===2){const y=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const v=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(y-55296)+v-56320+65536|A[g.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[g.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=b},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),g=c(844);class u{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}a.Marker=u,u._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
58
58
  `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(a.C0=c={})),(function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"})(h||(a.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(g||(a.C1_ESCAPED=g={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(u,b,C,A){const x={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"?x.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,u.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;y?(x.key=h.C0.ESC+"[1;"+(y+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(C?"b":"[1;5D"))):x.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;y?(x.key=h.C0.ESC+"[1;"+(y+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(C?"f":"[1;5C"))):x.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;y?(x.key=h.C0.ESC+"[1;"+(y+1)+"A",C||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;y?(x.key=h.C0.ESC+"[1;"+(y+1)+"B",C||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=y?h.C0.ESC+"[3;"+(y+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=y?h.C0.ESC+"[1;"+(y+1)+"H":b?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=y?h.C0.ESC+"[1;"+(y+1)+"F":b?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=h.C0.ESC+"[5;"+(y+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=h.C0.ESC+"[6;"+(y+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=y?h.C0.ESC+"[1;"+(y+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=y?h.C0.ESC+"[1;"+(y+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=y?h.C0.ESC+"[1;"+(y+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=y?h.C0.ESC+"[1;"+(y+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=y?h.C0.ESC+"[15;"+(y+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=y?h.C0.ESC+"[17;"+(y+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=y?h.C0.ESC+"[18;"+(y+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=y?h.C0.ESC+"[19;"+(y+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=y?h.C0.ESC+"[20;"+(y+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=y?h.C0.ESC+"[21;"+(y+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=y?h.C0.ESC+"[23;"+(y+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=y?h.C0.ESC+"[24;"+(y+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(C&&!A||!u.altKey||u.metaKey)!C||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=h.C0.US),u.key==="@"&&(x.key=h.C0.NUL)):u.keyCode===65&&(x.type=1);else{const v=g[u.keyCode],m=v==null?void 0:v[u.shiftKey?1:0];if(m)x.key=h.C0.ESC+m;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let k=String.fromCharCode(S);u.shiftKey&&(k=k.toUpperCase()),x.key=h.C0.ESC+k}else if(u.keyCode===32)x.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),x.key=h.C0.ESC+S,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=h.C0.DEL:u.keyCode===219?x.key=h.C0.ESC:u.keyCode===220?x.key=h.C0.FS:u.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,g=c.length){let u="";for(let b=h;b<g;++b){let C=c[b];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let u=0,b=0;if(this._interim){const C=c.charCodeAt(b++);56320<=C&&C<=57343?h[u++]=1024*(this._interim-55296)+C-56320+65536:(h[u++]=this._interim,h[u++]=C),this._interim=0}for(let C=b;C<g;++C){const A=c.charCodeAt(C);if(55296<=A&&A<=56319){if(++C>=g)return this._interim=A,u;const x=c.charCodeAt(C);56320<=x&&x<=57343?h[u++]=1024*(A-55296)+x-56320+65536:(h[u++]=A,h[u++]=x)}else A!==65279&&(h[u++]=A)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let u,b,C,A,x=0,y=0,v=0;if(this.interim[0]){let k=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)M<<=6,M|=R;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=E-D;for(;v<L;){if(v>=g)return 0;if(R=c[v++],(192&R)!=128){v--,k=!0;break}this.interim[D++]=R,M<<=6,M|=63&R}k||(E===2?M<128?v--:h[x++]=M:E===3?M<2048||M>=55296&&M<=57343||M===65279||(h[x++]=M):M<65536||M>1114111||(h[x++]=M)),this.interim.fill(0)}const m=g-4;let S=v;for(;S<g;){for(;!(!(S<m)||128&(u=c[S])||128&(b=c[S+1])||128&(C=c[S+2])||128&(A=c[S+3]));)h[x++]=u,h[x++]=b,h[x++]=C,h[x++]=A,S+=4;if(u=c[S++],u<128)h[x++]=u;else if((224&u)==192){if(S>=g)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(y=(31&u)<<6|63&b,y<128){S--;continue}h[x++]=y}else if((240&u)==224){if(S>=g)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=g)return this.interim[0]=u,this.interim[1]=b,x;if(C=c[S++],(192&C)!=128){S--;continue}if(y=(15&u)<<12|(63&b)<<6|63&C,y<2048||y>=55296&&y<=57343||y===65279)continue;h[x++]=y}else if((248&u)==240){if(S>=g)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=g)return this.interim[0]=u,this.interim[1]=b,x;if(C=c[S++],(192&C)!=128){S--;continue}if(S>=g)return this.interim[0]=u,this.interim[1]=b,this.interim[2]=C,x;if(A=c[S++],(192&A)!=128){S--;continue}if(y=(7&u)<<18|(63&b)<<12|(63&C)<<6|63&A,y<65536||y>1114111)continue;h[x++]=y}}return x}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(1480),g=[[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;a.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let C=0;C<g.length;++C)b.fill(0,g[C][0],g[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?b[C]:(function(A,x){let y,v=0,m=x.length-1;if(A<x[0][0]||A>x[m][1])return!1;for(;m>=v;)if(y=v+m>>1,A>x[y][1])v=y+1;else{if(!(A<x[y][0]))return!0;m=y-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let x=this.wcwidth(C),y=x===0&&A!==0;if(y){const v=h.UnicodeService.extractWidth(A);v===0?y=!1:v>x&&(x=v)}return h.UnicodeService.createPropertyValue(0,x,y)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),g=c(844);class u extends g.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A)}_innerWrite(C=0,A=!0){const x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],v=this._action(y,A);if(v){const S=k=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(x,k);return void v.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=u},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function g(u,b){const C=u.toString(16),A=C.length<2?"0"+C:C;switch(b){case 4:return C[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}a.parseColor=function(u){if(!u)return;let b=u.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const C=c.exec(b);if(C){const A=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/A*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/A*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/A*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),h.exec(b)&&[3,6,9,12].includes(b.length))){const C=b.length/3,A=[0,0,0];for(let x=0;x<3;++x){const y=parseInt(b.slice(C*x,C*x+C),16);A[x]=C===1?y<<4:C===2?y:C===3?y>>4:y>>8}return A}},a.toRgbString=function(u,b=16){const[C,A,x]=u;return`rgb:${g(C,b)}/${g(A,b)}/${g(x,b)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),g=c(8742),u=c(5770),b=[];a.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(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const y=this._handlers[A];return y.push(x),{dispose:()=>{const v=y.indexOf(x);v!==-1&&y.splice(v,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||b,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,y){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(A,x,y);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,y))}unhook(A,x=!0){if(this._active.length){let y=!1,v=this._active.length-1,m=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,y=x,m=this._stack.fallThrough,this._stack.paused=!1),!m&&y===!1){for(;v>=0&&(y=this._active[v].unhook(A),y!==!0);v--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,y;v--}for(;v>=0;v--)if(y=this._active[v].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",A);this._active=b,this._ident=0}};const C=new g.Params;C.addParam(0),a.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=C,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():C,this._data="",this._hitLimit=!1}put(A,x,y){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,y),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((y=>(this._params=C,this._data="",this._hitLimit=!1,y)));return this._params=C,this._data="",this._hitLimit=!1,x}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),g=c(8742),u=c(6242),b=c(6351);class C{constructor(v){this.table=new Uint8Array(v)}setDefault(v,m){this.table.fill(v<<4|m)}add(v,m,S,k){this.table[m<<8|v]=S<<4|k}addMany(v,m,S,k){for(let M=0;M<v.length;M++)this.table[m<<8|v[M]]=S<<4|k}}a.TransitionTable=C;const A=160;a.VT500_TRANSITION_TABLE=(function(){const y=new C(4095),v=Array.apply(null,Array(256)).map(((D,E)=>E)),m=(D,E)=>v.slice(D,E),S=m(32,127),k=m(0,24);k.push(25),k.push.apply(k,m(28,32));const M=m(0,14);let R;for(R in y.setDefault(1,0),y.addMany(S,0,2,0),M)y.addMany([24,26,153,154],R,3,0),y.addMany(m(128,144),R,3,0),y.addMany(m(144,152),R,3,0),y.add(156,R,0,0),y.add(27,R,11,1),y.add(157,R,4,8),y.addMany([152,158,159],R,0,7),y.add(155,R,11,3),y.add(144,R,11,9);return y.addMany(k,0,3,0),y.addMany(k,1,3,1),y.add(127,1,0,1),y.addMany(k,8,0,8),y.addMany(k,3,3,3),y.add(127,3,0,3),y.addMany(k,4,3,4),y.add(127,4,0,4),y.addMany(k,6,3,6),y.addMany(k,5,3,5),y.add(127,5,0,5),y.addMany(k,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(S,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(m(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(S,7,0,7),y.addMany(k,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(m(64,127),3,7,0),y.addMany(m(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(m(48,60),4,8,4),y.addMany(m(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(m(32,64),6,0,6),y.add(127,6,0,6),y.addMany(m(64,127),6,0,0),y.addMany(m(32,48),3,9,5),y.addMany(m(32,48),5,9,5),y.addMany(m(48,64),5,0,6),y.addMany(m(64,127),5,7,0),y.addMany(m(32,48),4,9,5),y.addMany(m(32,48),1,9,2),y.addMany(m(32,48),2,9,2),y.addMany(m(48,127),2,10,0),y.addMany(m(48,80),1,10,0),y.addMany(m(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(m(96,127),1,10,0),y.add(80,1,11,9),y.addMany(k,9,0,9),y.add(127,9,0,9),y.addMany(m(28,32),9,0,9),y.addMany(m(32,48),9,9,12),y.addMany(m(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(k,11,0,11),y.addMany(m(32,128),11,0,11),y.addMany(m(28,32),11,0,11),y.addMany(k,10,0,10),y.add(127,10,0,10),y.addMany(m(28,32),10,0,10),y.addMany(m(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(m(32,48),10,9,12),y.addMany(k,12,0,12),y.add(127,12,0,12),y.addMany(m(28,32),12,0,12),y.addMany(m(32,48),12,9,12),y.addMany(m(48,64),12,0,11),y.addMany(m(64,127),12,12,13),y.addMany(m(64,127),10,12,13),y.addMany(m(64,127),9,12,13),y.addMany(k,13,13,13),y.addMany(S,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(A,0,2,0),y.add(A,8,5,8),y.add(A,6,0,6),y.add(A,11,0,11),y.add(A,13,13,13),y})();class x extends h.Disposable{constructor(v=a.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,S,k)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,S)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,m=[64,126]){let S=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=v.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<v.intermediates.length;++M){const R=v.intermediates.charCodeAt(M);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const k=v.final.charCodeAt(0);if(m[0]>k||k>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return S<<=8,S|=k,S}identToString(v){const m=[];for(;v;)m.push(String.fromCharCode(255&v)),v>>=8;return m.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,m){const S=this._identifier(v,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(m),{dispose:()=>{const M=k.indexOf(m);M!==-1&&k.splice(M,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,m){this._executeHandlers[v.charCodeAt(0)]=m}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,m){const S=this._identifier(v);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(m),{dispose:()=>{const M=k.indexOf(m);M!==-1&&k.splice(M,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,m){return this._dcsParser.registerHandler(this._identifier(v),m)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,m){return this._oscParser.registerHandler(v,m)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,m,S,k,M){this._parseStack.state=v,this._parseStack.handlers=m,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=M}parse(v,m,S){let k,M=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=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 E=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&L>-1){for(;L>=0&&(k=E[L](this._params),k!==!0);L--)if(k instanceof Promise)return this._parseStack.handlerPos=L,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&L>-1){for(;L>=0&&(k=E[L](),k!==!0);L--)if(k instanceof Promise)return this._parseStack.handlerPos=L,k}this._parseStack.handlers=[];break;case 6:if(M=v[this._parseStack.chunkPos],k=this._dcsParser.unhook(M!==24&&M!==26,S),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=v[this._parseStack.chunkPos],k=this._oscParser.end(M!==24&&M!==26,S),k)return k;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=D;E<m;++E){switch(M=v[E],R=this._transitions.table[this.currentState<<8|(M<160?M:A)],R>>4){case 2:for(let U=E+1;;++U){if(U>=m||(M=v[U])<32||M>126&&M<A){this._printHandler(v,E,U),E=U-1;break}if(++U>=m||(M=v[U])<32||M>126&&M<A){this._printHandler(v,E,U),E=U-1;break}if(++U>=m||(M=v[U])<32||M>126&&M<A){this._printHandler(v,E,U),E=U-1;break}if(++U>=m||(M=v[U])<32||M>126&&M<A){this._printHandler(v,E,U),E=U-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|M];let O=L?L.length-1:-1;for(;O>=0&&(k=L[O](this._params),k!==!0);O--)if(k instanceof Promise)return this._preserveStack(3,L,O,R,E),k;O<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++E<m&&(M=v[E])>47&&M<60);E--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const I=this._escHandlers[this._collect<<8|M];let F=I?I.length-1:-1;for(;F>=0&&(k=I[F](),k!==!0);F--)if(k instanceof Promise)return this._preserveStack(4,I,F,R,E),k;F<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let U=E+1;;++U)if(U>=m||(M=v[U])===24||M===26||M===27||M>127&&M<A){this._dcsParser.put(v,E,U),E=U-1;break}break;case 14:if(k=this._dcsParser.unhook(M!==24&&M!==26),k)return this._preserveStack(6,[],0,R,E),k;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let U=E+1;;U++)if(U>=m||(M=v[U])<32||M>127&&M<A){this._oscParser.put(v,E,U),E=U-1;break}break;case 6:if(k=this._oscParser.end(M!==24&&M!==26),k)return this._preserveStack(5,[],0,R,E),k;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=x},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),g=c(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,C){this._handlers[b]===void 0&&(this._handlers[b]=[]);const A=this._handlers[b];return A.push(C),{dispose:()=>{const x=A.indexOf(C);x!==-1&&A.splice(x,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,C,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(b,C,A);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(b,C,A))}start(){this.reset(),this._state=1}put(b,C,A){if(this._state!==3){if(this._state===1)for(;C<A;){const x=b[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-C>0&&this._put(b,C,A)}}end(b,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,y=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=C,y=this._stack.fallThrough,this._stack.paused=!1),!y&&A===!1){for(;x>=0&&(A=this._active[x].end(b),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",b);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,C,A){this._hitLimit||(this._data+=(0,g.utf32ToString)(b,C,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let C=!1;if(this._hitLimit)C=!1;else if(b&&(C=this._handler(this._data),C instanceof Promise))return C.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,C}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(u){const b=new h;if(!u.length)return b;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const A=u[C];if(Array.isArray(A))for(let x=0;x<A.length;++x)b.addSubParam(A[x]);else b.addParam(A)}return b}constructor(u=32,b=32){if(this.maxLength=u,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let b=0;b<this.length;++b){u.push(this.params[b]);const C=this._subParamsIdx[b]>>8,A=255&this._subParamsIdx[b];A-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,A))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const b=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-b>0?this._subParams.subarray(b,C):null}getSubParamsAll(){const u={};for(let b=0;b<this.length;++b){const C=this._subParamsIdx[b]>>8,A=255&this._subParamsIdx[b];A-C>0&&(u[b]=this._subParams.slice(C,A))}return u}addDigit(u){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,A=C[b-1];C[b-1]=~A?Math.min(10*A+u,c):u}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){h=g;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),g=c(511);a.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 g.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,u){if(!(g<0||g>=this._line.length))return u?(this._line.loadCell(g,u),u):this._line.loadCell(g,new h.CellData)}translateToString(g,u,b){return this._line.translateToString(g,u,b)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),g=c(8460),u=c(844);class b extends u.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=b},7975:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(g=>h(g.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((g,u)=>h(g,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,a,c){var h=this&&this.__decorate||function(y,v,m,S){var k,M=arguments.length,R=M<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,v,m,S);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(R=(M<3?k(R):M>3?k(v,m,R):k(v,m))||R);return M>3&&R&&Object.defineProperty(v,m,R),R},g=this&&this.__param||function(y,v){return function(m,S){v(m,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=c(8460),b=c(844),C=c(5295),A=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends b.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,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(y,this))}resize(y,v){this.cols=y,this.rows=v,this.buffers.resize(y,v),this._onResize.fire({cols:y,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,v=!1){const m=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===y.fg&&S.getBg(0)===y.bg||(S=m.getBlankLine(y,v),this._cachedBlankLine=S),S.isWrapped=v;const k=m.ybase+m.scrollTop,M=m.ybase+m.scrollBottom;if(m.scrollTop===0){const R=m.lines.isFull;M===m.lines.length-1?R?m.lines.recycle().copyFrom(S):m.lines.push(S.clone()):m.lines.splice(M+1,0,S.clone()),R?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const R=M-k+1;m.lines.shiftElements(k+1,R-1,-1),m.lines.set(M,S.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(y,v,m){const S=this.buffer;if(y<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else y+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+y,S.ybase),0),k!==S.ydisp&&(v||this._onScroll.fire(S.ydisp))}};a.BufferService=x=h([g(0,A.IOptionsService)],x)},7994:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(S,k,M,R){var D,E=arguments.length,L=E<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,k,M,R);else for(var O=S.length-1;O>=0;O--)(D=S[O])&&(L=(E<3?D(L):E>3?D(k,M,L):D(k,M))||L);return E>3&&L&&Object.defineProperty(k,M,L),L},g=this&&this.__param||function(S,k){return function(M,R){k(M,R,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=c(2585),b=c(8460),C=c(844),A={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 x(S,k){let M=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(M|=64,M|=S.action):(M|=3&S.button,4&S.button&&(M|=64),8&S.button&&(M|=128),S.action===32?M|=32:S.action!==0||k||(M|=3)),M}const y=String.fromCharCode,v={DEFAULT:S=>{const k=[x(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${y(k[0])}${y(k[1])}${y(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.x};${S.y}${k}`}};let m=a.CoreMouseService=class extends C.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,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 M of Object.keys(A))this.addProtocol(M,A[M]);for(const M of Object.keys(v))this.addEncoding(M,v[M]);this.reset()}addProtocol(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}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 k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!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,k,M){if(M){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};a.CoreMouseService=m=h([g(0,u.IBufferService),g(1,u.ICoreService)],m)},6975:function(f,a,c){var h=this&&this.__decorate||function(m,S,k,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,k,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,k,E):R(S,k))||E);return D>3&&E&&Object.defineProperty(S,k,E),E},g=this&&this.__param||function(m,S){return function(k,M){S(k,M,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=c(1439),b=c(8460),C=c(844),A=c(2585),x=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=a.CoreService=class extends C.Disposable{constructor(m,S,k){super(),this._bufferService=m,this._logService=S,this._optionsService=k,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)(x),this.decPrivateModes=(0,u.clone)(y)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(y)}triggerDataEvent(m,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(m))}};a.CoreService=v=h([g(0,A.IBufferService),g(1,A.ILogService),g(2,A.IOptionsService)],v)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),g=c(8460),u=c(844),b=c(6106);let C=0,A=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((m=>m==null?void 0:m.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;const S=new y(m);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,S,k){let M=0,R=0;for(const D of this._decorations.getKeyIterator(S))M=D.options.x??0,R=M+(D.options.width??1),m>=M&&m<R&&(!k||(D.options.layer??"bottom")===k)&&(yield D)}forEachDecorationAtCell(m,S,k,M){this._decorations.forEachByKey(S,(R=>{C=R.options.x??0,A=C+(R.options.width??1),m>=C&&m<A&&(!k||(R.options.layer??"bottom")===k)&&M(R)}))}}a.DecorationService=x;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(m){super(),this.options=m,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),g=c(8343);class u{constructor(...C){this._entries=new Map;for(const[A,x]of C)this.set(A,x)}set(C,A){const x=this._entries.get(C);return this._entries.set(C,A),x}forEach(C){for(const[A,x]of this._entries.entries())C(A,x)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(b,C){this._services.set(b,C)}getService(b){return this._services.get(b)}createInstance(b,...C){const A=(0,g.getServiceDependencies)(b).sort(((v,m)=>v.index-m.index)),x=[];for(const v of A){const m=this._services.get(v.id);if(!m)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${v.id}.`);x.push(m)}const y=A.length>0?A[0].index:C.length;if(C.length!==y)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${y+1} conflicts with ${C.length} static arguments`);return new b(...C,...x)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(y,v,m,S){var k,M=arguments.length,R=M<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,v,m,S);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(R=(M<3?k(R):M>3?k(v,m,R):k(v,m))||R);return M>3&&R&&Object.defineProperty(v,m,R),R},g=this&&this.__param||function(y,v){return function(m,S){v(m,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=c(844),b=c(2585),C={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let A,x=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let v=0;v<y.length;v++)typeof y[v]=="function"&&(y[v]=y[v]())}_log(y,v,m){this._evalLazyOptionalParams(m),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...m)}trace(y,...v){var m;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.trace.bind(this._optionsService.options.logger))??console.log,y,v)}debug(y,...v){var m;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.debug.bind(this._optionsService.options.logger))??console.log,y,v)}info(y,...v){var m;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.info.bind(this._optionsService.options.logger))??console.info,y,v)}warn(y,...v){var m;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.warn.bind(this._optionsService.options.logger))??console.warn,y,v)}error(y,...v){var m;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.error.bind(this._optionsService.options.logger))??console.error,y,v)}};a.LogService=x=h([g(0,b.IOptionsService)],x),a.setTraceLogger=function(y){A=y},a.traceCall=function(y,v,m){if(typeof m.value!="function")throw new Error("not supported");const S=m.value;m.value=function(...k){if(A.logLevel!==b.LogLevelEnum.TRACE)return S.apply(this,k);A.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const M=S.apply(this,k);return A.trace(`GlyphRenderer#${S.name} return`,M),M}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),g=c(844),u=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends g.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const v in x)if(v in y)try{const m=x[v];y[v]=this._sanitizeAndValidateOption(v,m)}catch(m){console.error(m)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,y){return this.onOptionChange((v=>{v===x&&y(this.rawOptions[x])}))}onMultipleOptionChange(x,y){return this.onOptionChange((v=>{x.indexOf(v)!==-1&&y()}))}_setupOptions(){const x=v=>{if(!(v in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},y=(v,m)=>{if(!(v in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);m=this._sanitizeAndValidateOption(v,m),this.rawOptions[v]!==m&&(this.rawOptions[v]=m,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const m={get:x.bind(this,v),set:y.bind(this,v)};Object.defineProperty(this.options,v,m)}}_sanitizeAndValidateOption(x,y){switch(x){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[x]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${x}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=b.includes(y)?y:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${x} 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(`${x} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${x} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}a.OptionsService=C},2660:function(f,a,c){var h=this&&this.__decorate||function(C,A,x,y){var v,m=arguments.length,S=m<3?A:y===null?y=Object.getOwnPropertyDescriptor(A,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,A,x,y);else for(var k=C.length-1;k>=0;k--)(v=C[k])&&(S=(m<3?v(S):m>3?v(A,x,S):v(A,x))||S);return m>3&&S&&Object.defineProperty(A,x,S),S},g=this&&this.__param||function(C,A){return function(x,y){A(x,y,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=c(2585);let b=a.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const A=this._bufferService.buffer;if(C.id===void 0){const k=A.addMarker(A.ybase+A.y),M={data:C,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(M,k))),this._dataByLinkId.set(M.id,M),M.id}const x=C,y=this._getEntryIdKey(x),v=this._entriesWithId.get(y);if(v)return this.addLineToLink(v.id,A.ybase+A.y),v.id;const m=A.addMarker(A.ybase+A.y),S={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(S,m))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,A){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((y=>y.line!==A))){const y=this._bufferService.buffer.addMarker(A);x.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(x,y)))}}getLinkData(C){var A;return(A=this._dataByLinkId.get(C))==null?void 0:A.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,A){const x=C.lines.indexOf(A);x!==-1&&(C.lines.splice(x,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};a.OscLinkService=b=h([g(0,u.IBufferService)],b)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[h]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const u=function(b,C,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,y,v){y[c]===y?y[h].push({id:x,index:v}):(y[h]=[{id:x,index:v}],y[c]=y)})(u,b,A)};return u.toString=()=>g,a.serviceRegistry.set(g,u),u}},2585:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const h=c(8343);var g;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(g||(a.LogLevelEnum=g={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),g=c(225);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,x=!1){return(16777215&C)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const C=new g.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let A=0,x=0;const y=C.length;for(let v=0;v<y;++v){let m=C.charCodeAt(v);if(55296<=m&&m<=56319){if(++v>=y)return A+this.wcwidth(m);const M=C.charCodeAt(v);56320<=M&&M<=57343?m=1024*(m-55296)+M-56320+65536:A+=this.wcwidth(M)}const S=this.charProperties(m,x);let k=u.extractWidth(S);u.extractShouldJoin(S)&&(k-=u.extractWidth(x)),A+=k,x=S}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}a.UnicodeService=u}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=d(9042),c=d(3236),h=d(844),g=d(5741),u=d(8285),b=d(7975),C=d(7090),A=["cols","rows"];class x extends h.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const m=k=>this._core.options[k],S=(k,M)=>{this._checkReadonlyOptions(k),this._core.options[k]=M};for(const k in this._core.options){const M={get:m.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,M)}}_checkReadonlyOptions(v){if(A.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const m in v)this._publicOptions[m]=v[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,m=!0){this._core.input(v,m)}resize(v,m){this._verifyIntegers(v,m),this._core.resize(v,m)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,m,S){this._verifyIntegers(v,m,S),this._core.select(v,m,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,m){this._verifyIntegers(v,m),this._core.selectLines(v,m)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,m){this._core.write(v,m)}writeln(v,m){this._core.write(v),this._core.write(`\r
59
- `,m)}paste(v){this._core.paste(v)}refresh(v,m){this._verifyIntegers(v,m),this._core.refresh(v,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return a}_verifyIntegers(...v){for(const m of v)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const m of v)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),_})()))})(Au)),Au.exports}var L1=M1();class O1{constructor(r,s){am(this,"socket");const o=window.location.protocol==="https:"?"wss:":"ws:";this.socket=new WebSocket(`${o}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`),this.socket.addEventListener("message",d=>{var f,a;const _=JSON.parse(d.data);_.type==="output"?s.onOutput(_.data):_.type==="error"?(f=s.onError)==null||f.call(s,_.message):(a=s.onStatus)==null||a.call(s,_)}),this.socket.addEventListener("error",()=>{var d;(d=s.onError)==null||d.call(s,"Terminal connection failed.")})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function oo({sessionId:n,active:r=!0,onEvent:s}){const o=ne.useRef(null),d=ne.useRef(null),_=ne.useRef(null),f=ne.useRef(null),a=ne.useRef(r),c=ne.useRef(s);function h(g={}){const u=o.current,b=d.current,C=_.current,A=f.current;if(!u||!b||!C||!A)return!1;const x=u.getBoundingClientRect();return x.width<wm||x.height<xm||(C.fit(),A.cols<Em||A.rows<km)?!1:(b.resize(A.cols,A.rows),g.focus&&A.focus(),!0)}return ne.useEffect(()=>{c.current=s},[s]),ne.useEffect(()=>{a.current=r},[r]),ne.useEffect(()=>{if(!o.current)return;const g=new L1.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:B1}),u=new T1.FitAddon;g.loadAddon(u),g.loadAddon(new D1.WebLinksAddon),g.open(o.current),f.current=g,_.current=u;const b=o.current.getBoundingClientRect();b.width>=wm&&b.height>=xm&&u.fit();const C=new O1(n,{onOutput(k){g.write(k)},onStatus(k){var M;(M=c.current)==null||M.call(c,k.type)},onError(k){var M;g.writeln(`\r
60
- [VCM] ${k}`),(M=c.current)==null||M.call(c,k)}});d.current=C,g.cols>=Em&&g.rows>=km&&C.resize(g.cols,g.rows);const A=g.onData(k=>{C.sendInput(k)});let x=0,y=0,v=0;const m=()=>{x&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{x=0,h({focus:a.current})})},S=new ResizeObserver(()=>{m()});return S.observe(o.current),y=window.requestAnimationFrame(m),v=window.setTimeout(m,120),()=>{x&&window.cancelAnimationFrame(x),y&&window.cancelAnimationFrame(y),v&&window.clearTimeout(v),S.disconnect(),A.dispose(),C.close(),g.dispose(),d.current=null,f.current=null,_.current=null}},[n]),ne.useEffect(()=>{if(!r)return;const g=[],u=[];return g.push(window.requestAnimationFrame(()=>{h({focus:!0}),g.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 g)window.cancelAnimationFrame(b);for(const b of u)window.clearTimeout(b)}},[r]),ne.useEffect(()=>{const g=()=>{a.current&&h()};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),T.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var g;return(g=f.current)==null?void 0:g.focus()}})}const wm=160,xm=80,Em=20,km=5,B1={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"},jg=[{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"}],j1=[{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"}],Ng=[...j1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function yi({status:n}){return T.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function ah({role:n,session:r,permissionMode:s,model:o,effort:d,busy:_=!1,onPermissionModeChange:f,onModelChange:a,onEffortChange:c,onStart:h,onResume:g,onStop:u,onRestart:b,onNotifyHarnessUpdated:C}){const A=(r==null?void 0:r.status)==="running",x=!!(r!=null&&r.claudeSessionId&&!A),y=!A&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return T.jsxs("div",{className:"session-controls",children:[T.jsxs("label",{className:"session-option-field permission-mode-field",children:[T.jsx("span",{children:"Permission"}),T.jsxs("select",{value:s,onChange:m=>f(m.target.value),children:[T.jsx("option",{value:"default",children:"默认"}),T.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),T.jsxs("label",{className:"session-option-field model-field",children:[T.jsx("span",{children:"Model"}),T.jsx("select",{value:o,onChange:m=>a(m.target.value),children:jg.map(m=>T.jsx("option",{value:m.value,children:m.label},m.value))})]}),T.jsxs("label",{className:"session-option-field effort-field",children:[T.jsx("span",{children:"Effort"}),T.jsx("select",{value:d,onChange:m=>c(m.target.value),children:Ng.map(m=>T.jsx("option",{value:m.value,children:m.label},m.value))})]}),T.jsxs("div",{className:"session-toolbar",children:[T.jsx("button",{type:"button",disabled:_||!y,onClick:h,children:"Start"}),T.jsx("button",{type:"button",disabled:_||!x,onClick:g,children:"Resume"}),T.jsx("button",{type:"button",disabled:_||!r,onClick:b,children:"Restart"}),T.jsx("button",{type:"button",disabled:_||!r,onClick:u,children:"Stop"})]}),v?T.jsxs("div",{className:"session-harness-notice",children:[T.jsx(yi,{status:"outdated"}),T.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),T.jsx("button",{type:"button",disabled:_||!A||!C,onClick:C,children:"Notify role"})]}):null]})}function N1({busy:n,effort:r,model:s,open:o,permissionMode:d,taskSlug:_,bootstrapStatus:f,engineerSession:a,status:c,onClose:h,onEffortChange:g,onModelChange:u,onPermissionModeChange:b,onEngineerResume:C,onEngineerRestart:A,onEngineerStart:x,onEngineerStop:y,onEngineerNotifyHarnessUpdated:v,onOpenRepositoryDiff:m,onRefresh:S}){const[k,M]=ne.useState(null),[R,D]=ne.useState(null),[E,L]=ne.useState(""),[O,I]=ne.useState(!1),[F,U]=ne.useState(!1),[W,Y]=ne.useState(null),V=(c==null?void 0:c.files)??[],K=V.filter(Z=>Z.kind.startsWith("agent-")),J=V.filter(Z=>Z.kind.startsWith("skill-")),z=V.filter(Z=>Z.kind.startsWith("tool-")),j=V.filter(Z=>Z.kind==="root-claude"||Z.kind==="gitignore"||Z.kind==="pull-request-template"),H=!!(R&&E!==R.content);ne.useEffect(()=>{o||(M(null),D(null),L(""),I(!1),Y(null))},[V,o,k]),ne.useEffect(()=>{if(!o||!k||!_)return;let Z=!1;return U(!0),Y(null),I(!1),Se.getHarnessFileContent(_,k).then(ue=>{Z||(D(ue),L(ue.content))}).catch(ue=>{Z||Y(ue.message)}).finally(()=>{Z||U(!1)}),()=>{Z=!0}},[o,k,_]);async function G(){if(!(!R||!R.editable||!H||!_)){U(!0),Y(null);try{const Z=await Se.updateHarnessFileContent(_,R.path,{content:E});D(Z.file),L(Z.file.content),I(!1),S()}catch(Z){Y(Z instanceof Error?Z.message:String(Z))}finally{U(!1)}}}function N(){M(null),D(null),L(""),I(!1),Y(null)}return o?T.jsx(T.Fragment,{children:T.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:T.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[T.jsxs("header",{className:"harness-studio-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Harness Studio"}),_?null:T.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),T.jsxs("div",{className:"harness-studio-header-actions",children:[T.jsx("button",{type:"button",disabled:n,onClick:m,children:"Review Diff"}),T.jsx("button",{type:"button",disabled:n,onClick:S,children:"Refresh"}),T.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),T.jsxs("div",{className:"harness-studio-layout",children:[T.jsx("aside",{className:k?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:k?T.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[T.jsxs("header",{className:"harness-studio-file-editor-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),T.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??k})]}),T.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?T.jsx(yi,{status:R.editable?"ok":"unknown"}):null,O?T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:F||!_||!(R!=null&&R.editable)||!H,onClick:()=>void G(),children:"Save"}),T.jsx("button",{type:"button",disabled:F,onClick:()=>{L((R==null?void 0:R.content)??""),I(!1)},children:"Cancel"})]}):T.jsx("button",{type:"button",disabled:F||!_||!(R!=null&&R.editable),onClick:()=>I(!0),children:"Edit"}),T.jsx("button",{type:"button",onClick:N,children:"Return"})]})]}),R!=null&&R.readonlyReason?T.jsx("p",{className:"muted",children:R.readonlyReason}):null,W?T.jsx("p",{className:"error-banner",children:W}):null,T.jsx("textarea",{className:O?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:E,spellCheck:!1,readOnly:!O,disabled:F,onChange:Z=>L(Z.target.value)})]}):T.jsxs(T.Fragment,{children:[T.jsxs("section",{className:"harness-studio-section harness-studio-overview",children:[T.jsx("h3",{children:"Overview"}),T.jsxs("div",{className:"harness-studio-metrics",children:[T.jsx(cs,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),T.jsx(cs,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),T.jsx(cs,{label:"Managed files",value:String(V.length)}),T.jsx(cs,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),T.jsx(cs,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),T.jsx(cs,{label:"Engineer",value:Am(a)})]}),c!=null&&c.warnings.length?T.jsx("ul",{className:"warnings",children:c.warnings.map(Z=>T.jsx("li",{children:Z},Z))}):null]}),T.jsx(Ka,{title:"Agents",files:K,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Skills",files:J,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Root Context",files:j,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Tools",files:z,selectedPath:k,onSelect:M}),T.jsxs("section",{className:"harness-studio-section",children:[T.jsx("h3",{children:"Project Docs"}),T.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(Z=>T.jsxs("li",{children:[T.jsx("span",{children:Z.path??Z.label}),T.jsx(yi,{status:Z.status})]},Z.key)))??T.jsx("li",{children:T.jsx("span",{children:"No bootstrap status loaded."})})})]})]})}),T.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[T.jsxs("div",{className:"harness-studio-engineer-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:"Harness Engineer"}),T.jsx("p",{className:"muted",children:Am(a)})]}),T.jsx(yi,{status:(a==null?void 0:a.status)??"unknown"})]}),T.jsx(ah,{role:"harness-engineer",session:a??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:g,onStart:x,onResume:C,onRestart:A,onStop:y,onNotifyHarnessUpdated:v}),T.jsx("div",{className:"harness-engineer-terminal",children:(a==null?void 0:a.status)==="running"?T.jsx(oo,{sessionId:a.id,active:o},a.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"harness-engineer"}),T.jsx("span",{children:a!=null&&a.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function cs({label:n,value:r}){return T.jsxs("div",{className:"harness-studio-metric",children:[T.jsx("span",{children:n}),T.jsx("strong",{children:r})]})}function Ka({title:n,files:r,selectedPath:s,onSelect:o}){return T.jsxs("section",{className:"harness-studio-section",children:[T.jsx("h3",{children:n}),T.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(d=>T.jsxs("li",{className:d.path===s?"selected":void 0,children:[T.jsx("button",{type:"button",title:d.path,onClick:()=>o(d.path),children:d.path}),T.jsx(yi,{status:d.action})]},d.path)):T.jsx("li",{children:T.jsx("span",{children:"No files."})})})]})}function Am(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}function H1({open:n,taskSlug:r,onClose:s}){var x;const[o,d]=ne.useState(null),[_,f]=ne.useState(null),[a,c]=ne.useState(null),[h,g]=ne.useState(!1),[u,b]=ne.useState(null),C=ne.useMemo(()=>(o==null?void 0:o.files.find(y=>y.path===a))??(o==null?void 0:o.files[0])??null,[o,a]);async function A(y=_){var v;g(!0),b(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const m=await Se.getRepositoryDiff(r,y);d(m),f(((v=m.commit)==null?void 0:v.sha)??null),c(S=>{var k;return S&&m.files.some(M=>M.path===S)?S:((k=m.files[0])==null?void 0:k.path)??null})}catch(m){b(m instanceof Error?m.message:String(m))}finally{g(!1)}}return ne.useEffect(()=>{n&&(f(null),A(null))},[n,r]),n?T.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:T.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[T.jsxs("header",{className:"repository-diff-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Commit Diff"}),T.jsx("p",{children:o?`${((x=o.commit)==null?void 0:x.shortSha)??"HEAD"} · ${o.summary.totalFiles} files · +${o.summary.additions} / -${o.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),T.jsxs("div",{className:"repository-diff-header-actions",children:[T.jsxs("label",{className:"repository-diff-commit-picker",children:[T.jsx("span",{children:"Commit"}),T.jsx("select",{value:_??"",disabled:h||!(o!=null&&o.commits.length),onChange:y=>{const v=y.target.value||null;f(v),A(v)},children:o==null?void 0:o.commits.map(y=>T.jsxs("option",{value:y.sha,children:[y.shortSha," · ",y.subject]},y.sha))})]}),T.jsx("button",{type:"button",disabled:h,onClick:()=>void A(),children:"Refresh"}),T.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),u?T.jsx("p",{className:"error-banner",children:u}):null,o!=null&&o.warnings.length?T.jsx("ul",{className:"warnings repository-diff-warnings",children:o.warnings.map(y=>T.jsx("li",{children:y},y))}):null,T.jsxs("div",{className:"repository-diff-body",children:[T.jsxs("aside",{className:"repository-diff-sidebar",children:[T.jsx(z1,{report:o,busy:h}),T.jsxs("ol",{className:"repository-diff-file-list",children:[o==null?void 0:o.files.map(y=>T.jsx("li",{className:(C==null?void 0:C.path)===y.path?"selected":"",children:T.jsxs("button",{type:"button",onClick:()=>c(y.path),children:[T.jsx("span",{children:y.path}),T.jsxs("small",{children:[Dm(y.status)," · ",Rm(y.stage)," · ",Tm(y.category)]})]})},y.path)),o&&o.files.length===0?T.jsx("li",{className:"repository-diff-empty",children:o.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),T.jsx("main",{className:"repository-diff-main",children:C?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"repository-diff-file-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:C.path}),T.jsxs("p",{children:[Tm(C.category)," · ",Dm(C.status)," · ",Rm(C.stage)]})]}),T.jsxs("span",{className:"repository-diff-stats",children:["+",C.additions," / -",C.deletions]})]}),C.binary?T.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,C.truncated?T.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,T.jsx("pre",{className:"repository-diff-code","aria-label":`${C.path} diff`,children:I1(C.diff)})]}):T.jsx("div",{className:"repository-diff-placeholder",children:h?"Loading commit diff...":"No diff selected."})})]})]})}):null}function z1({report:n,busy:r}){var o;const s=n==null?void 0:n.summary;return T.jsxs("div",{className:"repository-diff-summary",children:[T.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?T.jsxs(T.Fragment,{children:[T.jsxs("span",{children:[s.harnessFiles," harness files"]}),T.jsxs("span",{children:[s.productCodeFiles," product code files"]}),T.jsxs("span",{children:[s.committedFiles," committed files"]}),T.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),T.jsx("span",{children:((o=n==null?void 0:n.commit)==null?void 0:o.subject)??"HEAD"})]}):null]})}function Tm(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 Rm(n){return n.replaceAll("_"," ")}function Dm(n){return n.replaceAll("_"," ")}function I1(n){return n.split(`
61
- `).filter(r=>!P1(r)).map((r,s)=>T.jsx("span",{className:`repository-diff-line ${U1(r)}`,children:r||" "},`${s}:${r}`))}function U1(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 P1(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 F1({busy:n,effort:r,model:s,open:o,permissionMode:d,session:_,onClose:f,onEffortChange:a,onModelChange:c,onPermissionModeChange:h,onResume:g,onRestart:u,onStart:b,onStop:C,onNotifyHarnessUpdated:A}){return o?T.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:T.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[T.jsxs("header",{className:"translator-session-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Translator Session"}),T.jsx("p",{children:q1(_)})]}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]}),T.jsx(ah,{role:"translator",session:_??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:a,onStart:b,onResume:g,onRestart:u,onStop:C,onNotifyHarnessUpdated:A}),T.jsx("div",{className:"translator-session-terminal",children:(_==null?void 0:_.status)==="running"?T.jsx(oo,{sessionId:_.id,active:o},_.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"translator"}),T.jsx("span",{children:_!=null&&_.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function q1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function G1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const V1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W1={};function Mm(n,r){return(W1.jsx?$1:V1).test(n)}const K1=/[ \t\n\f\r]/g;function Y1(n){return typeof n=="object"?n.type==="text"?Lm(n.value):!1:Lm(n)}function Lm(n){return n.replace(K1,"")===""}class Rl{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}Rl.prototype.normal={};Rl.prototype.property={};Rl.prototype.space=void 0;function Hg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new Rl(s,o,r)}function Vu(n){return n.toLowerCase()}class fn{constructor(r,s){this.attribute=s,this.property=r}}fn.prototype.attribute="";fn.prototype.booleanish=!1;fn.prototype.boolean=!1;fn.prototype.commaOrSpaceSeparated=!1;fn.prototype.commaSeparated=!1;fn.prototype.defined=!1;fn.prototype.mustUseProperty=!1;fn.prototype.number=!1;fn.prototype.overloadedBoolean=!1;fn.prototype.property="";fn.prototype.spaceSeparated=!1;fn.prototype.space=void 0;let X1=0;const Fe=Tr(),jt=Tr(),$u=Tr(),be=Tr(),ft=Tr(),ds=Tr(),bn=Tr();function Tr(){return 2**++X1}const Wu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:jt,commaOrSpaceSeparated:bn,commaSeparated:ds,number:be,overloadedBoolean:$u,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Tu=Object.keys(Wu);class oh extends fn{constructor(r,s,o,d){let _=-1;if(super(r,s),Om(this,"space",d),typeof o=="number")for(;++_<Tu.length;){const f=Tu[_];Om(this,Tu[_],(o&Wu[f])===Wu[f])}}}oh.prototype.defined=!0;function Om(n,r,s){s&&(n[r]=s)}function _s(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const _=new oh(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(_.mustUseProperty=!0),r[o]=_,s[Vu(o)]=o,s[Vu(_.attribute)]=o}return new Rl(r,s,n.space)}const zg=_s({properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:ft,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:be,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:ft,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:jt,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 Ig(n,r){return r in n?n[r]:r}function Ug(n,r){return Ig(n,r.toLowerCase())}const Q1=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ds,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:ft,autoFocus:Fe,autoPlay:Fe,blocking:ft,capture:null,charSet:null,checked:Fe,cite:null,className:ft,cols:be,colSpan:null,content:null,contentEditable:jt,controls:Fe,controlsList:ft,coords:be|ds,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:$u,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:ft,height:be,hidden:$u,high:be,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:ft,itemRef:ft,itemScope:Fe,itemType:ft,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:ft,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:ft,required:Fe,reversed:Fe,rows:be,rowSpan:be,sandbox:ft,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:jt,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:jt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,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:jt,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:Ug}),Z1=_s({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:ft,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:ds,g2:ds,glyphName:ds,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:ft,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:Ig}),Pg=_s({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()}}),Fg=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ug}),qg=_s({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"},ey=/[A-Z]/g,Bm=/-[a-z]/g,ty=/^data[-\w.:]+$/i;function ny(n,r){const s=Vu(r);let o=r,d=fn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&ty.test(r)){if(r.charAt(4)==="-"){const _=r.slice(5).replace(Bm,ry);o="data"+_.charAt(0).toUpperCase()+_.slice(1)}else{const _=r.slice(4);if(!Bm.test(_)){let f=_.replace(ey,iy);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=oh}return new d(o,r)}function iy(n){return"-"+n.toLowerCase()}function ry(n){return n.charAt(1).toUpperCase()}const sy=Hg([zg,Q1,Pg,Fg,qg],"html"),ch=Hg([zg,Z1,Pg,Fg,qg],"svg");function ly(n){return n.join(" ").trim()}var us={},Ru,jm;function ay(){if(jm)return Ru;jm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
62
- `,h="/",g="*",u="",b="comment",C="declaration";function A(y,v){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];v=v||{};var m=1,S=1;function k(W){var Y=W.match(r);Y&&(m+=Y.length);var V=W.lastIndexOf(c);S=~V?W.length-V:S+W.length}function M(){var W={line:m,column:S};return function(Y){return Y.position=new R(W),L(),Y}}function R(W){this.start=W,this.end={line:m,column:S},this.source=v.source}R.prototype.content=y;function D(W){var Y=new Error(v.source+":"+m+":"+S+": "+W);if(Y.reason=W,Y.filename=v.source,Y.line=m,Y.column=S,Y.source=y,!v.silent)throw Y}function E(W){var Y=W.exec(y);if(Y){var V=Y[0];return k(V),y=y.slice(V.length),Y}}function L(){E(s)}function O(W){var Y;for(W=W||[];Y=I();)Y!==!1&&W.push(Y);return W}function I(){var W=M();if(!(h!=y.charAt(0)||g!=y.charAt(1))){for(var Y=2;u!=y.charAt(Y)&&(g!=y.charAt(Y)||h!=y.charAt(Y+1));)++Y;if(Y+=2,u===y.charAt(Y-1))return D("End of comment missing");var V=y.slice(2,Y-2);return S+=2,k(V),y=y.slice(Y),S+=2,W({type:b,comment:V})}}function F(){var W=M(),Y=E(o);if(Y){if(I(),!E(d))return D("property missing ':'");var V=E(_),K=W({type:C,property:x(Y[0].replace(n,u)),value:V?x(V[0].replace(n,u)):u});return E(f),K}}function U(){var W=[];O(W);for(var Y;Y=F();)Y!==!1&&(W.push(Y),O(W));return W}return L(),U()}function x(y){return y?y.replace(a,u):u}return Ru=A,Ru}var Nm;function oy(){if(Nm)return us;Nm=1;var n=us&&us.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(us,"__esModule",{value:!0}),us.default=s;const r=n(ay());function s(o,d){let _=null;if(!o||typeof o!="string")return _;const f=(0,r.default)(o),a=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:g}=c;a?d(h,g,c):g&&(_=_||{},_[h]=g)}),_}return us}var vl={},Hm;function cy(){if(Hm)return vl;Hm=1,Object.defineProperty(vl,"__esModule",{value:!0}),vl.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,_=function(h){return!h||s.test(h)||n.test(h)},f=function(h,g){return g.toUpperCase()},a=function(h,g){return"".concat(g,"-")},c=function(h,g){return g===void 0&&(g={}),_(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(d,a):h=h.replace(o,a),h.replace(r,f))};return vl.camelCase=c,vl}var yl,zm;function uy(){if(zm)return yl;zm=1;var n=yl&&yl.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(oy()),s=cy();function o(d,_){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(a,c){a&&c&&(f[(0,s.camelCase)(a,_)]=c)}),f}return o.default=o,yl=o,yl}var hy=uy();const fy=Tg(hy),Gg=Vg("end"),uh=Vg("start");function Vg(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function dy(n){const r=uh(n),s=Gg(n);if(r&&s)return{start:r,end:s}}function wl(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Im(n.position):"start"in n||"end"in n?Im(n):"line"in n||"column"in n?Ku(n):""}function Ku(n){return Um(n&&n.line)+":"+Um(n&&n.column)}function Im(n){return Ku(n&&n.start)+"-"+Ku(n&&n.end)}function Um(n){return n&&typeof n=="number"?n:1}class Wt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",_={},f=!1;if(s&&("line"in s&&"column"in s?_={place:s}:"start"in s&&"end"in s?_={place:s}:"type"in s?_={ancestors:[s],place:s.position}:_={...s}),typeof r=="string"?d=r:!_.cause&&r&&(f=!0,d=r.message,_.cause=r),!_.ruleId&&!_.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?_.ruleId=o:(_.source=o.slice(0,c),_.ruleId=o.slice(c+1))}if(!_.place&&_.ancestors&&_.ancestors){const c=_.ancestors[_.ancestors.length-1];c&&(_.place=c.position)}const a=_.place&&"start"in _.place?_.place.start:_.place;this.ancestors=_.ancestors||void 0,this.cause=_.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=a?a.line:void 0,this.name=wl(_.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}}Wt.prototype.file="";Wt.prototype.name="";Wt.prototype.reason="";Wt.prototype.message="";Wt.prototype.stack="";Wt.prototype.column=void 0;Wt.prototype.line=void 0;Wt.prototype.ancestors=void 0;Wt.prototype.cause=void 0;Wt.prototype.fatal=void 0;Wt.prototype.place=void 0;Wt.prototype.ruleId=void 0;Wt.prototype.source=void 0;const hh={}.hasOwnProperty,py=new Map,my=/[A-Z]/g,gy=new Set(["table","tbody","thead","tfoot","tr"]),_y=new Set(["td","th"]),$g="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vy(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=ky(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=Ey(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?ch:sy,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},_=Wg(d,n,void 0);return _&&typeof _!="string"?_:d.create(n,d.Fragment,{children:_||void 0},void 0)}function Wg(n,r,s){if(r.type==="element")return yy(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return Sy(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return Cy(n,r,s);if(r.type==="mdxjsEsm")return by(n,r);if(r.type==="root")return wy(n,r,s);if(r.type==="text")return xy(n,r)}function yy(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=ch,n.schema=d),n.ancestors.push(r);const _=Yg(n,r.tagName,!1),f=Ay(n,r);let a=dh(n,r);return gy.has(r.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Y1(c):!0})),Kg(n,f,_,r),fh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function Sy(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}Al(n,r.position)}function by(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Al(n,r.position)}function Cy(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=ch,n.schema=d),n.ancestors.push(r);const _=r.name===null?n.Fragment:Yg(n,r.name,!0),f=Ty(n,r),a=dh(n,r);return Kg(n,f,_,r),fh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function wy(n,r,s){const o={};return fh(o,dh(n,r)),n.create(r,n.Fragment,o,s)}function xy(n,r){return r.value}function Kg(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function fh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function Ey(n,r,s){return o;function o(d,_,f,a){const h=Array.isArray(f.children)?s:r;return a?h(_,f,a):h(_,f)}}function ky(n,r){return s;function s(o,d,_,f){const a=Array.isArray(_.children),c=uh(o);return r(d,_,f,a,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function Ay(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&hh.call(r.properties,d)){const _=Ry(n,d,r.properties[d]);if(_){const[f,a]=_;n.tableCellAlignToStyle&&f==="align"&&typeof a=="string"&&_y.has(r.tagName)?o=a:s[f]=a}}if(o){const _=s.style||(s.style={});_[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function Ty(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const _=o.data.estree.body[0];_.type;const f=_.expression;f.type;const a=f.properties[0];a.type,Object.assign(s,n.evaluater.evaluateExpression(a.argument))}else Al(n,r.position);else{const d=o.name;let _;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const a=o.value.data.estree.body[0];a.type,_=n.evaluater.evaluateExpression(a.expression)}else Al(n,r.position);else _=o.value===null?!0:o.value;s[d]=_}return s}function dh(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:py;for(;++o<r.children.length;){const _=r.children[o];let f;if(n.passKeys){const c=_.type==="element"?_.tagName:_.type==="mdxJsxFlowElement"||_.type==="mdxJsxTextElement"?_.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const a=Wg(n,_,f);a!==void 0&&s.push(a)}return s}function Ry(n,r,s){const o=ny(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?G1(s):ly(s)),o.property==="style"){let d=typeof s=="object"?s:Dy(n,String(s));return n.stylePropertyNameCase==="css"&&(d=My(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?J1[o.property]||o.property:o.attribute,s]}}function Dy(n,r){try{return fy(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Wt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=$g+"#cannot-parse-style-attribute",d}}function Yg(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let _=-1,f;for(;++_<d.length;){const a=Mm(d[_])?{type:"Identifier",name:d[_]}:{type:"Literal",value:d[_]};f=f?{type:"MemberExpression",object:f,property:a,computed:!!(_&&a.type==="Literal"),optional:!1}:a}o=f}else o=Mm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return hh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);Al(n)}function Al(n,r){const s=new Wt("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=$g+"#cannot-handle-mdx-estrees-without-createevaluater",s}function My(n){const r={};let s;for(s in n)hh.call(n,s)&&(r[Ly(s)]=n[s]);return r}function Ly(n){let r=n.replace(my,Oy);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Oy(n){return"-"+n.toLowerCase()}const Du={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"]},By={};function ph(n,r){const s=By,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Xg(n,o,d)}function Xg(n,r,s){if(jy(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 Pm(n.children,r,s)}return Array.isArray(n)?Pm(n,r,s):""}function Pm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=Xg(n[d],r,s);return o.join("")}function jy(n){return!!(n&&typeof n=="object")}const Fm=document.createElement("i");function mh(n){const r="&"+n+";";Fm.innerHTML=r;const s=Fm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Cn(n,r,s,o){const d=n.length;let _=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);_<o.length;)f=o.slice(_,_+1e4),f.unshift(r,0),n.splice(...f),_+=1e4,r+=1e4}function Ln(n,r){return n.length>0?(Cn(n,n.length,0,r),n):r}const qm={}.hasOwnProperty;function Qg(n){const r={};let s=-1;for(;++s<n.length;)Ny(r,n[s]);return r}function Ny(n,r){let s;for(s in r){const d=(qm.call(n,s)?n[s]:void 0)||(n[s]={}),_=r[s];let f;if(_)for(f in _){qm.call(d,f)||(d[f]=[]);const a=_[f];Hy(d[f],Array.isArray(a)?a:a?[a]:[])}}}function Hy(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);Cn(n,0,0,o)}function Zg(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 Fn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=ir(/[A-Za-z]/),$t=ir(/[\dA-Za-z]/),zy=ir(/[#-'*+\--9=?A-Z^-~]/);function no(n){return n!==null&&(n<32||n===127)}const Yu=ir(/\d/),Iy=ir(/[\dA-Fa-f]/),Uy=ir(/[!-/:-@[-`{-~]/);function Le(n){return n!==null&&n<-2}function ut(n){return n!==null&&(n<0||n===32)}function $e(n){return n===-2||n===-1||n===32}const co=ir(new RegExp("\\p{P}|\\p{S}","u")),Ar=ir(/\s/);function ir(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function vs(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const _=n.charCodeAt(s);let f="";if(_===37&&$t(n.charCodeAt(s+1))&&$t(n.charCodeAt(s+2)))d=2;else if(_<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(_))||(f=String.fromCharCode(_));else if(_>55295&&_<57344){const a=n.charCodeAt(s+1);_<56320&&a>56319&&a<57344?(f=String.fromCharCode(_,a),d=1):f="�"}else f=String.fromCharCode(_);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function Qe(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let _=0;return f;function f(c){return $e(c)?(n.enter(s),a(c)):r(c)}function a(c){return $e(c)&&_++<d?(n.consume(c),a):(n.exit(s),r(c))}}const Py={tokenize:Fy};function Fy(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Qe(n,r,"linePrefix")}function d(a){return n.enter("paragraph"),_(a)}function _(a){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(a)}function f(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Le(a)?(n.consume(a),n.exit("chunkText"),_):(n.consume(a),f)}}const qy={tokenize:Gy},Gm={tokenize:Vy};function Gy(n){const r=this,s=[];let o=0,d,_,f;return a;function a(S){if(o<s.length){const k=s[o];return r.containerState=k[1],n.attempt(k[0].continuation,c,h)(S)}return h(S)}function c(S){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&m();const k=r.events.length;let M=k,R;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){R=r.events[M][1].end;break}v(o);let D=k;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return Cn(r.events,M+1,0,r.events.slice(k)),r.events.length=D,h(S)}return a(S)}function h(S){if(o===s.length){if(!d)return b(S);if(d.currentConstruct&&d.currentConstruct.concrete)return A(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Gm,g,u)(S)}function g(S){return d&&m(),v(o),b(S)}function u(S){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,A(S)}function b(S){return r.containerState={},n.attempt(Gm,C,A)(S)}function C(S){return o++,s.push([r.currentConstruct,r.containerState]),b(S)}function A(S){if(S===null){d&&m(),v(0),n.consume(S);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:_}),x(S)}function x(S){if(S===null){y(n.exit("chunkFlow"),!0),v(0),n.consume(S);return}return Le(S)?(n.consume(S),y(n.exit("chunkFlow")),o=0,r.interrupt=void 0,a):(n.consume(S),x)}function y(S,k){const M=r.sliceStream(S);if(k&&M.push(null),S.previous=_,_&&(_.next=S),_=S,d.defineSkip(S.start),d.write(M),r.parser.lazy[S.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let E=D,L,O;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(L){O=r.events[E][1].end;break}L=!0}for(v(o),R=D;R<r.events.length;)r.events[R][1].end={...O},R++;Cn(r.events,E+1,0,r.events.slice(D)),r.events.length=R}}function v(S){let k=s.length;for(;k-- >S;){const M=s[k];r.containerState=M[1],M[0].exit.call(r,n)}s.length=S}function m(){d.write([null]),_=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Vy(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 ms(n){if(n===null||ut(n)||Ar(n))return 1;if(co(n))return 2}function uo(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const _=n[d].resolveAll;_&&!o.includes(_)&&(r=_(r,s),o.push(_))}return r}const Xu={name:"attention",resolveAll:$y,tokenize:Wy};function $y(n,r){let s=-1,o,d,_,f,a,c,h,g;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},b={...n[s][1].start};Vm(u,-c),Vm(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},_={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...a.end}},n[o][1].end={...f.start},n[s][1].start={...a.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=Ln(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=Ln(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",_,r]]),h=Ln(h,uo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=Ln(h,[["exit",_,r],["enter",a,r],["exit",a,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(g=2,h=Ln(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):g=0,Cn(n,o-1,s-o+3,h),s=o+h.length-g-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function Wy(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=ms(o);let _;return f;function f(c){return _=c,n.enter("attentionSequence"),a(c)}function a(c){if(c===_)return n.consume(c),a;const h=n.exit("attentionSequence"),g=ms(c),u=!g||g===2&&d||s.includes(c),b=!d||d===2&&g||s.includes(o);return h._open=!!(_===42?u:u&&(d||!b)),h._close=!!(_===42?b:b&&(g||!u)),r(c)}}function Vm(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const Ky={name:"autolink",tokenize:Yy};function Yy(n,r,s){let o=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),_}function _(C){return Jt(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||$t(C)?(o=1,a(C)):h(C)}function a(C){return C===58?(n.consume(C),o=0,c):(C===43||C===45||C===46||$t(C))&&o++<32?(n.consume(C),a):(o=0,h(C))}function c(C){return C===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):C===null||C===32||C===60||no(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),g):zy(C)?(n.consume(C),h):s(C)}function g(C){return $t(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),o=0,g):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):b(C)}function b(C){if((C===45||$t(C))&&o++<63){const A=C===45?b:u;return n.consume(C),A}return s(C)}}const Dl={partial:!0,tokenize:Xy};function Xy(n,r,s){return o;function o(_){return $e(_)?Qe(n,d,"linePrefix")(_):d(_)}function d(_){return _===null||Le(_)?r(_):s(_)}}const Jg={continuation:{tokenize:Zy},exit:Jy,name:"blockQuote",tokenize:Qy};function Qy(n,r,s){const o=this;return d;function d(f){if(f===62){const a=o.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),_}return s(f)}function _(f){return $e(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function Zy(n,r,s){const o=this;return d;function d(f){return $e(f)?Qe(n,_,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):_(f)}function _(f){return n.attempt(Jg,r,s)(f)}}function Jy(n){n.exit("blockQuote")}const e_={name:"characterEscape",tokenize:eS};function eS(n,r,s){return o;function o(_){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(_),n.exit("escapeMarker"),d}function d(_){return Uy(_)?(n.enter("characterEscapeValue"),n.consume(_),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(_)}}const t_={name:"characterReference",tokenize:tS};function tS(n,r,s){const o=this;let d=0,_,f;return a;function a(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),_=31,f=$t,g(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),_=6,f=Iy,g):(n.enter("characterReferenceValue"),_=7,f=Yu,g(u))}function g(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===$t&&!mh(o.sliceSerialize(b))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<_?(n.consume(u),g):s(u)}}const $m={partial:!0,tokenize:iS},Wm={concrete:!0,name:"codeFenced",tokenize:nS};function nS(n,r,s){const o=this,d={partial:!0,tokenize:M};let _=0,f=0,a;return c;function c(R){return h(R)}function h(R){const D=o.events[o.events.length-1];return _=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=R,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===a?(f++,n.consume(R),g):f<3?s(R):(n.exit("codeFencedFenceSequence"),$e(R)?Qe(n,u,"whitespace")(R):u(R))}function u(R){return R===null||Le(R)?(n.exit("codeFencedFence"),o.interrupt?r(R):n.check($m,x,k)(R)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Le(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(R)):$e(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Qe(n,C,"whitespace")(R)):R===96&&R===a?s(R):(n.consume(R),b)}function C(R){return R===null||Le(R)?u(R):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),A(R))}function A(R){return R===null||Le(R)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(R)):R===96&&R===a?s(R):(n.consume(R),A)}function x(R){return n.attempt(d,k,y)(R)}function y(R){return n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),v}function v(R){return _>0&&$e(R)?Qe(n,m,"linePrefix",_+1)(R):m(R)}function m(R){return R===null||Le(R)?n.check($m,x,k)(R):(n.enter("codeFlowValue"),S(R))}function S(R){return R===null||Le(R)?(n.exit("codeFlowValue"),m(R)):(n.consume(R),S)}function k(R){return n.exit("codeFenced"),r(R)}function M(R,D,E){let L=0;return O;function O(Y){return R.enter("lineEnding"),R.consume(Y),R.exit("lineEnding"),I}function I(Y){return R.enter("codeFencedFence"),$e(Y)?Qe(R,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===a?(R.enter("codeFencedFenceSequence"),U(Y)):E(Y)}function U(Y){return Y===a?(L++,R.consume(Y),U):L>=f?(R.exit("codeFencedFenceSequence"),$e(Y)?Qe(R,W,"whitespace")(Y):W(Y)):E(Y)}function W(Y){return Y===null||Le(Y)?(R.exit("codeFencedFence"),D(Y)):E(Y)}}}function iS(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Mu={name:"codeIndented",tokenize:sS},rS={partial:!0,tokenize:lS};function sS(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Qe(n,_,"linePrefix",5)(h)}function _(h){const g=o.events[o.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Le(h)?n.attempt(rS,f,c)(h):(n.enter("codeFlowValue"),a(h))}function a(h){return h===null||Le(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),a)}function c(h){return n.exit("codeIndented"),r(h)}}function lS(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Qe(n,_,"linePrefix",5)(f)}function _(f){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):Le(f)?d(f):s(f)}}const aS={name:"codeText",previous:cS,resolve:oS,tokenize:uS};function oS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function cS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uS(n,r,s){let o=0,d,_;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),a(u)}function a(u){return u===96?(n.consume(u),o++,a):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(_=n.enter("codeTextSequence"),d=0,g(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 g(u){return u===96?(n.consume(u),d++,g):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(_.type="codeTextData",h(u))}}class hS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const _=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&Sl(this.left,o),_.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Sl(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Sl(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);Sl(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Sl(this.left,s.reverse())}}}function Sl(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 n_(n){const r={};let s=-1,o,d,_,f,a,c,h;const g=new hS(n);for(;++s<g.length;){for(;s in r;)s=r[s];if(o=g.get(s),s&&o[1].type==="chunkFlow"&&g.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,_=0,_<c.length&&c[_][1].type==="lineEndingBlank"&&(_+=2),_<c.length&&c[_][1].type==="content"))for(;++_<c.length&&c[_][1].type!=="content";)c[_][1].type==="chunkText"&&(c[_][1]._isInFirstContentOfListItem=!0,_++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,fS(g,s)),s=r[s],h=!0);else if(o[1]._container){for(_=s,d=void 0;_--;)if(f=g.get(_),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(g.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=_);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...g.get(d)[1].start},a=g.slice(d,s),a.unshift(o),g.splice(d,s-d+1,a))}}return Cn(n,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function fS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const _=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const a=f.events,c=[],h={};let g,u,b=-1,C=s,A=0,x=0;const y=[x];for(;C;){for(;n.get(++d)[1]!==C;);_.push(d),C._tokenizer||(g=o.sliceStream(C),C.next||g.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++b<a.length;)a[b][0]==="exit"&&a[b-1][0]==="enter"&&a[b][1].type===a[b-1][1].type&&a[b][1].start.line!==a[b][1].end.line&&(x=b+1,y.push(x),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):y.pop(),b=y.length;b--;){const v=a.slice(y[b],y[b+1]),m=_.pop();c.push([m,m+v.length-1]),n.splice(m,2,v)}for(c.reverse(),b=-1;++b<c.length;)h[A+c[b][0]]=A+c[b][1],A+=c[b][1]-c[b][0]-1;return h}const dS={resolve:mS,tokenize:gS},pS={partial:!0,tokenize:_S};function mS(n){return n_(n),n}function gS(n,r){let s;return o;function o(a){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(a)}function d(a){return a===null?_(a):Le(a)?n.check(pS,f,_)(a):(n.consume(a),d)}function _(a){return n.exit("chunkContent"),n.exit("content"),r(a)}function f(a){return n.consume(a),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function _S(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Qe(n,_,"linePrefix")}function _(f){if(f===null||Le(f))return s(f);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function i_(n,r,s,o,d,_,f,a,c){const h=c||Number.POSITIVE_INFINITY;let g=0;return u;function u(v){return v===60?(n.enter(o),n.enter(d),n.enter(_),n.consume(v),n.exit(_),b):v===null||v===32||v===41||no(v)?s(v):(n.enter(o),n.enter(f),n.enter(a),n.enter("chunkString",{contentType:"string"}),x(v))}function b(v){return v===62?(n.enter(_),n.consume(v),n.exit(_),n.exit(d),n.exit(o),r):(n.enter(a),n.enter("chunkString",{contentType:"string"}),C(v))}function C(v){return v===62?(n.exit("chunkString"),n.exit(a),b(v)):v===null||v===60||Le(v)?s(v):(n.consume(v),v===92?A:C)}function A(v){return v===60||v===62||v===92?(n.consume(v),C):C(v)}function x(v){return!g&&(v===null||v===41||ut(v))?(n.exit("chunkString"),n.exit(a),n.exit(f),n.exit(o),r(v)):g<h&&v===40?(n.consume(v),g++,x):v===41?(n.consume(v),g--,x):v===null||v===32||v===40||no(v)?s(v):(n.consume(v),v===92?y:x)}function y(v){return v===40||v===41||v===92?(n.consume(v),x):x(v)}}function r_(n,r,s,o,d,_){const f=this;let a=0,c;return h;function h(C){return n.enter(o),n.enter(d),n.consume(C),n.exit(d),n.enter(_),g}function g(C){return a>999||C===null||C===91||C===93&&!c||C===94&&!a&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(_),n.enter(d),n.consume(C),n.exit(d),n.exit(o),r):Le(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),g):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Le(C)||a++>999?(n.exit("chunkString"),g(C)):(n.consume(C),c||(c=!$e(C)),C===92?b:u)}function b(C){return C===91||C===92||C===93?(n.consume(C),a++,u):u(C)}}function s_(n,r,s,o,d,_){let f;return a;function a(b){return b===34||b===39||b===40?(n.enter(o),n.enter(d),n.consume(b),n.exit(d),f=b===40?41:b,c):s(b)}function c(b){return b===f?(n.enter(d),n.consume(b),n.exit(d),n.exit(o),r):(n.enter(_),h(b))}function h(b){return b===f?(n.exit(_),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"}),g(b))}function g(b){return b===f||b===null||Le(b)?(n.exit("chunkString"),h(b)):(n.consume(b),b===92?u:g)}function u(b){return b===f||b===92?(n.consume(b),g):g(b)}}function xl(n,r){let s;return o;function o(d){return Le(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):$e(d)?Qe(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const vS={name:"definition",tokenize:SS},yS={partial:!0,tokenize:bS};function SS(n,r,s){const o=this;let d;return _;function _(C){return n.enter("definition"),f(C)}function f(C){return r_.call(o,n,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function a(C){return d=Fn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),c):s(C)}function c(C){return ut(C)?xl(n,h)(C):h(C)}function h(C){return i_(n,g,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function g(C){return n.attempt(yS,u,u)(C)}function u(C){return $e(C)?Qe(n,b,"whitespace")(C):b(C)}function b(C){return C===null||Le(C)?(n.exit("definition"),o.parser.defined.push(d),r(C)):s(C)}}function bS(n,r,s){return o;function o(a){return ut(a)?xl(n,d)(a):s(a)}function d(a){return s_(n,_,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function _(a){return $e(a)?Qe(n,f,"whitespace")(a):f(a)}function f(a){return a===null||Le(a)?r(a):s(a)}}const CS={name:"hardBreakEscape",tokenize:wS};function wS(n,r,s){return o;function o(_){return n.enter("hardBreakEscape"),n.consume(_),d}function d(_){return Le(_)?(n.exit("hardBreakEscape"),r(_)):s(_)}}const xS={name:"headingAtx",resolve:ES,tokenize:kS};function ES(n,r){let s=n.length-2,o=3,d,_;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},_={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},Cn(n,o,s-o+1,[["enter",d,r],["enter",_,r],["exit",_,r],["exit",d,r]])),n}function kS(n,r,s){let o=0;return d;function d(g){return n.enter("atxHeading"),_(g)}function _(g){return n.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&o++<6?(n.consume(g),f):g===null||ut(g)?(n.exit("atxHeadingSequence"),a(g)):s(g)}function a(g){return g===35?(n.enter("atxHeadingSequence"),c(g)):g===null||Le(g)?(n.exit("atxHeading"),r(g)):$e(g)?Qe(n,a,"whitespace")(g):(n.enter("atxHeadingText"),h(g))}function c(g){return g===35?(n.consume(g),c):(n.exit("atxHeadingSequence"),a(g))}function h(g){return g===null||g===35||ut(g)?(n.exit("atxHeadingText"),a(g)):(n.consume(g),h)}}const AS=["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"],Km=["pre","script","style","textarea"],TS={concrete:!0,name:"htmlFlow",resolveTo:MS,tokenize:LS},RS={partial:!0,tokenize:BS},DS={partial:!0,tokenize:OS};function MS(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 LS(n,r,s){const o=this;let d,_,f,a,c;return h;function h(N){return g(N)}function g(N){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(N),u}function u(N){return N===33?(n.consume(N),b):N===47?(n.consume(N),_=!0,x):N===63?(n.consume(N),d=3,o.interrupt?r:j):Jt(N)?(n.consume(N),f=String.fromCharCode(N),y):s(N)}function b(N){return N===45?(n.consume(N),d=2,C):N===91?(n.consume(N),d=5,a=0,A):Jt(N)?(n.consume(N),d=4,o.interrupt?r:j):s(N)}function C(N){return N===45?(n.consume(N),o.interrupt?r:j):s(N)}function A(N){const Z="CDATA[";return N===Z.charCodeAt(a++)?(n.consume(N),a===Z.length?o.interrupt?r:F:A):s(N)}function x(N){return Jt(N)?(n.consume(N),f=String.fromCharCode(N),y):s(N)}function y(N){if(N===null||N===47||N===62||ut(N)){const Z=N===47,ue=f.toLowerCase();return!Z&&!_&&Km.includes(ue)?(d=1,o.interrupt?r(N):F(N)):AS.includes(f.toLowerCase())?(d=6,Z?(n.consume(N),v):o.interrupt?r(N):F(N)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(N):_?m(N):S(N))}return N===45||$t(N)?(n.consume(N),f+=String.fromCharCode(N),y):s(N)}function v(N){return N===62?(n.consume(N),o.interrupt?r:F):s(N)}function m(N){return $e(N)?(n.consume(N),m):O(N)}function S(N){return N===47?(n.consume(N),O):N===58||N===95||Jt(N)?(n.consume(N),k):$e(N)?(n.consume(N),S):O(N)}function k(N){return N===45||N===46||N===58||N===95||$t(N)?(n.consume(N),k):M(N)}function M(N){return N===61?(n.consume(N),R):$e(N)?(n.consume(N),M):S(N)}function R(N){return N===null||N===60||N===61||N===62||N===96?s(N):N===34||N===39?(n.consume(N),c=N,D):$e(N)?(n.consume(N),R):E(N)}function D(N){return N===c?(n.consume(N),c=null,L):N===null||Le(N)?s(N):(n.consume(N),D)}function E(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ut(N)?M(N):(n.consume(N),E)}function L(N){return N===47||N===62||$e(N)?S(N):s(N)}function O(N){return N===62?(n.consume(N),I):s(N)}function I(N){return N===null||Le(N)?F(N):$e(N)?(n.consume(N),I):s(N)}function F(N){return N===45&&d===2?(n.consume(N),V):N===60&&d===1?(n.consume(N),K):N===62&&d===4?(n.consume(N),H):N===63&&d===3?(n.consume(N),j):N===93&&d===5?(n.consume(N),z):Le(N)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(RS,G,U)(N)):N===null||Le(N)?(n.exit("htmlFlowData"),U(N)):(n.consume(N),F)}function U(N){return n.check(DS,W,G)(N)}function W(N){return n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),Y}function Y(N){return N===null||Le(N)?U(N):(n.enter("htmlFlowData"),F(N))}function V(N){return N===45?(n.consume(N),j):F(N)}function K(N){return N===47?(n.consume(N),f="",J):F(N)}function J(N){if(N===62){const Z=f.toLowerCase();return Km.includes(Z)?(n.consume(N),H):F(N)}return Jt(N)&&f.length<8?(n.consume(N),f+=String.fromCharCode(N),J):F(N)}function z(N){return N===93?(n.consume(N),j):F(N)}function j(N){return N===62?(n.consume(N),H):N===45&&d===2?(n.consume(N),j):F(N)}function H(N){return N===null||Le(N)?(n.exit("htmlFlowData"),G(N)):(n.consume(N),H)}function G(N){return n.exit("htmlFlow"),r(N)}}function OS(n,r,s){const o=this;return d;function d(f){return Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_):s(f)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function BS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(Dl,r,s)}}const jS={name:"htmlText",tokenize:NS};function NS(n,r,s){const o=this;let d,_,f;return a;function a(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),M):j===63?(n.consume(j),S):Jt(j)?(n.consume(j),E):s(j)}function h(j){return j===45?(n.consume(j),g):j===91?(n.consume(j),_=0,A):Jt(j)?(n.consume(j),m):s(j)}function g(j){return j===45?(n.consume(j),C):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),C):u(j)}function C(j){return j===62?V(j):j===45?b(j):u(j)}function A(j){const H="CDATA[";return j===H.charCodeAt(_++)?(n.consume(j),_===H.length?x:A):s(j)}function x(j){return j===null?s(j):j===93?(n.consume(j),y):Le(j)?(f=x,K(j)):(n.consume(j),x)}function y(j){return j===93?(n.consume(j),v):x(j)}function v(j){return j===62?V(j):j===93?(n.consume(j),v):x(j)}function m(j){return j===null||j===62?V(j):Le(j)?(f=m,K(j)):(n.consume(j),m)}function S(j){return j===null?s(j):j===63?(n.consume(j),k):Le(j)?(f=S,K(j)):(n.consume(j),S)}function k(j){return j===62?V(j):S(j)}function M(j){return Jt(j)?(n.consume(j),R):s(j)}function R(j){return j===45||$t(j)?(n.consume(j),R):D(j)}function D(j){return Le(j)?(f=D,K(j)):$e(j)?(n.consume(j),D):V(j)}function E(j){return j===45||$t(j)?(n.consume(j),E):j===47||j===62||ut(j)?L(j):s(j)}function L(j){return j===47?(n.consume(j),V):j===58||j===95||Jt(j)?(n.consume(j),O):Le(j)?(f=L,K(j)):$e(j)?(n.consume(j),L):V(j)}function O(j){return j===45||j===46||j===58||j===95||$t(j)?(n.consume(j),O):I(j)}function I(j){return j===61?(n.consume(j),F):Le(j)?(f=I,K(j)):$e(j)?(n.consume(j),I):L(j)}function F(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,U):Le(j)?(f=F,K(j)):$e(j)?(n.consume(j),F):(n.consume(j),W)}function U(j){return j===d?(n.consume(j),d=void 0,Y):j===null?s(j):Le(j)?(f=U,K(j)):(n.consume(j),U)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ut(j)?L(j):(n.consume(j),W)}function Y(j){return j===47||j===62||ut(j)?L(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"),J}function J(j){return $e(j)?Qe(n,z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const gh={name:"labelEnd",resolveAll:US,resolveTo:PS,tokenize:FS},HS={tokenize:qS},zS={tokenize:GS},IS={tokenize:VS};function US(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&Cn(n,0,n.length,s),n}function PS(n,r){let s=n.length,o=0,d,_,f,a;for(;s--;)if(d=n[s][1],_){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(_=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[_][1].type==="labelLink"?"link":"image",start:{...n[_][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[_][1].start},end:{...n[f][1].end}},g={type:"labelText",start:{...n[_+o+2][1].end},end:{...n[f-2][1].start}};return a=[["enter",c,r],["enter",h,r]],a=Ln(a,n.slice(_+1,_+o+3)),a=Ln(a,[["enter",g,r]]),a=Ln(a,uo(r.parser.constructs.insideSpan.null,n.slice(_+o+4,f-3),r)),a=Ln(a,[["exit",g,r],n[f-2],n[f-1],["exit",h,r]]),a=Ln(a,n.slice(f+1)),a=Ln(a,[["exit",c,r]]),Cn(n,_,n.length,a),n}function FS(n,r,s){const o=this;let d=o.events.length,_,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){_=o.events[d][1];break}return a;function a(b){return _?_._inactive?u(b):(f=o.parser.defined.includes(Fn(o.sliceSerialize({start:_.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(b),n.exit("labelMarker"),n.exit("labelEnd"),c):s(b)}function c(b){return b===40?n.attempt(HS,g,f?g:u)(b):b===91?n.attempt(zS,g,f?h:u)(b):f?g(b):u(b)}function h(b){return n.attempt(IS,g,u)(b)}function g(b){return r(b)}function u(b){return _._balanced=!0,s(b)}}function qS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ut(u)?xl(n,_)(u):_(u)}function _(u){return u===41?g(u):i_(n,f,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ut(u)?xl(n,c)(u):g(u)}function a(u){return s(u)}function c(u){return u===34||u===39||u===40?s_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):g(u)}function h(u){return ut(u)?xl(n,g)(u):g(u)}function g(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function GS(n,r,s){const o=this;return d;function d(a){return r_.call(o,n,_,f,"reference","referenceMarker","referenceString")(a)}function _(a){return o.parser.defined.includes(Fn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(a):s(a)}function f(a){return s(a)}}function VS(n,r,s){return o;function o(_){return n.enter("reference"),n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),d}function d(_){return _===93?(n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),n.exit("reference"),r):s(_)}}const $S={name:"labelStartImage",resolveAll:gh.resolveAll,tokenize:WS};function WS(n,r,s){const o=this;return d;function d(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),_}function _(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),f):s(a)}function f(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(a):r(a)}}const KS={name:"labelStartLink",resolveAll:gh.resolveAll,tokenize:YS};function YS(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),_}function _(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Lu={name:"lineEnding",tokenize:XS};function XS(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Qe(n,r,"linePrefix")}}const to={name:"thematicBreak",tokenize:QS};function QS(n,r,s){let o=0,d;return _;function _(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,a(h)}function a(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Le(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),$e(h)?Qe(n,a,"whitespace")(h):a(h))}}const hn={continuation:{tokenize:tb},exit:ib,name:"list",tokenize:eb},ZS={partial:!0,tokenize:rb},JS={partial:!0,tokenize:nb};function eb(n,r,s){const o=this,d=o.events[o.events.length-1];let _=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return a;function a(C){const A=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:Yu(C)){if(o.containerState.type||(o.containerState.type=A,n.enter(A,{_container:!0})),A==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(to,s,h)(C):h(C);if(!o.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return Yu(C)&&++f<10?(n.consume(C),c):(!o.interrupt||f<2)&&(o.containerState.marker?C===o.containerState.marker:C===41||C===46)?(n.exit("listItemValue"),h(C)):s(C)}function h(C){return n.enter("listItemMarker"),n.consume(C),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||C,n.check(Dl,o.interrupt?s:g,n.attempt(ZS,b,u))}function g(C){return o.containerState.initialBlankLine=!0,_++,b(C)}function u(C){return $e(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),b):s(C)}function b(C){return o.containerState.size=_+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function tb(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(Dl,d,_);function d(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Qe(n,r,"listItemIndent",o.containerState.size+1)(a)}function _(a){return o.containerState.furtherBlankLines||!$e(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(JS,r,f)(a))}function f(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Qe(n,n.attempt(hn,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function nb(n,r,s){const o=this;return Qe(n,d,"listItemIndent",o.containerState.size+1);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(_):s(_)}}function ib(n){n.exit(this.containerState.type)}function rb(n,r,s){const o=this;return Qe(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(_){const f=o.events[o.events.length-1];return!$e(_)&&f&&f[1].type==="listItemPrefixWhitespace"?r(_):s(_)}}const Ym={name:"setextUnderline",resolveTo:sb,tokenize:lb};function sb(n,r){let s=n.length,o,d,_;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!_&&n[s][1].type==="definition"&&(_=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",_?(n.splice(d,0,["enter",f,r]),n.splice(_+1,0,["exit",n[o][1],r]),n[o][1].end={...n[_][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function lb(n,r,s){const o=this;let d;return _;function _(h){let g=o.events.length,u;for(;g--;)if(o.events[g][1].type!=="lineEnding"&&o.events[g][1].type!=="linePrefix"&&o.events[g][1].type!=="content"){u=o.events[g][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),a(h)}function a(h){return h===d?(n.consume(h),a):(n.exit("setextHeadingLineSequence"),$e(h)?Qe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const ab={tokenize:ob};function ob(n){const r=this,s=n.attempt(Dl,o,n.attempt(this.parser.constructs.flowInitial,d,Qe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(dS,d)),"linePrefix")));return s;function o(_){if(_===null){n.consume(_);return}return n.enter("lineEndingBlank"),n.consume(_),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(_){if(_===null){n.consume(_);return}return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const cb={resolveAll:a_()},ub=l_("string"),hb=l_("text");function l_(n){return{resolveAll:a_(n==="text"?fb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],_=s.attempt(d,f,a);return f;function f(g){return h(g)?_(g):a(g)}function a(g){if(g===null){s.consume(g);return}return s.enter("data"),s.consume(g),c}function c(g){return h(g)?(s.exit("data"),_(g)):(s.consume(g),c)}function h(g){if(g===null)return!0;const u=d[g];let b=-1;if(u)for(;++b<u.length;){const C=u[b];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function a_(n){return r;function r(s,o){let d=-1,_;for(;++d<=s.length;)_===void 0?s[d]&&s[d][1].type==="data"&&(_=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==_+2&&(s[_][1].end=s[d-1][1].end,s.splice(_+2,d-_-2),d=_+2),_=void 0);return n?n(s,o):s}}function fb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],d=r.sliceStream(o);let _=d.length,f=-1,a=0,c;for(;_--;){const h=d[_];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)a++,f--;if(f)break;f=-1}else if(h===-2)c=!0,a++;else if(h!==-1){_++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(a=0),a){const h={type:s===n.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:_?f:o.start._bufferIndex+f,_index:o.start._index+_,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const db={42:hn,43:hn,45:hn,48:hn,49:hn,50:hn,51:hn,52:hn,53:hn,54:hn,55:hn,56:hn,57:hn,62:Jg},pb={91:vS},mb={[-2]:Mu,[-1]:Mu,32:Mu},gb={35:xS,42:to,45:[Ym,to],60:TS,61:Ym,95:to,96:Wm,126:Wm},_b={38:t_,92:e_},vb={[-5]:Lu,[-4]:Lu,[-3]:Lu,33:$S,38:t_,42:Xu,60:[Ky,jS],91:KS,92:[CS,e_],93:gh,95:Xu,96:aS},yb={null:[Xu,cb]},Sb={null:[42,95]},bb={null:[]},Cb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sb,contentInitial:pb,disable:bb,document:db,flow:gb,flowInitial:mb,insideSpan:yb,string:_b,text:vb},Symbol.toStringTag,{value:"Module"}));function wb(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},_=[];let f=[],a=[];const c={attempt:D(M),check:D(R),consume:m,enter:S,exit:k,interrupt:D(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:A,parser:n,previous:null,sliceSerialize:b,sliceStream:C,write:u};let g=r.tokenize.call(h,c);return r.resolveAll&&_.push(r),h;function u(I){return f=Ln(f,I),y(),f[f.length-1]!==null?[]:(E(r,0),h.events=uo(_,h.events,h),h.events)}function b(I,F){return Eb(C(I),F)}function C(I){return xb(f,I)}function A(){const{_bufferIndex:I,_index:F,line:U,column:W,offset:Y}=o;return{_bufferIndex:I,_index:F,line:U,column:W,offset:Y}}function x(I){d[I.line]=I.column,O()}function y(){let I;for(;o._index<f.length;){const F=f[o._index];if(typeof F=="string")for(I=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===I&&o._bufferIndex<F.length;)v(F.charCodeAt(o._bufferIndex));else v(F)}}function v(I){g=g(I)}function m(I){Le(I)?(o.line++,o.column=1,o.offset+=I===-3?2:1,O()):I!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=I}function S(I,F){const U=F||{};return U.type=I,U.start=A(),h.events.push(["enter",U,h]),a.push(U),U}function k(I){const F=a.pop();return F.end=A(),h.events.push(["exit",F,h]),F}function M(I,F){E(I,F.from)}function R(I,F){F.restore()}function D(I,F){return U;function U(W,Y,V){let K,J,z,j;return Array.isArray(W)?G(W):"tokenize"in W?G([W]):H(W);function H(ve){return X;function X(q){const fe=q!==null&&ve[q],ce=q!==null&&ve.null,de=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return G(de)(q)}}function G(ve){return K=ve,J=0,ve.length===0?V:N(ve[J])}function N(ve){return X;function X(q){return j=L(),z=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?ue():ve.tokenize.call(F?Object.assign(Object.create(h),F):h,c,Z,ue)(q)}}function Z(ve){return I(z,j),Y}function ue(ve){return j.restore(),++J<K.length?N(K[J]):V}}}function E(I,F){I.resolveAll&&!_.includes(I)&&_.push(I),I.resolve&&Cn(h.events,F,h.events.length-F,I.resolve(h.events.slice(F),h)),I.resolveTo&&(h.events=I.resolveTo(h.events,h))}function L(){const I=A(),F=h.previous,U=h.currentConstruct,W=h.events.length,Y=Array.from(a);return{from:W,restore:V};function V(){o=I,h.previous=F,h.currentConstruct=U,h.events.length=W,a=Y,O()}}function O(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function xb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,_=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,_)];else{if(f=n.slice(s,d),o>-1){const a=f[0];typeof a=="string"?f[0]=a.slice(o):f.shift()}_>0&&f.push(n[d].slice(0,_))}return f}function Eb(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const _=n[s];let f;if(typeof _=="string")f=_;else switch(_){case-5:{f="\r";break}case-4:{f=`
59
+ `,m)}paste(v){this._core.paste(v)}refresh(v,m){this._verifyIntegers(v,m),this._core.refresh(v,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return a}_verifyIntegers(...v){for(const m of v)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const m of v)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),_})()))})(Au)),Au.exports}var L1=M1();class O1{constructor(r,s){am(this,"socket");const o=window.location.protocol==="https:"?"wss:":"ws:";this.socket=new WebSocket(`${o}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`),this.socket.addEventListener("message",d=>{var f,a;const _=JSON.parse(d.data);_.type==="output"?s.onOutput(_.data):_.type==="error"?(f=s.onError)==null||f.call(s,_.message):(a=s.onStatus)==null||a.call(s,_)}),this.socket.addEventListener("error",()=>{var d;(d=s.onError)==null||d.call(s,"Terminal connection failed.")})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function oo({sessionId:n,active:r=!0,onEvent:s}){const o=ie.useRef(null),d=ie.useRef(null),_=ie.useRef(null),f=ie.useRef(null),a=ie.useRef(r),c=ie.useRef(s);function h(g={}){const u=o.current,b=d.current,C=_.current,A=f.current;if(!u||!b||!C||!A)return!1;const x=u.getBoundingClientRect();return x.width<wm||x.height<xm||(C.fit(),A.cols<Em||A.rows<km)?!1:(b.resize(A.cols,A.rows),g.focus&&A.focus(),!0)}return ie.useEffect(()=>{c.current=s},[s]),ie.useEffect(()=>{a.current=r},[r]),ie.useEffect(()=>{if(!o.current)return;const g=new L1.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:B1}),u=new T1.FitAddon;g.loadAddon(u),g.loadAddon(new D1.WebLinksAddon),g.open(o.current),f.current=g,_.current=u;const b=o.current.getBoundingClientRect();b.width>=wm&&b.height>=xm&&u.fit();const C=new O1(n,{onOutput(k){g.write(k)},onStatus(k){var M;(M=c.current)==null||M.call(c,k.type)},onError(k){var M;g.writeln(`\r
60
+ [VCM] ${k}`),(M=c.current)==null||M.call(c,k)}});d.current=C,g.cols>=Em&&g.rows>=km&&C.resize(g.cols,g.rows);const A=g.onData(k=>{C.sendInput(k)});let x=0,y=0,v=0;const m=()=>{x&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{x=0,h({focus:a.current})})},S=new ResizeObserver(()=>{m()});return S.observe(o.current),y=window.requestAnimationFrame(m),v=window.setTimeout(m,120),()=>{x&&window.cancelAnimationFrame(x),y&&window.cancelAnimationFrame(y),v&&window.clearTimeout(v),S.disconnect(),A.dispose(),C.close(),g.dispose(),d.current=null,f.current=null,_.current=null}},[n]),ie.useEffect(()=>{if(!r)return;const g=[],u=[];return g.push(window.requestAnimationFrame(()=>{h({focus:!0}),g.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 g)window.cancelAnimationFrame(b);for(const b of u)window.clearTimeout(b)}},[r]),ie.useEffect(()=>{const g=()=>{a.current&&h()};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),T.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var g;return(g=f.current)==null?void 0:g.focus()}})}const wm=160,xm=80,Em=20,km=5,B1={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"},jg=[{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"}],j1=[{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"}],Ng=[...j1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function yi({status:n}){return T.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function ah({role:n,session:r,permissionMode:s,model:o,effort:d,busy:_=!1,onPermissionModeChange:f,onModelChange:a,onEffortChange:c,onStart:h,onResume:g,onStop:u,onRestart:b,onNotifyHarnessUpdated:C}){const A=(r==null?void 0:r.status)==="running",x=!!(r!=null&&r.claudeSessionId&&!A),y=!A&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return T.jsxs("div",{className:"session-controls",children:[T.jsxs("label",{className:"session-option-field permission-mode-field",children:[T.jsx("span",{children:"Permission"}),T.jsxs("select",{value:s,onChange:m=>f(m.target.value),children:[T.jsx("option",{value:"default",children:"默认"}),T.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),T.jsxs("label",{className:"session-option-field model-field",children:[T.jsx("span",{children:"Model"}),T.jsx("select",{value:o,onChange:m=>a(m.target.value),children:jg.map(m=>T.jsx("option",{value:m.value,children:m.label},m.value))})]}),T.jsxs("label",{className:"session-option-field effort-field",children:[T.jsx("span",{children:"Effort"}),T.jsx("select",{value:d,onChange:m=>c(m.target.value),children:Ng.map(m=>T.jsx("option",{value:m.value,children:m.label},m.value))})]}),T.jsxs("div",{className:"session-toolbar",children:[T.jsx("button",{type:"button",disabled:_||!y,onClick:h,children:"Start"}),T.jsx("button",{type:"button",disabled:_||!x,onClick:g,children:"Resume"}),T.jsx("button",{type:"button",disabled:_||!r,onClick:b,children:"Restart"}),T.jsx("button",{type:"button",disabled:_||!r,onClick:u,children:"Stop"})]}),v?T.jsxs("div",{className:"session-harness-notice",children:[T.jsx(yi,{status:"outdated"}),T.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),T.jsx("button",{type:"button",disabled:_||!A||!C,onClick:C,children:"Notify role"})]}):null]})}function N1({busy:n,effort:r,model:s,open:o,permissionMode:d,taskSlug:_,bootstrapStatus:f,engineerSession:a,status:c,onClose:h,onEffortChange:g,onModelChange:u,onPermissionModeChange:b,onEngineerResume:C,onEngineerRestart:A,onEngineerStart:x,onEngineerStop:y,onEngineerNotifyHarnessUpdated:v,onOpenRepositoryDiff:m,onRefresh:S}){const[k,M]=ie.useState(null),[R,D]=ie.useState(null),[E,L]=ie.useState(""),[O,I]=ie.useState(!1),[F,U]=ie.useState(!1),[W,Y]=ie.useState(null),V=(c==null?void 0:c.files)??[],K=V.filter(Z=>Z.kind.startsWith("agent-")),J=V.filter(Z=>Z.kind.startsWith("skill-")),z=V.filter(Z=>Z.kind.startsWith("tool-")),j=V.filter(Z=>Z.kind==="root-claude"||Z.kind==="gitignore"||Z.kind==="pull-request-template"),H=!!(R&&E!==R.content);ie.useEffect(()=>{o||(M(null),D(null),L(""),I(!1),Y(null))},[V,o,k]),ie.useEffect(()=>{if(!o||!k||!_)return;let Z=!1;return U(!0),Y(null),I(!1),Se.getHarnessFileContent(_,k).then(ue=>{Z||(D(ue),L(ue.content))}).catch(ue=>{Z||Y(ue.message)}).finally(()=>{Z||U(!1)}),()=>{Z=!0}},[o,k,_]);async function G(){if(!(!R||!R.editable||!H||!_)){U(!0),Y(null);try{const Z=await Se.updateHarnessFileContent(_,R.path,{content:E});D(Z.file),L(Z.file.content),I(!1),S()}catch(Z){Y(Z instanceof Error?Z.message:String(Z))}finally{U(!1)}}}function N(){M(null),D(null),L(""),I(!1),Y(null)}return o?T.jsx(T.Fragment,{children:T.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:T.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[T.jsxs("header",{className:"harness-studio-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Harness Studio"}),_?null:T.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),T.jsxs("div",{className:"harness-studio-header-actions",children:[T.jsx("button",{type:"button",disabled:n,onClick:m,children:"Review Diff"}),T.jsx("button",{type:"button",disabled:n,onClick:S,children:"Refresh"}),T.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),T.jsxs("div",{className:"harness-studio-layout",children:[T.jsx("aside",{className:k?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:k?T.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[T.jsxs("header",{className:"harness-studio-file-editor-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),T.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??k})]}),T.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?T.jsx(yi,{status:R.editable?"ok":"unknown"}):null,O?T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:F||!_||!(R!=null&&R.editable)||!H,onClick:()=>void G(),children:"Save"}),T.jsx("button",{type:"button",disabled:F,onClick:()=>{L((R==null?void 0:R.content)??""),I(!1)},children:"Cancel"})]}):T.jsx("button",{type:"button",disabled:F||!_||!(R!=null&&R.editable),onClick:()=>I(!0),children:"Edit"}),T.jsx("button",{type:"button",onClick:N,children:"Return"})]})]}),R!=null&&R.readonlyReason?T.jsx("p",{className:"muted",children:R.readonlyReason}):null,W?T.jsx("p",{className:"error-banner",children:W}):null,T.jsx("textarea",{className:O?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:E,spellCheck:!1,readOnly:!O,disabled:F,onChange:Z=>L(Z.target.value)})]}):T.jsxs(T.Fragment,{children:[T.jsxs("section",{className:"harness-studio-section harness-studio-overview",children:[T.jsx("h3",{children:"Overview"}),T.jsxs("div",{className:"harness-studio-metrics",children:[T.jsx(cs,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),T.jsx(cs,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),T.jsx(cs,{label:"Managed files",value:String(V.length)}),T.jsx(cs,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),T.jsx(cs,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),T.jsx(cs,{label:"Engineer",value:Am(a)})]}),c!=null&&c.warnings.length?T.jsx("ul",{className:"warnings",children:c.warnings.map(Z=>T.jsx("li",{children:Z},Z))}):null]}),T.jsx(Ka,{title:"Agents",files:K,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Skills",files:J,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Root Context",files:j,selectedPath:k,onSelect:M}),T.jsx(Ka,{title:"Tools",files:z,selectedPath:k,onSelect:M}),T.jsxs("section",{className:"harness-studio-section",children:[T.jsx("h3",{children:"Project Docs"}),T.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(Z=>T.jsxs("li",{children:[T.jsx("span",{children:Z.path??Z.label}),T.jsx(yi,{status:Z.status})]},Z.key)))??T.jsx("li",{children:T.jsx("span",{children:"No bootstrap status loaded."})})})]})]})}),T.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[T.jsxs("div",{className:"harness-studio-engineer-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:"Harness Engineer"}),T.jsx("p",{className:"muted",children:Am(a)})]}),T.jsx(yi,{status:(a==null?void 0:a.status)??"unknown"})]}),T.jsx(ah,{role:"harness-engineer",session:a??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:g,onStart:x,onResume:C,onRestart:A,onStop:y,onNotifyHarnessUpdated:v}),T.jsx("div",{className:"harness-engineer-terminal",children:(a==null?void 0:a.status)==="running"?T.jsx(oo,{sessionId:a.id,active:o},a.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"harness-engineer"}),T.jsx("span",{children:a!=null&&a.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function cs({label:n,value:r}){return T.jsxs("div",{className:"harness-studio-metric",children:[T.jsx("span",{children:n}),T.jsx("strong",{children:r})]})}function Ka({title:n,files:r,selectedPath:s,onSelect:o}){return T.jsxs("section",{className:"harness-studio-section",children:[T.jsx("h3",{children:n}),T.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(d=>T.jsxs("li",{className:d.path===s?"selected":void 0,children:[T.jsx("button",{type:"button",title:d.path,onClick:()=>o(d.path),children:d.path}),T.jsx(yi,{status:d.action})]},d.path)):T.jsx("li",{children:T.jsx("span",{children:"No files."})})})]})}function Am(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}function H1({open:n,taskSlug:r,onClose:s}){var x;const[o,d]=ie.useState(null),[_,f]=ie.useState(null),[a,c]=ie.useState(null),[h,g]=ie.useState(!1),[u,b]=ie.useState(null),C=ie.useMemo(()=>(o==null?void 0:o.files.find(y=>y.path===a))??(o==null?void 0:o.files[0])??null,[o,a]);async function A(y=_){var v;g(!0),b(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const m=await Se.getRepositoryDiff(r,y);d(m),f(((v=m.commit)==null?void 0:v.sha)??null),c(S=>{var k;return S&&m.files.some(M=>M.path===S)?S:((k=m.files[0])==null?void 0:k.path)??null})}catch(m){b(m instanceof Error?m.message:String(m))}finally{g(!1)}}return ie.useEffect(()=>{n&&(f(null),A(null))},[n,r]),n?T.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:T.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[T.jsxs("header",{className:"repository-diff-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Commit Diff"}),T.jsx("p",{children:o?`${((x=o.commit)==null?void 0:x.shortSha)??"HEAD"} · ${o.summary.totalFiles} files · +${o.summary.additions} / -${o.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),T.jsxs("div",{className:"repository-diff-header-actions",children:[T.jsxs("label",{className:"repository-diff-commit-picker",children:[T.jsx("span",{children:"Commit"}),T.jsx("select",{value:_??"",disabled:h||!(o!=null&&o.commits.length),onChange:y=>{const v=y.target.value||null;f(v),A(v)},children:o==null?void 0:o.commits.map(y=>T.jsxs("option",{value:y.sha,children:[y.shortSha," · ",y.subject]},y.sha))})]}),T.jsx("button",{type:"button",disabled:h,onClick:()=>void A(),children:"Refresh"}),T.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),u?T.jsx("p",{className:"error-banner",children:u}):null,o!=null&&o.warnings.length?T.jsx("ul",{className:"warnings repository-diff-warnings",children:o.warnings.map(y=>T.jsx("li",{children:y},y))}):null,T.jsxs("div",{className:"repository-diff-body",children:[T.jsxs("aside",{className:"repository-diff-sidebar",children:[T.jsx(z1,{report:o,busy:h}),T.jsxs("ol",{className:"repository-diff-file-list",children:[o==null?void 0:o.files.map(y=>T.jsx("li",{className:(C==null?void 0:C.path)===y.path?"selected":"",children:T.jsxs("button",{type:"button",onClick:()=>c(y.path),children:[T.jsx("span",{children:y.path}),T.jsxs("small",{children:[Dm(y.status)," · ",Rm(y.stage)," · ",Tm(y.category)]})]})},y.path)),o&&o.files.length===0?T.jsx("li",{className:"repository-diff-empty",children:o.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),T.jsx("main",{className:"repository-diff-main",children:C?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"repository-diff-file-header",children:[T.jsxs("div",{children:[T.jsx("h3",{children:C.path}),T.jsxs("p",{children:[Tm(C.category)," · ",Dm(C.status)," · ",Rm(C.stage)]})]}),T.jsxs("span",{className:"repository-diff-stats",children:["+",C.additions," / -",C.deletions]})]}),C.binary?T.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,C.truncated?T.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,T.jsx("pre",{className:"repository-diff-code","aria-label":`${C.path} diff`,children:I1(C.diff)})]}):T.jsx("div",{className:"repository-diff-placeholder",children:h?"Loading commit diff...":"No diff selected."})})]})]})}):null}function z1({report:n,busy:r}){var o;const s=n==null?void 0:n.summary;return T.jsxs("div",{className:"repository-diff-summary",children:[T.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?T.jsxs(T.Fragment,{children:[T.jsxs("span",{children:[s.harnessFiles," harness files"]}),T.jsxs("span",{children:[s.productCodeFiles," product code files"]}),T.jsxs("span",{children:[s.committedFiles," committed files"]}),T.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),T.jsx("span",{children:((o=n==null?void 0:n.commit)==null?void 0:o.subject)??"HEAD"})]}):null]})}function Tm(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 Rm(n){return n.replaceAll("_"," ")}function Dm(n){return n.replaceAll("_"," ")}function I1(n){return n.split(`
61
+ `).filter(r=>!P1(r)).map((r,s)=>T.jsx("span",{className:`repository-diff-line ${U1(r)}`,children:r||" "},`${s}:${r}`))}function U1(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 P1(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 F1({busy:n,effort:r,model:s,open:o,permissionMode:d,session:_,onClose:f,onEffortChange:a,onModelChange:c,onPermissionModeChange:h,onResume:g,onRestart:u,onStart:b,onStop:C,onNotifyHarnessUpdated:A}){return o?T.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:T.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[T.jsxs("header",{className:"translator-session-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Translator Session"}),T.jsx("p",{children:q1(_)})]}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]}),T.jsx(ah,{role:"translator",session:_??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:a,onStart:b,onResume:g,onRestart:u,onStop:C,onNotifyHarnessUpdated:A}),T.jsx("div",{className:"translator-session-terminal",children:(_==null?void 0:_.status)==="running"?T.jsx(oo,{sessionId:_.id,active:o},_.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"translator"}),T.jsx("span",{children:_!=null&&_.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function q1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function G1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const V1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W1={};function Mm(n,r){return(W1.jsx?$1:V1).test(n)}const K1=/[ \t\n\f\r]/g;function Y1(n){return typeof n=="object"?n.type==="text"?Lm(n.value):!1:Lm(n)}function Lm(n){return n.replace(K1,"")===""}class Dl{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}Dl.prototype.normal={};Dl.prototype.property={};Dl.prototype.space=void 0;function Hg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new Dl(s,o,r)}function Vu(n){return n.toLowerCase()}class dn{constructor(r,s){this.attribute=s,this.property=r}}dn.prototype.attribute="";dn.prototype.booleanish=!1;dn.prototype.boolean=!1;dn.prototype.commaOrSpaceSeparated=!1;dn.prototype.commaSeparated=!1;dn.prototype.defined=!1;dn.prototype.mustUseProperty=!1;dn.prototype.number=!1;dn.prototype.overloadedBoolean=!1;dn.prototype.property="";dn.prototype.spaceSeparated=!1;dn.prototype.space=void 0;let X1=0;const Fe=Er(),Bt=Er(),$u=Er(),be=Er(),ut=Er(),ds=Er(),Cn=Er();function Er(){return 2**++X1}const Wu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Bt,commaOrSpaceSeparated:Cn,commaSeparated:ds,number:be,overloadedBoolean:$u,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),Tu=Object.keys(Wu);class oh extends dn{constructor(r,s,o,d){let _=-1;if(super(r,s),Om(this,"space",d),typeof o=="number")for(;++_<Tu.length;){const f=Tu[_];Om(this,Tu[_],(o&Wu[f])===Wu[f])}}}oh.prototype.defined=!0;function Om(n,r,s){s&&(n[r]=s)}function _s(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const _=new oh(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(_.mustUseProperty=!0),r[o]=_,s[Vu(o)]=o,s[Vu(_.attribute)]=o}return new Dl(r,s,n.space)}const zg=_s({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:ut,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:be,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:ut,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Bt,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 Ig(n,r){return r in n?n[r]:r}function Ug(n,r){return Ig(n,r.toLowerCase())}const Q1=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ds,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:ut,autoFocus:Fe,autoPlay:Fe,blocking:ut,capture:null,charSet:null,checked:Fe,cite:null,className:ut,cols:be,colSpan:null,content:null,contentEditable:Bt,controls:Fe,controlsList:ut,coords:be|ds,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:$u,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:ut,height:be,hidden:$u,high:be,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:ut,itemRef:ut,itemScope:Fe,itemType:ut,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:ut,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:ut,required:Fe,reversed:Fe,rows:be,rowSpan:be,sandbox:ut,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:Bt,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:Bt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact: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:Bt,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:Ug}),Z1=_s({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:Cn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download: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:ds,g2:ds,glyphName:ds,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:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,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:Cn,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:Cn,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:Cn,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:Ig}),Pg=_s({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()}}),Fg=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ug}),qg=_s({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"},ey=/[A-Z]/g,Bm=/-[a-z]/g,ty=/^data[-\w.:]+$/i;function ny(n,r){const s=Vu(r);let o=r,d=dn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&ty.test(r)){if(r.charAt(4)==="-"){const _=r.slice(5).replace(Bm,ry);o="data"+_.charAt(0).toUpperCase()+_.slice(1)}else{const _=r.slice(4);if(!Bm.test(_)){let f=_.replace(ey,iy);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=oh}return new d(o,r)}function iy(n){return"-"+n.toLowerCase()}function ry(n){return n.charAt(1).toUpperCase()}const sy=Hg([zg,Q1,Pg,Fg,qg],"html"),ch=Hg([zg,Z1,Pg,Fg,qg],"svg");function ly(n){return n.join(" ").trim()}var us={},Ru,jm;function ay(){if(jm)return Ru;jm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
62
+ `,h="/",g="*",u="",b="comment",C="declaration";function A(y,v){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];v=v||{};var m=1,S=1;function k(W){var Y=W.match(r);Y&&(m+=Y.length);var V=W.lastIndexOf(c);S=~V?W.length-V:S+W.length}function M(){var W={line:m,column:S};return function(Y){return Y.position=new R(W),L(),Y}}function R(W){this.start=W,this.end={line:m,column:S},this.source=v.source}R.prototype.content=y;function D(W){var Y=new Error(v.source+":"+m+":"+S+": "+W);if(Y.reason=W,Y.filename=v.source,Y.line=m,Y.column=S,Y.source=y,!v.silent)throw Y}function E(W){var Y=W.exec(y);if(Y){var V=Y[0];return k(V),y=y.slice(V.length),Y}}function L(){E(s)}function O(W){var Y;for(W=W||[];Y=I();)Y!==!1&&W.push(Y);return W}function I(){var W=M();if(!(h!=y.charAt(0)||g!=y.charAt(1))){for(var Y=2;u!=y.charAt(Y)&&(g!=y.charAt(Y)||h!=y.charAt(Y+1));)++Y;if(Y+=2,u===y.charAt(Y-1))return D("End of comment missing");var V=y.slice(2,Y-2);return S+=2,k(V),y=y.slice(Y),S+=2,W({type:b,comment:V})}}function F(){var W=M(),Y=E(o);if(Y){if(I(),!E(d))return D("property missing ':'");var V=E(_),K=W({type:C,property:x(Y[0].replace(n,u)),value:V?x(V[0].replace(n,u)):u});return E(f),K}}function U(){var W=[];O(W);for(var Y;Y=F();)Y!==!1&&(W.push(Y),O(W));return W}return L(),U()}function x(y){return y?y.replace(a,u):u}return Ru=A,Ru}var Nm;function oy(){if(Nm)return us;Nm=1;var n=us&&us.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(us,"__esModule",{value:!0}),us.default=s;const r=n(ay());function s(o,d){let _=null;if(!o||typeof o!="string")return _;const f=(0,r.default)(o),a=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:g}=c;a?d(h,g,c):g&&(_=_||{},_[h]=g)}),_}return us}var yl={},Hm;function cy(){if(Hm)return yl;Hm=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,_=function(h){return!h||s.test(h)||n.test(h)},f=function(h,g){return g.toUpperCase()},a=function(h,g){return"".concat(g,"-")},c=function(h,g){return g===void 0&&(g={}),_(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(d,a):h=h.replace(o,a),h.replace(r,f))};return yl.camelCase=c,yl}var Sl,zm;function uy(){if(zm)return Sl;zm=1;var n=Sl&&Sl.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(oy()),s=cy();function o(d,_){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(a,c){a&&c&&(f[(0,s.camelCase)(a,_)]=c)}),f}return o.default=o,Sl=o,Sl}var hy=uy();const fy=Tg(hy),Gg=Vg("end"),uh=Vg("start");function Vg(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function dy(n){const r=uh(n),s=Gg(n);if(r&&s)return{start:r,end:s}}function xl(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Im(n.position):"start"in n||"end"in n?Im(n):"line"in n||"column"in n?Ku(n):""}function Ku(n){return Um(n&&n.line)+":"+Um(n&&n.column)}function Im(n){return Ku(n&&n.start)+"-"+Ku(n&&n.end)}function Um(n){return n&&typeof n=="number"?n:1}class Wt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",_={},f=!1;if(s&&("line"in s&&"column"in s?_={place:s}:"start"in s&&"end"in s?_={place:s}:"type"in s?_={ancestors:[s],place:s.position}:_={...s}),typeof r=="string"?d=r:!_.cause&&r&&(f=!0,d=r.message,_.cause=r),!_.ruleId&&!_.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?_.ruleId=o:(_.source=o.slice(0,c),_.ruleId=o.slice(c+1))}if(!_.place&&_.ancestors&&_.ancestors){const c=_.ancestors[_.ancestors.length-1];c&&(_.place=c.position)}const a=_.place&&"start"in _.place?_.place.start:_.place;this.ancestors=_.ancestors||void 0,this.cause=_.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=a?a.line:void 0,this.name=xl(_.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}}Wt.prototype.file="";Wt.prototype.name="";Wt.prototype.reason="";Wt.prototype.message="";Wt.prototype.stack="";Wt.prototype.column=void 0;Wt.prototype.line=void 0;Wt.prototype.ancestors=void 0;Wt.prototype.cause=void 0;Wt.prototype.fatal=void 0;Wt.prototype.place=void 0;Wt.prototype.ruleId=void 0;Wt.prototype.source=void 0;const hh={}.hasOwnProperty,py=new Map,my=/[A-Z]/g,gy=new Set(["table","tbody","thead","tfoot","tr"]),_y=new Set(["td","th"]),$g="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vy(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=ky(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=Ey(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?ch:sy,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},_=Wg(d,n,void 0);return _&&typeof _!="string"?_:d.create(n,d.Fragment,{children:_||void 0},void 0)}function Wg(n,r,s){if(r.type==="element")return yy(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return Sy(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return Cy(n,r,s);if(r.type==="mdxjsEsm")return by(n,r);if(r.type==="root")return wy(n,r,s);if(r.type==="text")return xy(n,r)}function yy(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=ch,n.schema=d),n.ancestors.push(r);const _=Yg(n,r.tagName,!1),f=Ay(n,r);let a=dh(n,r);return gy.has(r.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Y1(c):!0})),Kg(n,f,_,r),fh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function Sy(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}Tl(n,r.position)}function by(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Tl(n,r.position)}function Cy(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=ch,n.schema=d),n.ancestors.push(r);const _=r.name===null?n.Fragment:Yg(n,r.name,!0),f=Ty(n,r),a=dh(n,r);return Kg(n,f,_,r),fh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function wy(n,r,s){const o={};return fh(o,dh(n,r)),n.create(r,n.Fragment,o,s)}function xy(n,r){return r.value}function Kg(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function fh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function Ey(n,r,s){return o;function o(d,_,f,a){const h=Array.isArray(f.children)?s:r;return a?h(_,f,a):h(_,f)}}function ky(n,r){return s;function s(o,d,_,f){const a=Array.isArray(_.children),c=uh(o);return r(d,_,f,a,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function Ay(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&hh.call(r.properties,d)){const _=Ry(n,d,r.properties[d]);if(_){const[f,a]=_;n.tableCellAlignToStyle&&f==="align"&&typeof a=="string"&&_y.has(r.tagName)?o=a:s[f]=a}}if(o){const _=s.style||(s.style={});_[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function Ty(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const _=o.data.estree.body[0];_.type;const f=_.expression;f.type;const a=f.properties[0];a.type,Object.assign(s,n.evaluater.evaluateExpression(a.argument))}else Tl(n,r.position);else{const d=o.name;let _;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const a=o.value.data.estree.body[0];a.type,_=n.evaluater.evaluateExpression(a.expression)}else Tl(n,r.position);else _=o.value===null?!0:o.value;s[d]=_}return s}function dh(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:py;for(;++o<r.children.length;){const _=r.children[o];let f;if(n.passKeys){const c=_.type==="element"?_.tagName:_.type==="mdxJsxFlowElement"||_.type==="mdxJsxTextElement"?_.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const a=Wg(n,_,f);a!==void 0&&s.push(a)}return s}function Ry(n,r,s){const o=ny(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?G1(s):ly(s)),o.property==="style"){let d=typeof s=="object"?s:Dy(n,String(s));return n.stylePropertyNameCase==="css"&&(d=My(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?J1[o.property]||o.property:o.attribute,s]}}function Dy(n,r){try{return fy(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Wt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=$g+"#cannot-parse-style-attribute",d}}function Yg(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let _=-1,f;for(;++_<d.length;){const a=Mm(d[_])?{type:"Identifier",name:d[_]}:{type:"Literal",value:d[_]};f=f?{type:"MemberExpression",object:f,property:a,computed:!!(_&&a.type==="Literal"),optional:!1}:a}o=f}else o=Mm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return hh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);Tl(n)}function Tl(n,r){const s=new Wt("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=$g+"#cannot-handle-mdx-estrees-without-createevaluater",s}function My(n){const r={};let s;for(s in n)hh.call(n,s)&&(r[Ly(s)]=n[s]);return r}function Ly(n){let r=n.replace(my,Oy);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Oy(n){return"-"+n.toLowerCase()}const Du={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"]},By={};function ph(n,r){const s=By,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Xg(n,o,d)}function Xg(n,r,s){if(jy(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 Pm(n.children,r,s)}return Array.isArray(n)?Pm(n,r,s):""}function Pm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=Xg(n[d],r,s);return o.join("")}function jy(n){return!!(n&&typeof n=="object")}const Fm=document.createElement("i");function mh(n){const r="&"+n+";";Fm.innerHTML=r;const s=Fm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function wn(n,r,s,o){const d=n.length;let _=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);_<o.length;)f=o.slice(_,_+1e4),f.unshift(r,0),n.splice(...f),_+=1e4,r+=1e4}function On(n,r){return n.length>0?(wn(n,n.length,0,r),n):r}const qm={}.hasOwnProperty;function Qg(n){const r={};let s=-1;for(;++s<n.length;)Ny(r,n[s]);return r}function Ny(n,r){let s;for(s in r){const d=(qm.call(n,s)?n[s]:void 0)||(n[s]={}),_=r[s];let f;if(_)for(f in _){qm.call(d,f)||(d[f]=[]);const a=_[f];Hy(d[f],Array.isArray(a)?a:a?[a]:[])}}}function Hy(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);wn(n,0,0,o)}function Zg(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 Pn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=tr(/[A-Za-z]/),$t=tr(/[\dA-Za-z]/),zy=tr(/[#-'*+\--9=?A-Z^-~]/);function no(n){return n!==null&&(n<32||n===127)}const Yu=tr(/\d/),Iy=tr(/[\dA-Fa-f]/),Uy=tr(/[!-/:-@[-`{-~]/);function Le(n){return n!==null&&n<-2}function ot(n){return n!==null&&(n<0||n===32)}function $e(n){return n===-2||n===-1||n===32}const co=tr(new RegExp("\\p{P}|\\p{S}","u")),xr=tr(/\s/);function tr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function vs(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const _=n.charCodeAt(s);let f="";if(_===37&&$t(n.charCodeAt(s+1))&&$t(n.charCodeAt(s+2)))d=2;else if(_<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(_))||(f=String.fromCharCode(_));else if(_>55295&&_<57344){const a=n.charCodeAt(s+1);_<56320&&a>56319&&a<57344?(f=String.fromCharCode(_,a),d=1):f="�"}else f=String.fromCharCode(_);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function Xe(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let _=0;return f;function f(c){return $e(c)?(n.enter(s),a(c)):r(c)}function a(c){return $e(c)&&_++<d?(n.consume(c),a):(n.exit(s),r(c))}}const Py={tokenize:Fy};function Fy(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(a){return n.enter("paragraph"),_(a)}function _(a){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(a)}function f(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Le(a)?(n.consume(a),n.exit("chunkText"),_):(n.consume(a),f)}}const qy={tokenize:Gy},Gm={tokenize:Vy};function Gy(n){const r=this,s=[];let o=0,d,_,f;return a;function a(S){if(o<s.length){const k=s[o];return r.containerState=k[1],n.attempt(k[0].continuation,c,h)(S)}return h(S)}function c(S){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&m();const k=r.events.length;let M=k,R;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){R=r.events[M][1].end;break}v(o);let D=k;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return wn(r.events,M+1,0,r.events.slice(k)),r.events.length=D,h(S)}return a(S)}function h(S){if(o===s.length){if(!d)return b(S);if(d.currentConstruct&&d.currentConstruct.concrete)return A(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Gm,g,u)(S)}function g(S){return d&&m(),v(o),b(S)}function u(S){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,A(S)}function b(S){return r.containerState={},n.attempt(Gm,C,A)(S)}function C(S){return o++,s.push([r.currentConstruct,r.containerState]),b(S)}function A(S){if(S===null){d&&m(),v(0),n.consume(S);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:_}),x(S)}function x(S){if(S===null){y(n.exit("chunkFlow"),!0),v(0),n.consume(S);return}return Le(S)?(n.consume(S),y(n.exit("chunkFlow")),o=0,r.interrupt=void 0,a):(n.consume(S),x)}function y(S,k){const M=r.sliceStream(S);if(k&&M.push(null),S.previous=_,_&&(_.next=S),_=S,d.defineSkip(S.start),d.write(M),r.parser.lazy[S.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let E=D,L,O;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(L){O=r.events[E][1].end;break}L=!0}for(v(o),R=D;R<r.events.length;)r.events[R][1].end={...O},R++;wn(r.events,E+1,0,r.events.slice(D)),r.events.length=R}}function v(S){let k=s.length;for(;k-- >S;){const M=s[k];r.containerState=M[1],M[0].exit.call(r,n)}s.length=S}function m(){d.write([null]),_=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Vy(n,r,s){return Xe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ms(n){if(n===null||ot(n)||xr(n))return 1;if(co(n))return 2}function uo(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const _=n[d].resolveAll;_&&!o.includes(_)&&(r=_(r,s),o.push(_))}return r}const Xu={name:"attention",resolveAll:$y,tokenize:Wy};function $y(n,r){let s=-1,o,d,_,f,a,c,h,g;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},b={...n[s][1].start};Vm(u,-c),Vm(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},_={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...a.end}},n[o][1].end={...f.start},n[s][1].start={...a.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=On(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=On(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",_,r]]),h=On(h,uo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=On(h,[["exit",_,r],["enter",a,r],["exit",a,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(g=2,h=On(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):g=0,wn(n,o-1,s-o+3,h),s=o+h.length-g-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function Wy(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=ms(o);let _;return f;function f(c){return _=c,n.enter("attentionSequence"),a(c)}function a(c){if(c===_)return n.consume(c),a;const h=n.exit("attentionSequence"),g=ms(c),u=!g||g===2&&d||s.includes(c),b=!d||d===2&&g||s.includes(o);return h._open=!!(_===42?u:u&&(d||!b)),h._close=!!(_===42?b:b&&(g||!u)),r(c)}}function Vm(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const Ky={name:"autolink",tokenize:Yy};function Yy(n,r,s){let o=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),_}function _(C){return en(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||$t(C)?(o=1,a(C)):h(C)}function a(C){return C===58?(n.consume(C),o=0,c):(C===43||C===45||C===46||$t(C))&&o++<32?(n.consume(C),a):(o=0,h(C))}function c(C){return C===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):C===null||C===32||C===60||no(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),g):zy(C)?(n.consume(C),h):s(C)}function g(C){return $t(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),o=0,g):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):b(C)}function b(C){if((C===45||$t(C))&&o++<63){const A=C===45?b:u;return n.consume(C),A}return s(C)}}const Ml={partial:!0,tokenize:Xy};function Xy(n,r,s){return o;function o(_){return $e(_)?Xe(n,d,"linePrefix")(_):d(_)}function d(_){return _===null||Le(_)?r(_):s(_)}}const Jg={continuation:{tokenize:Zy},exit:Jy,name:"blockQuote",tokenize:Qy};function Qy(n,r,s){const o=this;return d;function d(f){if(f===62){const a=o.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),_}return s(f)}function _(f){return $e(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function Zy(n,r,s){const o=this;return d;function d(f){return $e(f)?Xe(n,_,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):_(f)}function _(f){return n.attempt(Jg,r,s)(f)}}function Jy(n){n.exit("blockQuote")}const e_={name:"characterEscape",tokenize:eS};function eS(n,r,s){return o;function o(_){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(_),n.exit("escapeMarker"),d}function d(_){return Uy(_)?(n.enter("characterEscapeValue"),n.consume(_),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(_)}}const t_={name:"characterReference",tokenize:tS};function tS(n,r,s){const o=this;let d=0,_,f;return a;function a(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),_=31,f=$t,g(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),_=6,f=Iy,g):(n.enter("characterReferenceValue"),_=7,f=Yu,g(u))}function g(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===$t&&!mh(o.sliceSerialize(b))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<_?(n.consume(u),g):s(u)}}const $m={partial:!0,tokenize:iS},Wm={concrete:!0,name:"codeFenced",tokenize:nS};function nS(n,r,s){const o=this,d={partial:!0,tokenize:M};let _=0,f=0,a;return c;function c(R){return h(R)}function h(R){const D=o.events[o.events.length-1];return _=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=R,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===a?(f++,n.consume(R),g):f<3?s(R):(n.exit("codeFencedFenceSequence"),$e(R)?Xe(n,u,"whitespace")(R):u(R))}function u(R){return R===null||Le(R)?(n.exit("codeFencedFence"),o.interrupt?r(R):n.check($m,x,k)(R)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Le(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(R)):$e(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,C,"whitespace")(R)):R===96&&R===a?s(R):(n.consume(R),b)}function C(R){return R===null||Le(R)?u(R):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),A(R))}function A(R){return R===null||Le(R)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(R)):R===96&&R===a?s(R):(n.consume(R),A)}function x(R){return n.attempt(d,k,y)(R)}function y(R){return n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),v}function v(R){return _>0&&$e(R)?Xe(n,m,"linePrefix",_+1)(R):m(R)}function m(R){return R===null||Le(R)?n.check($m,x,k)(R):(n.enter("codeFlowValue"),S(R))}function S(R){return R===null||Le(R)?(n.exit("codeFlowValue"),m(R)):(n.consume(R),S)}function k(R){return n.exit("codeFenced"),r(R)}function M(R,D,E){let L=0;return O;function O(Y){return R.enter("lineEnding"),R.consume(Y),R.exit("lineEnding"),I}function I(Y){return R.enter("codeFencedFence"),$e(Y)?Xe(R,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===a?(R.enter("codeFencedFenceSequence"),U(Y)):E(Y)}function U(Y){return Y===a?(L++,R.consume(Y),U):L>=f?(R.exit("codeFencedFenceSequence"),$e(Y)?Xe(R,W,"whitespace")(Y):W(Y)):E(Y)}function W(Y){return Y===null||Le(Y)?(R.exit("codeFencedFence"),D(Y)):E(Y)}}}function iS(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Mu={name:"codeIndented",tokenize:sS},rS={partial:!0,tokenize:lS};function sS(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,_,"linePrefix",5)(h)}function _(h){const g=o.events[o.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Le(h)?n.attempt(rS,f,c)(h):(n.enter("codeFlowValue"),a(h))}function a(h){return h===null||Le(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),a)}function c(h){return n.exit("codeIndented"),r(h)}}function lS(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,_,"linePrefix",5)(f)}function _(f){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):Le(f)?d(f):s(f)}}const aS={name:"codeText",previous:cS,resolve:oS,tokenize:uS};function oS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function cS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uS(n,r,s){let o=0,d,_;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),a(u)}function a(u){return u===96?(n.consume(u),o++,a):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(_=n.enter("codeTextSequence"),d=0,g(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 g(u){return u===96?(n.consume(u),d++,g):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(_.type="codeTextData",h(u))}}class hS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const _=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&bl(this.left,o),_.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),bl(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),bl(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);bl(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);bl(this.left,s.reverse())}}}function bl(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 n_(n){const r={};let s=-1,o,d,_,f,a,c,h;const g=new hS(n);for(;++s<g.length;){for(;s in r;)s=r[s];if(o=g.get(s),s&&o[1].type==="chunkFlow"&&g.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,_=0,_<c.length&&c[_][1].type==="lineEndingBlank"&&(_+=2),_<c.length&&c[_][1].type==="content"))for(;++_<c.length&&c[_][1].type!=="content";)c[_][1].type==="chunkText"&&(c[_][1]._isInFirstContentOfListItem=!0,_++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,fS(g,s)),s=r[s],h=!0);else if(o[1]._container){for(_=s,d=void 0;_--;)if(f=g.get(_),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(g.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=_);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...g.get(d)[1].start},a=g.slice(d,s),a.unshift(o),g.splice(d,s-d+1,a))}}return wn(n,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function fS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const _=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const a=f.events,c=[],h={};let g,u,b=-1,C=s,A=0,x=0;const y=[x];for(;C;){for(;n.get(++d)[1]!==C;);_.push(d),C._tokenizer||(g=o.sliceStream(C),C.next||g.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++b<a.length;)a[b][0]==="exit"&&a[b-1][0]==="enter"&&a[b][1].type===a[b-1][1].type&&a[b][1].start.line!==a[b][1].end.line&&(x=b+1,y.push(x),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):y.pop(),b=y.length;b--;){const v=a.slice(y[b],y[b+1]),m=_.pop();c.push([m,m+v.length-1]),n.splice(m,2,v)}for(c.reverse(),b=-1;++b<c.length;)h[A+c[b][0]]=A+c[b][1],A+=c[b][1]-c[b][0]-1;return h}const dS={resolve:mS,tokenize:gS},pS={partial:!0,tokenize:_S};function mS(n){return n_(n),n}function gS(n,r){let s;return o;function o(a){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(a)}function d(a){return a===null?_(a):Le(a)?n.check(pS,f,_)(a):(n.consume(a),d)}function _(a){return n.exit("chunkContent"),n.exit("content"),r(a)}function f(a){return n.consume(a),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function _S(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,_,"linePrefix")}function _(f){if(f===null||Le(f))return s(f);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function i_(n,r,s,o,d,_,f,a,c){const h=c||Number.POSITIVE_INFINITY;let g=0;return u;function u(v){return v===60?(n.enter(o),n.enter(d),n.enter(_),n.consume(v),n.exit(_),b):v===null||v===32||v===41||no(v)?s(v):(n.enter(o),n.enter(f),n.enter(a),n.enter("chunkString",{contentType:"string"}),x(v))}function b(v){return v===62?(n.enter(_),n.consume(v),n.exit(_),n.exit(d),n.exit(o),r):(n.enter(a),n.enter("chunkString",{contentType:"string"}),C(v))}function C(v){return v===62?(n.exit("chunkString"),n.exit(a),b(v)):v===null||v===60||Le(v)?s(v):(n.consume(v),v===92?A:C)}function A(v){return v===60||v===62||v===92?(n.consume(v),C):C(v)}function x(v){return!g&&(v===null||v===41||ot(v))?(n.exit("chunkString"),n.exit(a),n.exit(f),n.exit(o),r(v)):g<h&&v===40?(n.consume(v),g++,x):v===41?(n.consume(v),g--,x):v===null||v===32||v===40||no(v)?s(v):(n.consume(v),v===92?y:x)}function y(v){return v===40||v===41||v===92?(n.consume(v),x):x(v)}}function r_(n,r,s,o,d,_){const f=this;let a=0,c;return h;function h(C){return n.enter(o),n.enter(d),n.consume(C),n.exit(d),n.enter(_),g}function g(C){return a>999||C===null||C===91||C===93&&!c||C===94&&!a&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(_),n.enter(d),n.consume(C),n.exit(d),n.exit(o),r):Le(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),g):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Le(C)||a++>999?(n.exit("chunkString"),g(C)):(n.consume(C),c||(c=!$e(C)),C===92?b:u)}function b(C){return C===91||C===92||C===93?(n.consume(C),a++,u):u(C)}}function s_(n,r,s,o,d,_){let f;return a;function a(b){return b===34||b===39||b===40?(n.enter(o),n.enter(d),n.consume(b),n.exit(d),f=b===40?41:b,c):s(b)}function c(b){return b===f?(n.enter(d),n.consume(b),n.exit(d),n.exit(o),r):(n.enter(_),h(b))}function h(b){return b===f?(n.exit(_),c(f)):b===null?s(b):Le(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===f||b===null||Le(b)?(n.exit("chunkString"),h(b)):(n.consume(b),b===92?u:g)}function u(b){return b===f||b===92?(n.consume(b),g):g(b)}}function El(n,r){let s;return o;function o(d){return Le(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):$e(d)?Xe(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const vS={name:"definition",tokenize:SS},yS={partial:!0,tokenize:bS};function SS(n,r,s){const o=this;let d;return _;function _(C){return n.enter("definition"),f(C)}function f(C){return r_.call(o,n,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function a(C){return d=Pn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),c):s(C)}function c(C){return ot(C)?El(n,h)(C):h(C)}function h(C){return i_(n,g,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function g(C){return n.attempt(yS,u,u)(C)}function u(C){return $e(C)?Xe(n,b,"whitespace")(C):b(C)}function b(C){return C===null||Le(C)?(n.exit("definition"),o.parser.defined.push(d),r(C)):s(C)}}function bS(n,r,s){return o;function o(a){return ot(a)?El(n,d)(a):s(a)}function d(a){return s_(n,_,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function _(a){return $e(a)?Xe(n,f,"whitespace")(a):f(a)}function f(a){return a===null||Le(a)?r(a):s(a)}}const CS={name:"hardBreakEscape",tokenize:wS};function wS(n,r,s){return o;function o(_){return n.enter("hardBreakEscape"),n.consume(_),d}function d(_){return Le(_)?(n.exit("hardBreakEscape"),r(_)):s(_)}}const xS={name:"headingAtx",resolve:ES,tokenize:kS};function ES(n,r){let s=n.length-2,o=3,d,_;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},_={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},wn(n,o,s-o+1,[["enter",d,r],["enter",_,r],["exit",_,r],["exit",d,r]])),n}function kS(n,r,s){let o=0;return d;function d(g){return n.enter("atxHeading"),_(g)}function _(g){return n.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&o++<6?(n.consume(g),f):g===null||ot(g)?(n.exit("atxHeadingSequence"),a(g)):s(g)}function a(g){return g===35?(n.enter("atxHeadingSequence"),c(g)):g===null||Le(g)?(n.exit("atxHeading"),r(g)):$e(g)?Xe(n,a,"whitespace")(g):(n.enter("atxHeadingText"),h(g))}function c(g){return g===35?(n.consume(g),c):(n.exit("atxHeadingSequence"),a(g))}function h(g){return g===null||g===35||ot(g)?(n.exit("atxHeadingText"),a(g)):(n.consume(g),h)}}const AS=["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"],Km=["pre","script","style","textarea"],TS={concrete:!0,name:"htmlFlow",resolveTo:MS,tokenize:LS},RS={partial:!0,tokenize:BS},DS={partial:!0,tokenize:OS};function MS(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 LS(n,r,s){const o=this;let d,_,f,a,c;return h;function h(N){return g(N)}function g(N){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(N),u}function u(N){return N===33?(n.consume(N),b):N===47?(n.consume(N),_=!0,x):N===63?(n.consume(N),d=3,o.interrupt?r:j):en(N)?(n.consume(N),f=String.fromCharCode(N),y):s(N)}function b(N){return N===45?(n.consume(N),d=2,C):N===91?(n.consume(N),d=5,a=0,A):en(N)?(n.consume(N),d=4,o.interrupt?r:j):s(N)}function C(N){return N===45?(n.consume(N),o.interrupt?r:j):s(N)}function A(N){const Z="CDATA[";return N===Z.charCodeAt(a++)?(n.consume(N),a===Z.length?o.interrupt?r:F:A):s(N)}function x(N){return en(N)?(n.consume(N),f=String.fromCharCode(N),y):s(N)}function y(N){if(N===null||N===47||N===62||ot(N)){const Z=N===47,ue=f.toLowerCase();return!Z&&!_&&Km.includes(ue)?(d=1,o.interrupt?r(N):F(N)):AS.includes(f.toLowerCase())?(d=6,Z?(n.consume(N),v):o.interrupt?r(N):F(N)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(N):_?m(N):S(N))}return N===45||$t(N)?(n.consume(N),f+=String.fromCharCode(N),y):s(N)}function v(N){return N===62?(n.consume(N),o.interrupt?r:F):s(N)}function m(N){return $e(N)?(n.consume(N),m):O(N)}function S(N){return N===47?(n.consume(N),O):N===58||N===95||en(N)?(n.consume(N),k):$e(N)?(n.consume(N),S):O(N)}function k(N){return N===45||N===46||N===58||N===95||$t(N)?(n.consume(N),k):M(N)}function M(N){return N===61?(n.consume(N),R):$e(N)?(n.consume(N),M):S(N)}function R(N){return N===null||N===60||N===61||N===62||N===96?s(N):N===34||N===39?(n.consume(N),c=N,D):$e(N)?(n.consume(N),R):E(N)}function D(N){return N===c?(n.consume(N),c=null,L):N===null||Le(N)?s(N):(n.consume(N),D)}function E(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ot(N)?M(N):(n.consume(N),E)}function L(N){return N===47||N===62||$e(N)?S(N):s(N)}function O(N){return N===62?(n.consume(N),I):s(N)}function I(N){return N===null||Le(N)?F(N):$e(N)?(n.consume(N),I):s(N)}function F(N){return N===45&&d===2?(n.consume(N),V):N===60&&d===1?(n.consume(N),K):N===62&&d===4?(n.consume(N),H):N===63&&d===3?(n.consume(N),j):N===93&&d===5?(n.consume(N),z):Le(N)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(RS,G,U)(N)):N===null||Le(N)?(n.exit("htmlFlowData"),U(N)):(n.consume(N),F)}function U(N){return n.check(DS,W,G)(N)}function W(N){return n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),Y}function Y(N){return N===null||Le(N)?U(N):(n.enter("htmlFlowData"),F(N))}function V(N){return N===45?(n.consume(N),j):F(N)}function K(N){return N===47?(n.consume(N),f="",J):F(N)}function J(N){if(N===62){const Z=f.toLowerCase();return Km.includes(Z)?(n.consume(N),H):F(N)}return en(N)&&f.length<8?(n.consume(N),f+=String.fromCharCode(N),J):F(N)}function z(N){return N===93?(n.consume(N),j):F(N)}function j(N){return N===62?(n.consume(N),H):N===45&&d===2?(n.consume(N),j):F(N)}function H(N){return N===null||Le(N)?(n.exit("htmlFlowData"),G(N)):(n.consume(N),H)}function G(N){return n.exit("htmlFlow"),r(N)}}function OS(n,r,s){const o=this;return d;function d(f){return Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_):s(f)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function BS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(Ml,r,s)}}const jS={name:"htmlText",tokenize:NS};function NS(n,r,s){const o=this;let d,_,f;return a;function a(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),M):j===63?(n.consume(j),S):en(j)?(n.consume(j),E):s(j)}function h(j){return j===45?(n.consume(j),g):j===91?(n.consume(j),_=0,A):en(j)?(n.consume(j),m):s(j)}function g(j){return j===45?(n.consume(j),C):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),C):u(j)}function C(j){return j===62?V(j):j===45?b(j):u(j)}function A(j){const H="CDATA[";return j===H.charCodeAt(_++)?(n.consume(j),_===H.length?x:A):s(j)}function x(j){return j===null?s(j):j===93?(n.consume(j),y):Le(j)?(f=x,K(j)):(n.consume(j),x)}function y(j){return j===93?(n.consume(j),v):x(j)}function v(j){return j===62?V(j):j===93?(n.consume(j),v):x(j)}function m(j){return j===null||j===62?V(j):Le(j)?(f=m,K(j)):(n.consume(j),m)}function S(j){return j===null?s(j):j===63?(n.consume(j),k):Le(j)?(f=S,K(j)):(n.consume(j),S)}function k(j){return j===62?V(j):S(j)}function M(j){return en(j)?(n.consume(j),R):s(j)}function R(j){return j===45||$t(j)?(n.consume(j),R):D(j)}function D(j){return Le(j)?(f=D,K(j)):$e(j)?(n.consume(j),D):V(j)}function E(j){return j===45||$t(j)?(n.consume(j),E):j===47||j===62||ot(j)?L(j):s(j)}function L(j){return j===47?(n.consume(j),V):j===58||j===95||en(j)?(n.consume(j),O):Le(j)?(f=L,K(j)):$e(j)?(n.consume(j),L):V(j)}function O(j){return j===45||j===46||j===58||j===95||$t(j)?(n.consume(j),O):I(j)}function I(j){return j===61?(n.consume(j),F):Le(j)?(f=I,K(j)):$e(j)?(n.consume(j),I):L(j)}function F(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,U):Le(j)?(f=F,K(j)):$e(j)?(n.consume(j),F):(n.consume(j),W)}function U(j){return j===d?(n.consume(j),d=void 0,Y):j===null?s(j):Le(j)?(f=U,K(j)):(n.consume(j),U)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?L(j):(n.consume(j),W)}function Y(j){return j===47||j===62||ot(j)?L(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"),J}function J(j){return $e(j)?Xe(n,z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const gh={name:"labelEnd",resolveAll:US,resolveTo:PS,tokenize:FS},HS={tokenize:qS},zS={tokenize:GS},IS={tokenize:VS};function US(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&wn(n,0,n.length,s),n}function PS(n,r){let s=n.length,o=0,d,_,f,a;for(;s--;)if(d=n[s][1],_){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(_=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[_][1].type==="labelLink"?"link":"image",start:{...n[_][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[_][1].start},end:{...n[f][1].end}},g={type:"labelText",start:{...n[_+o+2][1].end},end:{...n[f-2][1].start}};return a=[["enter",c,r],["enter",h,r]],a=On(a,n.slice(_+1,_+o+3)),a=On(a,[["enter",g,r]]),a=On(a,uo(r.parser.constructs.insideSpan.null,n.slice(_+o+4,f-3),r)),a=On(a,[["exit",g,r],n[f-2],n[f-1],["exit",h,r]]),a=On(a,n.slice(f+1)),a=On(a,[["exit",c,r]]),wn(n,_,n.length,a),n}function FS(n,r,s){const o=this;let d=o.events.length,_,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){_=o.events[d][1];break}return a;function a(b){return _?_._inactive?u(b):(f=o.parser.defined.includes(Pn(o.sliceSerialize({start:_.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(b),n.exit("labelMarker"),n.exit("labelEnd"),c):s(b)}function c(b){return b===40?n.attempt(HS,g,f?g:u)(b):b===91?n.attempt(zS,g,f?h:u)(b):f?g(b):u(b)}function h(b){return n.attempt(IS,g,u)(b)}function g(b){return r(b)}function u(b){return _._balanced=!0,s(b)}}function qS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ot(u)?El(n,_)(u):_(u)}function _(u){return u===41?g(u):i_(n,f,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?El(n,c)(u):g(u)}function a(u){return s(u)}function c(u){return u===34||u===39||u===40?s_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):g(u)}function h(u){return ot(u)?El(n,g)(u):g(u)}function g(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function GS(n,r,s){const o=this;return d;function d(a){return r_.call(o,n,_,f,"reference","referenceMarker","referenceString")(a)}function _(a){return o.parser.defined.includes(Pn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(a):s(a)}function f(a){return s(a)}}function VS(n,r,s){return o;function o(_){return n.enter("reference"),n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),d}function d(_){return _===93?(n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),n.exit("reference"),r):s(_)}}const $S={name:"labelStartImage",resolveAll:gh.resolveAll,tokenize:WS};function WS(n,r,s){const o=this;return d;function d(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),_}function _(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),f):s(a)}function f(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(a):r(a)}}const KS={name:"labelStartLink",resolveAll:gh.resolveAll,tokenize:YS};function YS(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),_}function _(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Lu={name:"lineEnding",tokenize:XS};function XS(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const to={name:"thematicBreak",tokenize:QS};function QS(n,r,s){let o=0,d;return _;function _(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,a(h)}function a(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Le(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),$e(h)?Xe(n,a,"whitespace")(h):a(h))}}const fn={continuation:{tokenize:tb},exit:ib,name:"list",tokenize:eb},ZS={partial:!0,tokenize:rb},JS={partial:!0,tokenize:nb};function eb(n,r,s){const o=this,d=o.events[o.events.length-1];let _=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return a;function a(C){const A=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:Yu(C)){if(o.containerState.type||(o.containerState.type=A,n.enter(A,{_container:!0})),A==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(to,s,h)(C):h(C);if(!o.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return Yu(C)&&++f<10?(n.consume(C),c):(!o.interrupt||f<2)&&(o.containerState.marker?C===o.containerState.marker:C===41||C===46)?(n.exit("listItemValue"),h(C)):s(C)}function h(C){return n.enter("listItemMarker"),n.consume(C),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||C,n.check(Ml,o.interrupt?s:g,n.attempt(ZS,b,u))}function g(C){return o.containerState.initialBlankLine=!0,_++,b(C)}function u(C){return $e(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),b):s(C)}function b(C){return o.containerState.size=_+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function tb(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(Ml,d,_);function d(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Xe(n,r,"listItemIndent",o.containerState.size+1)(a)}function _(a){return o.containerState.furtherBlankLines||!$e(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(JS,r,f)(a))}function f(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Xe(n,n.attempt(fn,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function nb(n,r,s){const o=this;return Xe(n,d,"listItemIndent",o.containerState.size+1);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(_):s(_)}}function ib(n){n.exit(this.containerState.type)}function rb(n,r,s){const o=this;return Xe(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(_){const f=o.events[o.events.length-1];return!$e(_)&&f&&f[1].type==="listItemPrefixWhitespace"?r(_):s(_)}}const Ym={name:"setextUnderline",resolveTo:sb,tokenize:lb};function sb(n,r){let s=n.length,o,d,_;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!_&&n[s][1].type==="definition"&&(_=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",_?(n.splice(d,0,["enter",f,r]),n.splice(_+1,0,["exit",n[o][1],r]),n[o][1].end={...n[_][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function lb(n,r,s){const o=this;let d;return _;function _(h){let g=o.events.length,u;for(;g--;)if(o.events[g][1].type!=="lineEnding"&&o.events[g][1].type!=="linePrefix"&&o.events[g][1].type!=="content"){u=o.events[g][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),a(h)}function a(h){return h===d?(n.consume(h),a):(n.exit("setextHeadingLineSequence"),$e(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const ab={tokenize:ob};function ob(n){const r=this,s=n.attempt(Ml,o,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(dS,d)),"linePrefix")));return s;function o(_){if(_===null){n.consume(_);return}return n.enter("lineEndingBlank"),n.consume(_),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(_){if(_===null){n.consume(_);return}return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const cb={resolveAll:a_()},ub=l_("string"),hb=l_("text");function l_(n){return{resolveAll:a_(n==="text"?fb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],_=s.attempt(d,f,a);return f;function f(g){return h(g)?_(g):a(g)}function a(g){if(g===null){s.consume(g);return}return s.enter("data"),s.consume(g),c}function c(g){return h(g)?(s.exit("data"),_(g)):(s.consume(g),c)}function h(g){if(g===null)return!0;const u=d[g];let b=-1;if(u)for(;++b<u.length;){const C=u[b];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function a_(n){return r;function r(s,o){let d=-1,_;for(;++d<=s.length;)_===void 0?s[d]&&s[d][1].type==="data"&&(_=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==_+2&&(s[_][1].end=s[d-1][1].end,s.splice(_+2,d-_-2),d=_+2),_=void 0);return n?n(s,o):s}}function fb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],d=r.sliceStream(o);let _=d.length,f=-1,a=0,c;for(;_--;){const h=d[_];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)a++,f--;if(f)break;f=-1}else if(h===-2)c=!0,a++;else if(h!==-1){_++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(a=0),a){const h={type:s===n.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:_?f:o.start._bufferIndex+f,_index:o.start._index+_,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const db={42:fn,43:fn,45:fn,48:fn,49:fn,50:fn,51:fn,52:fn,53:fn,54:fn,55:fn,56:fn,57:fn,62:Jg},pb={91:vS},mb={[-2]:Mu,[-1]:Mu,32:Mu},gb={35:xS,42:to,45:[Ym,to],60:TS,61:Ym,95:to,96:Wm,126:Wm},_b={38:t_,92:e_},vb={[-5]:Lu,[-4]:Lu,[-3]:Lu,33:$S,38:t_,42:Xu,60:[Ky,jS],91:KS,92:[CS,e_],93:gh,95:Xu,96:aS},yb={null:[Xu,cb]},Sb={null:[42,95]},bb={null:[]},Cb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sb,contentInitial:pb,disable:bb,document:db,flow:gb,flowInitial:mb,insideSpan:yb,string:_b,text:vb},Symbol.toStringTag,{value:"Module"}));function wb(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},_=[];let f=[],a=[];const c={attempt:D(M),check:D(R),consume:m,enter:S,exit:k,interrupt:D(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:A,parser:n,previous:null,sliceSerialize:b,sliceStream:C,write:u};let g=r.tokenize.call(h,c);return r.resolveAll&&_.push(r),h;function u(I){return f=On(f,I),y(),f[f.length-1]!==null?[]:(E(r,0),h.events=uo(_,h.events,h),h.events)}function b(I,F){return Eb(C(I),F)}function C(I){return xb(f,I)}function A(){const{_bufferIndex:I,_index:F,line:U,column:W,offset:Y}=o;return{_bufferIndex:I,_index:F,line:U,column:W,offset:Y}}function x(I){d[I.line]=I.column,O()}function y(){let I;for(;o._index<f.length;){const F=f[o._index];if(typeof F=="string")for(I=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===I&&o._bufferIndex<F.length;)v(F.charCodeAt(o._bufferIndex));else v(F)}}function v(I){g=g(I)}function m(I){Le(I)?(o.line++,o.column=1,o.offset+=I===-3?2:1,O()):I!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=I}function S(I,F){const U=F||{};return U.type=I,U.start=A(),h.events.push(["enter",U,h]),a.push(U),U}function k(I){const F=a.pop();return F.end=A(),h.events.push(["exit",F,h]),F}function M(I,F){E(I,F.from)}function R(I,F){F.restore()}function D(I,F){return U;function U(W,Y,V){let K,J,z,j;return Array.isArray(W)?G(W):"tokenize"in W?G([W]):H(W);function H(ve){return X;function X(q){const fe=q!==null&&ve[q],ce=q!==null&&ve.null,de=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return G(de)(q)}}function G(ve){return K=ve,J=0,ve.length===0?V:N(ve[J])}function N(ve){return X;function X(q){return j=L(),z=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?ue():ve.tokenize.call(F?Object.assign(Object.create(h),F):h,c,Z,ue)(q)}}function Z(ve){return I(z,j),Y}function ue(ve){return j.restore(),++J<K.length?N(K[J]):V}}}function E(I,F){I.resolveAll&&!_.includes(I)&&_.push(I),I.resolve&&wn(h.events,F,h.events.length-F,I.resolve(h.events.slice(F),h)),I.resolveTo&&(h.events=I.resolveTo(h.events,h))}function L(){const I=A(),F=h.previous,U=h.currentConstruct,W=h.events.length,Y=Array.from(a);return{from:W,restore:V};function V(){o=I,h.previous=F,h.currentConstruct=U,h.events.length=W,a=Y,O()}}function O(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function xb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,_=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,_)];else{if(f=n.slice(s,d),o>-1){const a=f[0];typeof a=="string"?f[0]=a.slice(o):f.shift()}_>0&&f.push(n[d].slice(0,_))}return f}function Eb(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const _=n[s];let f;if(typeof _=="string")f=_;else switch(_){case-5:{f="\r";break}case-4:{f=`
63
63
  `;break}case-3:{f=`\r
64
- `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(_)}d=_===-2,o.push(f)}return o.join("")}function kb(n){const o={constructs:Qg([Cb,...(n||{}).extensions||[]]),content:d(Py),defined:[],document:d(qy),flow:d(ab),lazy:{},string:d(ub),text:d(hb)};return o;function d(_){return f;function f(a){return wb(o,_,a)}}}function Ab(n){for(;!n_(n););return n}const Xm=/[\0\t\n\r]/g;function Tb(){let n=1,r="",s=!0,o;return d;function d(_,f,a){const c=[];let h,g,u,b,C;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(Xm.lastIndex=u,h=Xm.exec(_),b=h&&h.index!==void 0?h.index:_.length,C=_.charCodeAt(b),!h){r=_.slice(u);break}if(C===10&&u===b&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<b&&(c.push(_.slice(u,b)),n+=b-u),C){case 0:{c.push(65533),n++;break}case 9:{for(g=Math.ceil(n/4)*4,c.push(-2);n++<g;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=b+1}return a&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const Rb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Db(n){return n.replace(Rb,Mb)}function Mb(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),_=d===120||d===88;return Zg(s.slice(_?2:1),_?16:10)}return mh(s)||n}const o_={}.hasOwnProperty;function Lb(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),Ob(s)(Ab(kb(s).document().write(Tb()(n,r,!0))))}function Ob(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:_(qt),autolinkProtocol:L,autolinkEmail:L,atxHeading:_(xe),blockQuote:_(ce),characterEscape:L,characterReference:L,codeFenced:_(de),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:_(de,f),codeText:_(re,f),codeTextData:L,data:L,codeFlowValue:L,definition:_(Ce),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:_(Ee),hardBreakEscape:_(dt),hardBreakTrailing:_(dt),htmlFlow:_(Re,f),htmlFlowData:L,htmlText:_(Re,f),htmlTextData:L,image:_(en),label:f,link:_(qt),listItem:_(tn),listItemValue:b,listOrdered:_(Kt,u),listUnordered:_(Kt),paragraph:_(wn),reference:N,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:_(xe),strong:_(wt),thematicBreak:_(At)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:fe,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ve,characterReference:X,codeFenced:c(y),codeFencedFence:x,codeFencedFenceInfo:C,codeFencedFenceMeta:A,codeFlowValue:O,codeIndented:c(v),codeText:c(Y),codeTextData:O,data:O,definition:c(),definitionDestinationString:k,definitionLabelString:m,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(U),htmlFlowData:O,htmlText:c(W),htmlTextData:O,image:c(K),label:z,labelText:J,lineEnding:I,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:j,resourceTitleString:H,resource:G,setextHeading:c(E),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};c_(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(se){let ye={type:"root",children:[]};const ke={stack:[ye],tokenStack:[],config:r,enter:a,exit:h,buffer:f,resume:g,data:s},Be=[];let je=-1;for(;++je<se.length;)if(se[je][1].type==="listOrdered"||se[je][1].type==="listUnordered")if(se[je][0]==="enter")Be.push(je);else{const mt=Be.pop();je=d(se,mt,je)}for(je=-1;++je<se.length;){const mt=r[se[je][0]];o_.call(mt,se[je][1].type)&&mt[se[je][1].type].call(Object.assign({sliceSerialize:se[je][2].sliceSerialize},ke),se[je][1])}if(ke.tokenStack.length>0){const mt=ke.tokenStack[ke.tokenStack.length-1];(mt[1]||Qm).call(ke,void 0,mt[0])}for(ye.position={start:er(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:er(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<r.transforms.length;)ye=r.transforms[je](ye)||ye;return ye}function d(se,ye,ke){let Be=ye-1,je=-1,mt=!1,Ue,et,Me,ht;for(;++Be<=ke;){const qe=se[Be];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?je++:je--,ht=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(Ue&&!ht&&!je&&!Me&&(Me=Be),ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ht=void 0}if(!je&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||je===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(Ue){let nn=Be;for(et=void 0;nn--;){const Tt=se[nn];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;et&&(se[et][1].type="lineEndingBlank",mt=!0),Tt[1].type="lineEnding",et=nn}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}Me&&(!et||Me<et)&&(Ue._spread=!0),Ue.end=Object.assign({},et?se[et][1].start:qe[1].end),se.splice(et||Be,0,["exit",Ue,qe[2]]),Be++,ke++}if(qe[1].type==="listItemPrefix"){const nn={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};Ue=nn,se.splice(Be,0,["enter",nn,qe[2]]),Be++,ke++,Me=void 0,ht=!0}}}return se[ye][1]._spread=mt,ke}function _(se,ye){return ke;function ke(Be){a.call(this,se(Be),Be),ye&&ye.call(this,Be)}}function f(){this.stack.push({type:"fragment",children:[]})}function a(se,ye,ke){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ye,ke||void 0]),se.position={start:er(ye.start),end:void 0}}function c(se){return ye;function ye(ke){se&&se.call(this,ke),h.call(this,ke)}}function h(se,ye){const ke=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==se.type&&(ye?ye.call(this,se,Be[0]):(Be[1]||Qm).call(this,se,Be[0]));else throw new Error("Cannot close `"+se.type+"` ("+wl({start:se.start,end:se.end})+"): it’s not open");ke.position.end=er(se.end)}function g(){return ph(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(se){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function C(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=se}function A(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=se}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/(\r?\n|\r)$/g,"")}function m(se){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=Fn(this.sliceSerialize(se)).toLowerCase()}function S(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function k(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function M(se){const ye=this.stack[this.stack.length-1];if(!ye.depth){const ke=this.sliceSerialize(se).length;ye.depth=ke}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(se){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function L(se){const ke=this.stack[this.stack.length-1].children;let Be=ke[ke.length-1];(!Be||Be.type!=="text")&&(Be=pt(),Be.position={start:er(se.start),end:void 0},ke.push(Be)),this.stack.push(Be)}function O(se){const ye=this.stack.pop();ye.value+=this.sliceSerialize(se),ye.position.end=er(se.end)}function I(se){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ye.children[ye.children.length-1];ke.position.end=er(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ye.type)&&(L.call(this,se),O.call(this,se))}function F(){this.data.atHardBreak=!0}function U(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function W(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function Y(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function V(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function K(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function J(se){const ye=this.sliceSerialize(se),ke=this.stack[this.stack.length-2];ke.label=Db(ye),ke.identifier=Fn(ye).toLowerCase()}function z(){const se=this.stack[this.stack.length-1],ye=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Be=se.children;ke.children=Be}else ke.alt=ye}function j(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function H(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Z(se){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=Fn(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ue(se){this.data.characterReferenceType=se.type}function ve(se){const ye=this.sliceSerialize(se),ke=this.data.characterReferenceType;let Be;ke?(Be=Zg(ye,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=mh(ye);const je=this.stack[this.stack.length-1];je.value+=Be}function X(se){const ye=this.stack.pop();ye.position.end=er(se.end)}function q(se){O.call(this,se);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(se)}function fe(se){O.call(this,se);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(se)}function ce(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function Re(){return{type:"html",value:""}}function en(){return{type:"image",title:null,url:"",alt:null}}function qt(){return{type:"link",title:null,url:"",children:[]}}function Kt(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function tn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function wn(){return{type:"paragraph",children:[]}}function wt(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function At(){return{type:"thematicBreak"}}}function er(n){return{line:n.line,column:n.column,offset:n.offset}}function c_(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?c_(n,o):Bb(n,o)}}function Bb(n,r){let s;for(s in r)if(o_.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function Qm(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+wl({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+wl({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+wl({start:r.start,end:r.end})+") is still open")}function jb(n){const r=this;r.parser=s;function s(o){return Lb(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Nb(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 Hb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
64
+ `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(_)}d=_===-2,o.push(f)}return o.join("")}function kb(n){const o={constructs:Qg([Cb,...(n||{}).extensions||[]]),content:d(Py),defined:[],document:d(qy),flow:d(ab),lazy:{},string:d(ub),text:d(hb)};return o;function d(_){return f;function f(a){return wb(o,_,a)}}}function Ab(n){for(;!n_(n););return n}const Xm=/[\0\t\n\r]/g;function Tb(){let n=1,r="",s=!0,o;return d;function d(_,f,a){const c=[];let h,g,u,b,C;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(Xm.lastIndex=u,h=Xm.exec(_),b=h&&h.index!==void 0?h.index:_.length,C=_.charCodeAt(b),!h){r=_.slice(u);break}if(C===10&&u===b&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<b&&(c.push(_.slice(u,b)),n+=b-u),C){case 0:{c.push(65533),n++;break}case 9:{for(g=Math.ceil(n/4)*4,c.push(-2);n++<g;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=b+1}return a&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const Rb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Db(n){return n.replace(Rb,Mb)}function Mb(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),_=d===120||d===88;return Zg(s.slice(_?2:1),_?16:10)}return mh(s)||n}const o_={}.hasOwnProperty;function Lb(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),Ob(s)(Ab(kb(s).document().write(Tb()(n,r,!0))))}function Ob(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:_(qt),autolinkProtocol:L,autolinkEmail:L,atxHeading:_(Ee),blockQuote:_(ce),characterEscape:L,characterReference:L,codeFenced:_(de),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:_(de,f),codeText:_(se,f),codeTextData:L,data:L,codeFlowValue:L,definition:_(Ce),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:_(ke),hardBreakEscape:_(ht),hardBreakTrailing:_(ht),htmlFlow:_(De,f),htmlFlowData:L,htmlText:_(De,f),htmlTextData:L,image:_(tn),label:f,link:_(qt),listItem:_(nn),listItemValue:b,listOrdered:_(Kt,u),listUnordered:_(Kt),paragraph:_(xn),reference:N,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:_(Ee),strong:_(wt),thematicBreak:_(At)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:fe,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ve,characterReference:X,codeFenced:c(y),codeFencedFence:x,codeFencedFenceInfo:C,codeFencedFenceMeta:A,codeFlowValue:O,codeIndented:c(v),codeText:c(Y),codeTextData:O,data:O,definition:c(),definitionDestinationString:k,definitionLabelString:m,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(U),htmlFlowData:O,htmlText:c(W),htmlTextData:O,image:c(K),label:z,labelText:J,lineEnding:I,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:j,resourceTitleString:H,resource:G,setextHeading:c(E),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};c_(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(ne){let ye={type:"root",children:[]};const Ae={stack:[ye],tokenStack:[],config:r,enter:a,exit:h,buffer:f,resume:g,data:s},Be=[];let Ne=-1;for(;++Ne<ne.length;)if(ne[Ne][1].type==="listOrdered"||ne[Ne][1].type==="listUnordered")if(ne[Ne][0]==="enter")Be.push(Ne);else{const dt=Be.pop();Ne=d(ne,dt,Ne)}for(Ne=-1;++Ne<ne.length;){const dt=r[ne[Ne][0]];o_.call(dt,ne[Ne][1].type)&&dt[ne[Ne][1].type].call(Object.assign({sliceSerialize:ne[Ne][2].sliceSerialize},Ae),ne[Ne][1])}if(Ae.tokenStack.length>0){const dt=Ae.tokenStack[Ae.tokenStack.length-1];(dt[1]||Qm).call(Ae,void 0,dt[0])}for(ye.position={start:Zi(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Zi(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)ye=r.transforms[Ne](ye)||ye;return ye}function d(ne,ye,Ae){let Be=ye-1,Ne=-1,dt=!1,Ue,Je,we,ct;for(;++Be<=Ae;){const qe=ne[Be];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?Ne++:Ne--,ct=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(Ue&&!ct&&!Ne&&!we&&(we=Be),ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ct=void 0}if(!Ne&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||Ne===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(Ue){let rn=Be;for(Je=void 0;rn--;){const Tt=ne[rn];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;Je&&(ne[Je][1].type="lineEndingBlank",dt=!0),Tt[1].type="lineEnding",Je=rn}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}we&&(!Je||we<Je)&&(Ue._spread=!0),Ue.end=Object.assign({},Je?ne[Je][1].start:qe[1].end),ne.splice(Je||Be,0,["exit",Ue,qe[2]]),Be++,Ae++}if(qe[1].type==="listItemPrefix"){const rn={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};Ue=rn,ne.splice(Be,0,["enter",rn,qe[2]]),Be++,Ae++,we=void 0,ct=!0}}}return ne[ye][1]._spread=dt,Ae}function _(ne,ye){return Ae;function Ae(Be){a.call(this,ne(Be),Be),ye&&ye.call(this,Be)}}function f(){this.stack.push({type:"fragment",children:[]})}function a(ne,ye,Ae){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([ye,Ae||void 0]),ne.position={start:Zi(ye.start),end:void 0}}function c(ne){return ye;function ye(Ae){ne&&ne.call(this,Ae),h.call(this,Ae)}}function h(ne,ye){const Ae=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==ne.type&&(ye?ye.call(this,ne,Be[0]):(Be[1]||Qm).call(this,ne,Be[0]));else throw new Error("Cannot close `"+ne.type+"` ("+xl({start:ne.start,end:ne.end})+"): it’s not open");Ae.position.end=Zi(ne.end)}function g(){return ph(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(ne){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function C(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ne}function A(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ne}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/(\r?\n|\r)$/g,"")}function m(ne){const ye=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ye,Ae.identifier=Pn(this.sliceSerialize(ne)).toLowerCase()}function S(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function k(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function M(ne){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ae=this.sliceSerialize(ne).length;ye.depth=Ae}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ne){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ne){const Ae=this.stack[this.stack.length-1].children;let Be=Ae[Ae.length-1];(!Be||Be.type!=="text")&&(Be=ft(),Be.position={start:Zi(ne.start),end:void 0},Ae.push(Be)),this.stack.push(Be)}function O(ne){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ne),ye.position.end=Zi(ne.end)}function I(ne){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=ye.children[ye.children.length-1];Ae.position.end=Zi(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ye.type)&&(L.call(this,ne),O.call(this,ne))}function F(){this.data.atHardBreak=!0}function U(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function W(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function Y(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function K(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function J(ne){const ye=this.sliceSerialize(ne),Ae=this.stack[this.stack.length-2];Ae.label=Db(ye),Ae.identifier=Pn(ye).toLowerCase()}function z(){const ne=this.stack[this.stack.length-1],ye=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Be=ne.children;Ae.children=Be}else Ae.alt=ye}function j(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function H(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Z(ne){const ye=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ye,Ae.identifier=Pn(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ue(ne){this.data.characterReferenceType=ne.type}function ve(ne){const ye=this.sliceSerialize(ne),Ae=this.data.characterReferenceType;let Be;Ae?(Be=Zg(ye,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=mh(ye);const Ne=this.stack[this.stack.length-1];Ne.value+=Be}function X(ne){const ye=this.stack.pop();ye.position.end=Zi(ne.end)}function q(ne){O.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ne)}function fe(ne){O.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ne)}function ce(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function ht(){return{type:"break"}}function De(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function qt(){return{type:"link",title:null,url:"",children:[]}}function Kt(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function nn(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function xn(){return{type:"paragraph",children:[]}}function wt(){return{type:"strong",children:[]}}function ft(){return{type:"text",value:""}}function At(){return{type:"thematicBreak"}}}function Zi(n){return{line:n.line,column:n.column,offset:n.offset}}function c_(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?c_(n,o):Bb(n,o)}}function Bb(n,r){let s;for(s in r)if(o_.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function Qm(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+xl({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+xl({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+xl({start:r.start,end:r.end})+") is still open")}function jb(n){const r=this;r.parser=s;function s(o){return Lb(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Nb(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 Hb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
65
65
  `}]}function zb(n,r){const s=r.value?r.value+`
66
66
  `:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let _={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(_.data={meta:r.meta}),n.patch(r,_),_=n.applyData(r,_),_={type:"element",tagName:"pre",properties:{},children:[_]},n.patch(r,_),_}function Ib(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Ub(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Pb(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),d=vs(o.toLowerCase()),_=n.footnoteOrder.indexOf(o);let f,a=n.footnoteCounts.get(o);a===void 0?(a=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=_+1,a+=1,n.footnoteCounts.set(o,a);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return n.patch(r,h),n.applyData(r,h)}function Fb(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 qb(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function u_(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const d=n.all(r),_=d[0];_&&_.type==="text"?_.value="["+_.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=o:d.push({type:"text",value:o}),d}function Gb(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return u_(n,r);const d={src:vs(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(d.title=o.title);const _={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,_),n.applyData(r,_)}function Vb(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 o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function $b(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function Wb(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return u_(n,r);const d={href:vs(o.url||"")};o.title!==null&&o.title!==void 0&&(d.title=o.title);const _={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,_),n.applyData(r,_)}function Kb(n,r){const s={href:vs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function Yb(n,r,s){const o=n.all(r),d=s?Xb(s):h_(r),_={},f=[];if(typeof r.checked=="boolean"){const g=o[0];let u;g&&g.type==="element"&&g.tagName==="p"?u=g:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),_.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const g=o[a];(d||a!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
67
67
  `}),g.type==="element"&&g.tagName==="p"&&!d?f.push(...g.children):f.push(g)}const c=o[o.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
68
- `});const h={type:"element",tagName:"li",properties:_,children:f};return n.patch(r,h),n.applyData(r,h)}function Xb(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=h_(s[o])}return r}function h_(n){const r=n.spread;return r??n.children.length>1}function Qb(n,r){const s={},o=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<o.length;){const f=o[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const _={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,_),n.applyData(r,_)}function Zb(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Jb(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function eC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function tC(n,r){const s=n.all(r),o=s.shift(),d=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},a=uh(r.children[1]),c=Gg(r.children[r.children.length-1]);a&&c&&(f.position={start:a,end:c}),d.push(f)}const _={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,_),n.applyData(r,_)}function nC(n,r,s){const o=s?s.children:void 0,_=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,a=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<a;){const u=r.children[c],b={},C=f?f[c]:void 0;C&&(b.align=C);let A={type:"element",tagName:_,properties:b,children:[]};u&&(A.children=n.all(u),n.patch(u,A),A=n.applyData(u,A)),h.push(A)}const g={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,g),n.applyData(r,g)}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 Zm=9,Jm=32;function rC(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const _=[];for(;o;)_.push(eg(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return _.push(eg(r.slice(d),d>0,!1)),_.join("")}function eg(n,r,s){let o=0,d=n.length;if(r){let _=n.codePointAt(o);for(;_===Zm||_===Jm;)o++,_=n.codePointAt(o)}if(s){let _=n.codePointAt(d-1);for(;_===Zm||_===Jm;)d--,_=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function sC(n,r){const s={type:"text",value:rC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function lC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const aC={blockquote:Nb,break:Hb,code:zb,delete:Ib,emphasis:Ub,footnoteReference:Pb,heading:Fb,html:qb,imageReference:Gb,image:Vb,inlineCode:$b,linkReference:Wb,link:Kb,listItem:Yb,list:Qb,paragraph:Zb,root:Jb,strong:eC,table:tC,tableCell:iC,tableRow:nC,text:sC,thematicBreak:lC,toml:Ya,yaml:Ya,definition:Ya,footnoteDefinition:Ya};function Ya(){}const f_=-1,ho=0,El=1,io=2,_h=3,vh=4,yh=5,Sh=6,d_=7,p_=8,oC=typeof self=="object"?self:globalThis,tg=(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 oC[n](r)},cC=(n,r)=>{const s=(d,_)=>(n.set(_,d),d),o=d=>{if(n.has(d))return n.get(d);const[_,f]=r[d];switch(_){case ho:case f_:return s(f,d);case El:{const a=s([],d);for(const c of f)a.push(o(c));return a}case io:{const a=s({},d);for(const[c,h]of f)a[o(c)]=o(h);return a}case _h:return s(new Date(f),d);case vh:{const{source:a,flags:c}=f;return s(new RegExp(a,c),d)}case yh:{const a=s(new Map,d);for(const[c,h]of f)a.set(o(c),o(h));return a}case Sh:{const a=s(new Set,d);for(const c of f)a.add(o(c));return a}case d_:{const{name:a,message:c}=f;return s(tg(a,c),d)}case p_:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:a}=new Uint8Array(f);return s(new DataView(a),f)}}return s(tg(_,f),d)};return o},ng=n=>cC(new Map,n)(0),hs="",{toString:uC}={},{keys:hC}=Object,bl=n=>{const r=typeof n;if(r!=="object"||!n)return[ho,r];const s=uC.call(n).slice(8,-1);switch(s){case"Array":return[El,hs];case"Object":return[io,hs];case"Date":return[_h,hs];case"RegExp":return[vh,hs];case"Map":return[yh,hs];case"Set":return[Sh,hs];case"DataView":return[El,s]}return s.includes("Array")?[El,s]:s.includes("Error")?[d_,s]:[io,s]},Xa=([n,r])=>n===ho&&(r==="function"||r==="symbol"),fC=(n,r,s,o)=>{const d=(f,a)=>{const c=o.push(f)-1;return s.set(a,c),c},_=f=>{if(s.has(f))return s.get(f);let[a,c]=bl(f);switch(a){case ho:{let g=f;switch(c){case"bigint":a=p_,g=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return d([f_],f)}return d([a,g],f)}case El:{if(c){let b=f;return c==="DataView"?b=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(f)),d([c,[...b]],f)}const g=[],u=d([a,g],f);for(const b of f)g.push(_(b));return u}case io:{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 g=[],u=d([a,g],f);for(const b of hC(f))(n||!Xa(bl(f[b])))&&g.push([_(b),_(f[b])]);return u}case _h:return d([a,f.toISOString()],f);case vh:{const{source:g,flags:u}=f;return d([a,{source:g,flags:u}],f)}case yh:{const g=[],u=d([a,g],f);for(const[b,C]of f)(n||!(Xa(bl(b))||Xa(bl(C))))&&g.push([_(b),_(C)]);return u}case Sh:{const g=[],u=d([a,g],f);for(const b of f)(n||!Xa(bl(b)))&&g.push(_(b));return u}}const{message:h}=f;return d([a,{name:c,message:h}],f)};return _},ig=(n,{json:r,lossy:s}={})=>{const o=[];return fC(!(r||s),!!r,new Map,o)(n),o},ro=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?ng(ig(n,r)):structuredClone(n):(n,r)=>ng(ig(n,r));function dC(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 pC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function mC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||dC,o=n.options.footnoteBackLabel||pC,d=n.options.footnoteLabel||"Footnotes",_=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const g=n.all(h),u=String(h.identifier).toUpperCase(),b=vs(u.toLowerCase());let C=0;const A=[],x=n.footnoteCounts.get(u);for(;x!==void 0&&++C<=x;){A.length>0&&A.push({type:"text",value:" "});let m=typeof s=="string"?s:s(c,C);typeof m=="string"&&(m={type:"text",value:m}),A.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,C),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const y=g[g.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const m=y.children[y.children.length-1];m&&m.type==="text"?m.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...A)}else g.push(...A);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(g,!0)};n.patch(h,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:_,properties:{...ro(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
68
+ `});const h={type:"element",tagName:"li",properties:_,children:f};return n.patch(r,h),n.applyData(r,h)}function Xb(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=h_(s[o])}return r}function h_(n){const r=n.spread;return r??n.children.length>1}function Qb(n,r){const s={},o=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<o.length;){const f=o[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const _={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,_),n.applyData(r,_)}function Zb(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Jb(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function eC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function tC(n,r){const s=n.all(r),o=s.shift(),d=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},a=uh(r.children[1]),c=Gg(r.children[r.children.length-1]);a&&c&&(f.position={start:a,end:c}),d.push(f)}const _={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,_),n.applyData(r,_)}function nC(n,r,s){const o=s?s.children:void 0,_=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,a=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<a;){const u=r.children[c],b={},C=f?f[c]:void 0;C&&(b.align=C);let A={type:"element",tagName:_,properties:b,children:[]};u&&(A.children=n.all(u),n.patch(u,A),A=n.applyData(u,A)),h.push(A)}const g={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,g),n.applyData(r,g)}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 Zm=9,Jm=32;function rC(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const _=[];for(;o;)_.push(eg(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return _.push(eg(r.slice(d),d>0,!1)),_.join("")}function eg(n,r,s){let o=0,d=n.length;if(r){let _=n.codePointAt(o);for(;_===Zm||_===Jm;)o++,_=n.codePointAt(o)}if(s){let _=n.codePointAt(d-1);for(;_===Zm||_===Jm;)d--,_=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function sC(n,r){const s={type:"text",value:rC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function lC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const aC={blockquote:Nb,break:Hb,code:zb,delete:Ib,emphasis:Ub,footnoteReference:Pb,heading:Fb,html:qb,imageReference:Gb,image:Vb,inlineCode:$b,linkReference:Wb,link:Kb,listItem:Yb,list:Qb,paragraph:Zb,root:Jb,strong:eC,table:tC,tableCell:iC,tableRow:nC,text:sC,thematicBreak:lC,toml:Ya,yaml:Ya,definition:Ya,footnoteDefinition:Ya};function Ya(){}const f_=-1,ho=0,kl=1,io=2,_h=3,vh=4,yh=5,Sh=6,d_=7,p_=8,oC=typeof self=="object"?self:globalThis,tg=(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 oC[n](r)},cC=(n,r)=>{const s=(d,_)=>(n.set(_,d),d),o=d=>{if(n.has(d))return n.get(d);const[_,f]=r[d];switch(_){case ho:case f_:return s(f,d);case kl:{const a=s([],d);for(const c of f)a.push(o(c));return a}case io:{const a=s({},d);for(const[c,h]of f)a[o(c)]=o(h);return a}case _h:return s(new Date(f),d);case vh:{const{source:a,flags:c}=f;return s(new RegExp(a,c),d)}case yh:{const a=s(new Map,d);for(const[c,h]of f)a.set(o(c),o(h));return a}case Sh:{const a=s(new Set,d);for(const c of f)a.add(o(c));return a}case d_:{const{name:a,message:c}=f;return s(tg(a,c),d)}case p_:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:a}=new Uint8Array(f);return s(new DataView(a),f)}}return s(tg(_,f),d)};return o},ng=n=>cC(new Map,n)(0),hs="",{toString:uC}={},{keys:hC}=Object,Cl=n=>{const r=typeof n;if(r!=="object"||!n)return[ho,r];const s=uC.call(n).slice(8,-1);switch(s){case"Array":return[kl,hs];case"Object":return[io,hs];case"Date":return[_h,hs];case"RegExp":return[vh,hs];case"Map":return[yh,hs];case"Set":return[Sh,hs];case"DataView":return[kl,s]}return s.includes("Array")?[kl,s]:s.includes("Error")?[d_,s]:[io,s]},Xa=([n,r])=>n===ho&&(r==="function"||r==="symbol"),fC=(n,r,s,o)=>{const d=(f,a)=>{const c=o.push(f)-1;return s.set(a,c),c},_=f=>{if(s.has(f))return s.get(f);let[a,c]=Cl(f);switch(a){case ho:{let g=f;switch(c){case"bigint":a=p_,g=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return d([f_],f)}return d([a,g],f)}case kl:{if(c){let b=f;return c==="DataView"?b=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(f)),d([c,[...b]],f)}const g=[],u=d([a,g],f);for(const b of f)g.push(_(b));return u}case io:{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 g=[],u=d([a,g],f);for(const b of hC(f))(n||!Xa(Cl(f[b])))&&g.push([_(b),_(f[b])]);return u}case _h:return d([a,f.toISOString()],f);case vh:{const{source:g,flags:u}=f;return d([a,{source:g,flags:u}],f)}case yh:{const g=[],u=d([a,g],f);for(const[b,C]of f)(n||!(Xa(Cl(b))||Xa(Cl(C))))&&g.push([_(b),_(C)]);return u}case Sh:{const g=[],u=d([a,g],f);for(const b of f)(n||!Xa(Cl(b)))&&g.push(_(b));return u}}const{message:h}=f;return d([a,{name:c,message:h}],f)};return _},ig=(n,{json:r,lossy:s}={})=>{const o=[];return fC(!(r||s),!!r,new Map,o)(n),o},ro=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?ng(ig(n,r)):structuredClone(n):(n,r)=>ng(ig(n,r));function dC(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 pC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function mC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||dC,o=n.options.footnoteBackLabel||pC,d=n.options.footnoteLabel||"Footnotes",_=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const g=n.all(h),u=String(h.identifier).toUpperCase(),b=vs(u.toLowerCase());let C=0;const A=[],x=n.footnoteCounts.get(u);for(;x!==void 0&&++C<=x;){A.length>0&&A.push({type:"text",value:" "});let m=typeof s=="string"?s:s(c,C);typeof m=="string"&&(m={type:"text",value:m}),A.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,C),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const y=g[g.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const m=y.children[y.children.length-1];m&&m.type==="text"?m.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...A)}else g.push(...A);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(g,!0)};n.patch(h,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:_,properties:{...ro(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
69
69
  `},{type:"element",tagName:"ol",properties:{},children:n.wrap(a,!0)},{type:"text",value:`
70
70
  `}]}}const fo=(function(n){if(n==null)return yC;if(typeof n=="function")return po(n);if(typeof n=="object")return Array.isArray(n)?gC(n):_C(n);if(typeof n=="string")return vC(n);throw new Error("Expected function, string, or object as test")});function gC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=fo(n[s]);return po(o);function o(...d){let _=-1;for(;++_<r.length;)if(r[_].apply(this,d))return!0;return!1}}function _C(n){const r=n;return po(s);function s(o){const d=o;let _;for(_ in n)if(d[_]!==r[_])return!1;return!0}}function vC(n){return po(r);function r(s){return s&&s.type===n}}function po(n){return r;function r(s,o,d){return!!(SC(s)&&n.call(this,s,typeof o=="number"?o:void 0,d||void 0))}}function yC(){return!0}function SC(n){return n!==null&&typeof n=="object"&&"type"in n}const m_=[],bC=!0,Qu=!1,CC="skip";function g_(n,r,s,o){let d;typeof r=="function"&&typeof s!="function"?(o=s,s=r):d=r;const _=fo(d),f=o?-1:1;a(n,void 0,[])();function a(c,h,g){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const C=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(C?"<"+C+">":""))+")"})}return b;function b(){let C=m_,A,x,y;if((!r||_(c,h,g[g.length-1]||void 0))&&(C=wC(s(c,g)),C[0]===Qu))return C;if("children"in c&&c.children){const v=c;if(v.children&&C[0]!==CC)for(x=(o?v.children.length:-1)+f,y=g.concat(v);x>-1&&x<v.children.length;){const m=v.children[x];if(A=a(m,x,y)(),A[0]===Qu)return A;x=typeof A[1]=="number"?A[1]:x+f}}return C}}}function wC(n){return Array.isArray(n)?n:typeof n=="number"?[bC,n]:n==null?m_:[n]}function bh(n,r,s,o){let d,_,f;typeof r=="function"&&typeof s!="function"?(_=void 0,f=r,d=s):(_=r,f=s,d=o),g_(n,_,a,d);function a(c,h){const g=h[h.length-1],u=g?g.children.indexOf(c):void 0;return f(c,u,g)}}const Zu={}.hasOwnProperty,xC={};function EC(n,r){const s=r||xC,o=new Map,d=new Map,_=new Map,f={...aC,...s.handlers},a={all:h,applyData:AC,definitionById:o,footnoteById:d,footnoteCounts:_,footnoteOrder:[],handlers:f,one:c,options:s,patch:kC,wrap:RC};return bh(n,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const u=g.type==="definition"?o:d,b=String(g.identifier).toUpperCase();u.has(b)||u.set(b,g)}}),a;function c(g,u){const b=g.type,C=a.handlers[b];if(Zu.call(a.handlers,b)&&C)return C(a,g,u);if(a.options.passThrough&&a.options.passThrough.includes(b)){if("children"in g){const{children:x,...y}=g,v=ro(y);return v.children=a.all(g),v}return ro(g)}return(a.options.unknownHandler||TC)(a,g,u)}function h(g){const u=[];if("children"in g){const b=g.children;let C=-1;for(;++C<b.length;){const A=a.one(b[C],g);if(A){if(C&&b[C-1].type==="break"&&(!Array.isArray(A)&&A.type==="text"&&(A.value=rg(A.value)),!Array.isArray(A)&&A.type==="element")){const x=A.children[0];x&&x.type==="text"&&(x.value=rg(x.value))}Array.isArray(A)?u.push(...A):u.push(A)}}}return u}}function kC(n,r){n.position&&(r.position=dy(n))}function AC(n,r){let s=r;if(n&&n.data){const o=n.data.hName,d=n.data.hChildren,_=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&_&&Object.assign(s.properties,ro(_)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function TC(n,r){const s=r.data||{},o="value"in r&&!(Zu.call(s,"hProperties")||Zu.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function RC(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
71
71
  `});++o<n.length;)o&&s.push({type:"text",value:`
72
72
  `}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
73
73
  `}),s}function rg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function sg(n,r){const s=EC(n,r),o=s.one(n,void 0),d=mC(s),_=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return d&&_.children.push({type:"text",value:`
74
- `},d),_}function DC(n,r){return n&&"run"in n?async function(s,o){const d=sg(s,{file:o,...r});await n.run(d,o)}:function(s,o){return sg(s,{file:o,...n||r})}}function lg(n){if(n)throw n}var Ou,ag;function MC(){if(ag)return Ou;ag=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},_=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var g=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!u)return!1;var b;for(b in h);return typeof b>"u"||n.call(h,b)},f=function(h,g){s&&g.name==="__proto__"?s(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},a=function(h,g){if(g==="__proto__")if(n.call(h,g)){if(o)return o(h,g).value}else return;return h[g]};return Ou=function c(){var h,g,u,b,C,A,x=arguments[0],y=1,v=arguments.length,m=!1;for(typeof x=="boolean"&&(m=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<v;++y)if(h=arguments[y],h!=null)for(g in h)u=a(x,g),b=a(h,g),x!==b&&(m&&b&&(_(b)||(C=d(b)))?(C?(C=!1,A=u&&d(u)?u:[]):A=u&&_(u)?u:{},f(x,{name:g,newValue:c(m,A,b)})):typeof b<"u"&&f(x,{name:g,newValue:b}));return x},Ou}var LC=MC();const Bu=Tg(LC);function Ju(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 OC(){const n=[],r={run:s,use:o};return r;function s(...d){let _=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);a(null,...d);function a(c,...h){const g=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,g?BC(g,a)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function BC(n,r){let s;return o;function o(...f){const a=n.length>f.length;let c;a&&f.push(d);try{c=n.apply(this,f)}catch(h){const g=h;if(a&&s)throw g;return d(g)}a||(c&&c.then&&typeof c.then=="function"?c.then(_,d):c instanceof Error?d(c):_(c))}function d(f,...a){s||(s=!0,r(f,...a))}function _(f){d(null,f)}}const Xn={basename:jC,dirname:NC,extname:HC,join:zC,sep:"/"};function jC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ml(n);let s=0,o=-1,d=n.length,_;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else o<0&&(_=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,a=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else f<0&&(_=!0,f=d+1),a>-1&&(n.codePointAt(d)===r.codePointAt(a--)?a<0&&(o=d):(a=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function NC(n){if(Ml(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function HC(n){Ml(n);let r=n.length,s=-1,o=0,d=-1,_=0,f;for(;r--;){const a=n.codePointAt(r);if(a===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),a===46?d<0?d=r:_!==1&&(_=1):d>-1&&(_=-1)}return d<0||s<0||_===0||_===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function zC(...n){let r=-1,s;for(;++r<n.length;)Ml(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":IC(s)}function IC(n){Ml(n);const r=n.codePointAt(0)===47;let s=UC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function UC(n,r){let s="",o=0,d=-1,_=0,f=-1,a,c;for(;++f<=n.length;){if(f<n.length)a=n.codePointAt(f);else{if(a===47)break;a=47}if(a===47){if(!(d===f-1||_===1))if(d!==f-1&&_===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,_=0;continue}}else if(s.length>0){s="",o=0,d=f,_=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,_=0}else a===46&&_>-1?_++:_=-1}return s}function Ml(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const PC={cwd:FC};function FC(){return"/"}function eh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function qC(n){if(typeof n=="string")n=new URL(n);else if(!eh(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 GC(n)}function GC(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const ju=["history","path","basename","stem","extname","dirname"];class __{constructor(r){let s;r?eh(r)?s={path:r}:typeof r=="string"||VC(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":PC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<ju.length;){const _=ju[o];_ in s&&s[_]!==void 0&&s[_]!==null&&(this[_]=_==="history"?[...s[_]]:s[_])}let d;for(d in s)ju.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Xn.basename(this.path):void 0}set basename(r){Hu(r,"basename"),Nu(r,"basename"),this.path=Xn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Xn.dirname(this.path):void 0}set dirname(r){og(this.basename,"dirname"),this.path=Xn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Xn.extname(this.path):void 0}set extname(r){if(Nu(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=Xn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){eh(r)&&(r=qC(r)),Hu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Xn.basename(this.path,this.extname):void 0}set stem(r){Hu(r,"stem"),Nu(r,"stem"),this.path=Xn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new Wt(r,s,o);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Nu(n,r){if(n&&n.includes(Xn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Xn.sep+"`")}function Hu(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 VC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const $C=(function(n){const o=this.constructor.prototype,d=o[n],_=function(){return d.apply(_,arguments)};return Object.setPrototypeOf(_,o),_}),WC={}.hasOwnProperty;class Ch extends $C{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=OC()}copy(){const r=new Ch;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Bu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(Uu("data",this.frozen),this.namespace[r]=s,this):WC.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Uu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Qa(r),o=this.parser||this.Parser;return zu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),zu("process",this.parser||this.Parser),Iu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(_,f){const a=Qa(r),c=o.parse(a);o.run(c,a,function(g,u,b){if(g||!u||!b)return h(g);const C=u,A=o.stringify(C,b);XC(A)?b.value=A:b.result=A,h(g,b)});function h(g,u){g||!u?f(g):_?_(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),zu("processSync",this.parser||this.Parser),Iu("processSync",this.compiler||this.Compiler),this.process(r,d),ug("processSync","process",s),o;function d(_,f){s=!0,lg(_),o=f}}run(r,s,o){cg(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?_(void 0,o):new Promise(_);function _(f,a){const c=Qa(s);d.run(r,c,h);function h(g,u,b){const C=u||r;g?a(g):f?f(C):o(void 0,C,b)}}}runSync(r,s){let o=!1,d;return this.run(r,s,_),ug("runSync","run",o),d;function _(f,a){lg(f),d=a,o=!0}}stringify(r,s){this.freeze();const o=Qa(s),d=this.compiler||this.Compiler;return Iu("stringify",d),cg(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(Uu("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?a(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function _(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...u]=h;c(g,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(h.plugins),h.settings&&(d.settings=Bu(!0,d.settings,h.settings))}function a(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const u=h[g];_(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,g){let u=-1,b=-1;for(;++u<o.length;)if(o[u][0]===h){b=u;break}if(b===-1)o.push([h,...g]);else if(g.length>0){let[C,...A]=g;const x=o[b][1];Ju(x)&&Ju(C)&&(C=Bu(!0,x,C)),o[b]=[h,C,...A]}}}}const KC=new Ch().freeze();function zu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Iu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Uu(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 cg(n){if(!Ju(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function ug(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Qa(n){return YC(n)?n:new __(n)}function YC(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function XC(n){return typeof n=="string"||QC(n)}function QC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ZC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hg=[],fg={allowDangerousHtml:!0},JC=/^(https?|ircs?|mailto|xmpp)$/i,ew=[{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 v_(n){const r=tw(n),s=nw(n);return iw(r.runSync(r.parse(s),s),n)}function tw(n){const r=n.rehypePlugins||hg,s=n.remarkPlugins||hg,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...fg}:fg;return KC().use(jb).use(s).use(DC,o).use(r)}function nw(n){const r=n.children||"",s=new __;return typeof r=="string"&&(s.value=r),s}function iw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,_=r.disallowedElements,f=r.skipHtml,a=r.unwrapDisallowed,c=r.urlTransform||rw;for(const g of ew)Object.hasOwn(r,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+ZC+g.id,void 0);return bh(n,h),vy(n,{Fragment:T.Fragment,components:d,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(g,u,b){if(g.type==="raw"&&b&&typeof u=="number")return f?b.children.splice(u,1):b.children[u]={type:"text",value:g.value},u;if(g.type==="element"){let C;for(C in Du)if(Object.hasOwn(Du,C)&&Object.hasOwn(g.properties,C)){const A=g.properties[C],x=Du[C];(x===null||x.includes(g.tagName))&&(g.properties[C]=c(String(A||""),C,g))}}if(g.type==="element"){let C=s?!s.includes(g.tagName):_?_.includes(g.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(g,u,b)),C&&b&&typeof u=="number")return a&&g.children?b.children.splice(u,1,...g.children):b.children.splice(u,1),u}}}function rw(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||JC.test(n.slice(0,r))?n:""}function dg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function sw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lw(n,r,s){const d=fo((s||{}).ignore||[]),_=aw(r);let f=-1;for(;++f<_.length;)g_(n,"text",a);function a(h,g){let u=-1,b;for(;++u<g.length;){const C=g[u],A=b?b.children:void 0;if(d(C,A?A.indexOf(C):void 0,b))return;b=C}if(b)return c(h,g)}function c(h,g){const u=g[g.length-1],b=_[f][0],C=_[f][1];let A=0;const y=u.children.indexOf(h);let v=!1,m=[];b.lastIndex=0;let S=b.exec(h.value);for(;S;){const k=S.index,M={index:S.index,input:S.input,stack:[...g,h]};let R=C(...S,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=k+1:(A!==k&&m.push({type:"text",value:h.value.slice(A,k)}),Array.isArray(R)?m.push(...R):R&&m.push(R),A=k+S[0].length,v=!0),!b.global)break;S=b.exec(h.value)}return v?(A<h.value.length&&m.push({type:"text",value:h.value.slice(A)}),u.children.splice(y,1,...m)):m=[h],y+m.length}}function aw(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const d=s[o];r.push([ow(d[0]),cw(d[1])])}return r}function ow(n){return typeof n=="string"?new RegExp(sw(n),"g"):n}function cw(n){return typeof n=="function"?n:function(){return n}}const Pu="phrasing",Fu=["autolink","link","image","label"];function uw(){return{transforms:[_w],enter:{literalAutolink:fw,literalAutolinkEmail:qu,literalAutolinkHttp:qu,literalAutolinkWww:qu},exit:{literalAutolink:gw,literalAutolinkEmail:mw,literalAutolinkHttp:dw,literalAutolinkWww:pw}}}function hw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Pu,notInConstruct:Fu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Pu,notInConstruct:Fu},{character:":",before:"[ps]",after:"\\/",inConstruct:Pu,notInConstruct:Fu}]}}function fw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function qu(n){this.config.enter.autolinkProtocol.call(this,n)}function dw(n){this.config.exit.autolinkProtocol.call(this,n)}function pw(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 mw(n){this.config.exit.autolinkEmail.call(this,n)}function gw(n){this.exit(n)}function _w(n){lw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yw]],{ignore:["link","linkReference"]})}function vw(n,r,s,o,d){let _="";if(!y_(d)||(/^w/i.test(r)&&(s=r+s,r="",_="http://"),!Sw(s)))return!1;const f=bw(s+o);if(!f[0])return!1;const a={type:"link",title:null,url:_+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[a,{type:"text",value:f[1]}]:a}function yw(n,r,s,o){return!y_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Sw(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 bw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=dg(n,"(");let _=dg(n,")");for(;o!==-1&&d>_;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),_++;return[n,s]}function y_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Ar(s)||co(s))&&(!r||s!==47)}S_.peek=Dw;function Cw(){this.buffer()}function ww(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function xw(){this.buffer()}function Ew(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function kw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Fn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Aw(n){this.exit(n)}function Tw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Fn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Rw(n){this.exit(n)}function Dw(){return"["}function S_(n,r,s,o){const d=s.createTracker(o);let _=d.move("[^");const f=s.enter("footnoteReference"),a=s.enter("reference");return _+=d.move(s.safe(s.associationId(n),{after:"]",before:_})),a(),f(),_+=d.move("]"),_}function Mw(){return{enter:{gfmFootnoteCallString:Cw,gfmFootnoteCall:ww,gfmFootnoteDefinitionLabelString:xw,gfmFootnoteDefinition:Ew},exit:{gfmFootnoteCallString:kw,gfmFootnoteCall:Aw,gfmFootnoteDefinitionLabelString:Tw,gfmFootnoteDefinition:Rw}}}function Lw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:S_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,_,f){const a=_.createTracker(f);let c=a.move("[^");const h=_.enter("footnoteDefinition"),g=_.enter("label");return c+=a.move(_.safe(_.associationId(o),{before:c,after:"]"})),g(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((r?`
74
+ `},d),_}function DC(n,r){return n&&"run"in n?async function(s,o){const d=sg(s,{file:o,...r});await n.run(d,o)}:function(s,o){return sg(s,{file:o,...n||r})}}function lg(n){if(n)throw n}var Ou,ag;function MC(){if(ag)return Ou;ag=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},_=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var g=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!u)return!1;var b;for(b in h);return typeof b>"u"||n.call(h,b)},f=function(h,g){s&&g.name==="__proto__"?s(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},a=function(h,g){if(g==="__proto__")if(n.call(h,g)){if(o)return o(h,g).value}else return;return h[g]};return Ou=function c(){var h,g,u,b,C,A,x=arguments[0],y=1,v=arguments.length,m=!1;for(typeof x=="boolean"&&(m=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<v;++y)if(h=arguments[y],h!=null)for(g in h)u=a(x,g),b=a(h,g),x!==b&&(m&&b&&(_(b)||(C=d(b)))?(C?(C=!1,A=u&&d(u)?u:[]):A=u&&_(u)?u:{},f(x,{name:g,newValue:c(m,A,b)})):typeof b<"u"&&f(x,{name:g,newValue:b}));return x},Ou}var LC=MC();const Bu=Tg(LC);function Ju(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 OC(){const n=[],r={run:s,use:o};return r;function s(...d){let _=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);a(null,...d);function a(c,...h){const g=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,g?BC(g,a)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function BC(n,r){let s;return o;function o(...f){const a=n.length>f.length;let c;a&&f.push(d);try{c=n.apply(this,f)}catch(h){const g=h;if(a&&s)throw g;return d(g)}a||(c&&c.then&&typeof c.then=="function"?c.then(_,d):c instanceof Error?d(c):_(c))}function d(f,...a){s||(s=!0,r(f,...a))}function _(f){d(null,f)}}const Qn={basename:jC,dirname:NC,extname:HC,join:zC,sep:"/"};function jC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ll(n);let s=0,o=-1,d=n.length,_;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else o<0&&(_=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,a=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else f<0&&(_=!0,f=d+1),a>-1&&(n.codePointAt(d)===r.codePointAt(a--)?a<0&&(o=d):(a=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function NC(n){if(Ll(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function HC(n){Ll(n);let r=n.length,s=-1,o=0,d=-1,_=0,f;for(;r--;){const a=n.codePointAt(r);if(a===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),a===46?d<0?d=r:_!==1&&(_=1):d>-1&&(_=-1)}return d<0||s<0||_===0||_===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function zC(...n){let r=-1,s;for(;++r<n.length;)Ll(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":IC(s)}function IC(n){Ll(n);const r=n.codePointAt(0)===47;let s=UC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function UC(n,r){let s="",o=0,d=-1,_=0,f=-1,a,c;for(;++f<=n.length;){if(f<n.length)a=n.codePointAt(f);else{if(a===47)break;a=47}if(a===47){if(!(d===f-1||_===1))if(d!==f-1&&_===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,_=0;continue}}else if(s.length>0){s="",o=0,d=f,_=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,_=0}else a===46&&_>-1?_++:_=-1}return s}function Ll(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const PC={cwd:FC};function FC(){return"/"}function eh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function qC(n){if(typeof n=="string")n=new URL(n);else if(!eh(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 GC(n)}function GC(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const ju=["history","path","basename","stem","extname","dirname"];class __{constructor(r){let s;r?eh(r)?s={path:r}:typeof r=="string"||VC(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":PC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<ju.length;){const _=ju[o];_ in s&&s[_]!==void 0&&s[_]!==null&&(this[_]=_==="history"?[...s[_]]:s[_])}let d;for(d in s)ju.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(r){Hu(r,"basename"),Nu(r,"basename"),this.path=Qn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(r){og(this.basename,"dirname"),this.path=Qn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(r){if(Nu(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=Qn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){eh(r)&&(r=qC(r)),Hu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(r){Hu(r,"stem"),Nu(r,"stem"),this.path=Qn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new Wt(r,s,o);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Nu(n,r){if(n&&n.includes(Qn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Qn.sep+"`")}function Hu(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 VC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const $C=(function(n){const o=this.constructor.prototype,d=o[n],_=function(){return d.apply(_,arguments)};return Object.setPrototypeOf(_,o),_}),WC={}.hasOwnProperty;class Ch extends $C{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=OC()}copy(){const r=new Ch;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Bu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(Uu("data",this.frozen),this.namespace[r]=s,this):WC.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Uu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Qa(r),o=this.parser||this.Parser;return zu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),zu("process",this.parser||this.Parser),Iu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(_,f){const a=Qa(r),c=o.parse(a);o.run(c,a,function(g,u,b){if(g||!u||!b)return h(g);const C=u,A=o.stringify(C,b);XC(A)?b.value=A:b.result=A,h(g,b)});function h(g,u){g||!u?f(g):_?_(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),zu("processSync",this.parser||this.Parser),Iu("processSync",this.compiler||this.Compiler),this.process(r,d),ug("processSync","process",s),o;function d(_,f){s=!0,lg(_),o=f}}run(r,s,o){cg(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?_(void 0,o):new Promise(_);function _(f,a){const c=Qa(s);d.run(r,c,h);function h(g,u,b){const C=u||r;g?a(g):f?f(C):o(void 0,C,b)}}}runSync(r,s){let o=!1,d;return this.run(r,s,_),ug("runSync","run",o),d;function _(f,a){lg(f),d=a,o=!0}}stringify(r,s){this.freeze();const o=Qa(s),d=this.compiler||this.Compiler;return Iu("stringify",d),cg(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(Uu("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?a(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function _(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...u]=h;c(g,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(h.plugins),h.settings&&(d.settings=Bu(!0,d.settings,h.settings))}function a(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const u=h[g];_(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,g){let u=-1,b=-1;for(;++u<o.length;)if(o[u][0]===h){b=u;break}if(b===-1)o.push([h,...g]);else if(g.length>0){let[C,...A]=g;const x=o[b][1];Ju(x)&&Ju(C)&&(C=Bu(!0,x,C)),o[b]=[h,C,...A]}}}}const KC=new Ch().freeze();function zu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Iu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Uu(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 cg(n){if(!Ju(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function ug(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Qa(n){return YC(n)?n:new __(n)}function YC(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function XC(n){return typeof n=="string"||QC(n)}function QC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ZC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hg=[],fg={allowDangerousHtml:!0},JC=/^(https?|ircs?|mailto|xmpp)$/i,ew=[{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 v_(n){const r=tw(n),s=nw(n);return iw(r.runSync(r.parse(s),s),n)}function tw(n){const r=n.rehypePlugins||hg,s=n.remarkPlugins||hg,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...fg}:fg;return KC().use(jb).use(s).use(DC,o).use(r)}function nw(n){const r=n.children||"",s=new __;return typeof r=="string"&&(s.value=r),s}function iw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,_=r.disallowedElements,f=r.skipHtml,a=r.unwrapDisallowed,c=r.urlTransform||rw;for(const g of ew)Object.hasOwn(r,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+ZC+g.id,void 0);return bh(n,h),vy(n,{Fragment:T.Fragment,components:d,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(g,u,b){if(g.type==="raw"&&b&&typeof u=="number")return f?b.children.splice(u,1):b.children[u]={type:"text",value:g.value},u;if(g.type==="element"){let C;for(C in Du)if(Object.hasOwn(Du,C)&&Object.hasOwn(g.properties,C)){const A=g.properties[C],x=Du[C];(x===null||x.includes(g.tagName))&&(g.properties[C]=c(String(A||""),C,g))}}if(g.type==="element"){let C=s?!s.includes(g.tagName):_?_.includes(g.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(g,u,b)),C&&b&&typeof u=="number")return a&&g.children?b.children.splice(u,1,...g.children):b.children.splice(u,1),u}}}function rw(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||JC.test(n.slice(0,r))?n:""}function dg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function sw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lw(n,r,s){const d=fo((s||{}).ignore||[]),_=aw(r);let f=-1;for(;++f<_.length;)g_(n,"text",a);function a(h,g){let u=-1,b;for(;++u<g.length;){const C=g[u],A=b?b.children:void 0;if(d(C,A?A.indexOf(C):void 0,b))return;b=C}if(b)return c(h,g)}function c(h,g){const u=g[g.length-1],b=_[f][0],C=_[f][1];let A=0;const y=u.children.indexOf(h);let v=!1,m=[];b.lastIndex=0;let S=b.exec(h.value);for(;S;){const k=S.index,M={index:S.index,input:S.input,stack:[...g,h]};let R=C(...S,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=k+1:(A!==k&&m.push({type:"text",value:h.value.slice(A,k)}),Array.isArray(R)?m.push(...R):R&&m.push(R),A=k+S[0].length,v=!0),!b.global)break;S=b.exec(h.value)}return v?(A<h.value.length&&m.push({type:"text",value:h.value.slice(A)}),u.children.splice(y,1,...m)):m=[h],y+m.length}}function aw(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const d=s[o];r.push([ow(d[0]),cw(d[1])])}return r}function ow(n){return typeof n=="string"?new RegExp(sw(n),"g"):n}function cw(n){return typeof n=="function"?n:function(){return n}}const Pu="phrasing",Fu=["autolink","link","image","label"];function uw(){return{transforms:[_w],enter:{literalAutolink:fw,literalAutolinkEmail:qu,literalAutolinkHttp:qu,literalAutolinkWww:qu},exit:{literalAutolink:gw,literalAutolinkEmail:mw,literalAutolinkHttp:dw,literalAutolinkWww:pw}}}function hw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Pu,notInConstruct:Fu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Pu,notInConstruct:Fu},{character:":",before:"[ps]",after:"\\/",inConstruct:Pu,notInConstruct:Fu}]}}function fw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function qu(n){this.config.enter.autolinkProtocol.call(this,n)}function dw(n){this.config.exit.autolinkProtocol.call(this,n)}function pw(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 mw(n){this.config.exit.autolinkEmail.call(this,n)}function gw(n){this.exit(n)}function _w(n){lw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yw]],{ignore:["link","linkReference"]})}function vw(n,r,s,o,d){let _="";if(!y_(d)||(/^w/i.test(r)&&(s=r+s,r="",_="http://"),!Sw(s)))return!1;const f=bw(s+o);if(!f[0])return!1;const a={type:"link",title:null,url:_+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[a,{type:"text",value:f[1]}]:a}function yw(n,r,s,o){return!y_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Sw(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 bw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=dg(n,"(");let _=dg(n,")");for(;o!==-1&&d>_;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),_++;return[n,s]}function y_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||xr(s)||co(s))&&(!r||s!==47)}S_.peek=Dw;function Cw(){this.buffer()}function ww(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function xw(){this.buffer()}function Ew(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function kw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Pn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Aw(n){this.exit(n)}function Tw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Pn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Rw(n){this.exit(n)}function Dw(){return"["}function S_(n,r,s,o){const d=s.createTracker(o);let _=d.move("[^");const f=s.enter("footnoteReference"),a=s.enter("reference");return _+=d.move(s.safe(s.associationId(n),{after:"]",before:_})),a(),f(),_+=d.move("]"),_}function Mw(){return{enter:{gfmFootnoteCallString:Cw,gfmFootnoteCall:ww,gfmFootnoteDefinitionLabelString:xw,gfmFootnoteDefinition:Ew},exit:{gfmFootnoteCallString:kw,gfmFootnoteCall:Aw,gfmFootnoteDefinitionLabelString:Tw,gfmFootnoteDefinition:Rw}}}function Lw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:S_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,_,f){const a=_.createTracker(f);let c=a.move("[^");const h=_.enter("footnoteDefinition"),g=_.enter("label");return c+=a.move(_.safe(_.associationId(o),{before:c,after:"]"})),g(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((r?`
75
75
  `:" ")+_.indentLines(_.containerFlow(o,a.current()),r?b_:Ow))),h(),c}}function Ow(n,r,s){return r===0?n:b_(n,r,s)}function b_(n,r,s){return(s?"":" ")+n}const Bw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];C_.peek=Iw;function jw(){return{canContainEols:["delete"],enter:{strikethrough:Hw},exit:{strikethrough:zw}}}function Nw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Bw}],handlers:{delete:C_}}}function Hw(n){this.enter({type:"delete",children:[]},n)}function zw(n){this.exit(n)}function C_(n,r,s,o){const d=s.createTracker(o),_=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),_(),f}function Iw(){return"~"}function Uw(n){return n.length}function Pw(n,r){const s=r||{},o=(s.align||[]).concat(),d=s.stringLength||Uw,_=[],f=[],a=[],c=[];let h=0,g=-1;for(;++g<n.length;){const x=[],y=[];let v=-1;for(n[g].length>h&&(h=n[g].length);++v<n[g].length;){const m=Fw(n[g][v]);if(s.alignDelimiters!==!1){const S=d(m);y[v]=S,(c[v]===void 0||S>c[v])&&(c[v]=S)}x.push(m)}f[g]=x,a[g]=y}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<h;)_[u]=pg(o[u]);else{const x=pg(o);for(;++u<h;)_[u]=x}u=-1;const b=[],C=[];for(;++u<h;){const x=_[u];let y="",v="";x===99?(y=":",v=":"):x===108?y=":":x===114&&(v=":");let m=s.alignDelimiters===!1?1:Math.max(1,c[u]-y.length-v.length);const S=y+"-".repeat(m)+v;s.alignDelimiters!==!1&&(m=y.length+m+v.length,m>c[u]&&(c[u]=m),C[u]=m),b[u]=S}f.splice(1,0,b),a.splice(1,0,C),g=-1;const A=[];for(;++g<f.length;){const x=f[g],y=a[g];u=-1;const v=[];for(;++u<h;){const m=x[u]||"";let S="",k="";if(s.alignDelimiters!==!1){const M=c[u]-(y[u]||0),R=_[u];R===114?S=" ".repeat(M):R===99?M%2?(S=" ".repeat(M/2+.5),k=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),k=S):k=" ".repeat(M)}s.delimiterStart!==!1&&!u&&v.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&m==="")&&(s.delimiterStart!==!1||u)&&v.push(" "),s.alignDelimiters!==!1&&v.push(S),v.push(m),s.alignDelimiters!==!1&&v.push(k),s.padding!==!1&&v.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&v.push("|")}A.push(s.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return A.join(`
76
76
  `)}function Fw(n){return n==null?"":String(n)}function pg(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 qw(n,r,s,o){const d=s.enter("blockquote"),_=s.createTracker(o);_.move("> "),_.shift(2);const f=s.indentLines(s.containerFlow(n,_.current()),Gw);return d(),f}function Gw(n,r,s){return">"+(s?"":" ")+n}function Vw(n,r){return mg(n,r.inConstruct,!0)&&!mg(n,r.notInConstruct,!1)}function mg(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function gg(n,r,s,o){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
77
77
  `&&Vw(s.stack,s.unsafe[d]))return/[ \t]/.test(o.before)?"":" ";return`\\
@@ -79,17 +79,17 @@ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v)
79
79
  `,encode:["`"],...a.current()})),u()}return g+=a.move(`
80
80
  `),_&&(g+=a.move(_+`
81
81
  `)),g+=a.move(c),h(),g}function Xw(n,r,s){return(s?"":" ")+n}function wh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function Qw(n,r,s,o){const d=wh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),a(),!n.url||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
82
- `,...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),f(),h}function Zw(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 Tl(n){return"&#x"+n.toString(16).toUpperCase()+";"}function so(n,r,s){const o=ms(n),d=ms(r);return o===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}w_.peek=Jw;function w_(n,r,s,o){const d=Zw(s),_=s.enter("emphasis"),f=s.createTracker(o),a=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),g=so(o.before.charCodeAt(o.before.length-1),h,d);g.inside&&(c=Tl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=so(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Tl(u));const C=f.move(d);return _(),s.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},a+c+C}function Jw(n,r,s){return s.options.emphasis||"*"}function ex(n,r){let s=!1;return bh(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,Qu}),!!((!n.depth||n.depth<3)&&ph(n)&&(r.options.setext||s))}function tx(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),_=s.createTracker(o);if(ex(n,s)){const g=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{..._.current(),before:`
82
+ `,...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),f(),h}function Zw(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 Rl(n){return"&#x"+n.toString(16).toUpperCase()+";"}function so(n,r,s){const o=ms(n),d=ms(r);return o===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}w_.peek=Jw;function w_(n,r,s,o){const d=Zw(s),_=s.enter("emphasis"),f=s.createTracker(o),a=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),g=so(o.before.charCodeAt(o.before.length-1),h,d);g.inside&&(c=Rl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=so(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Rl(u));const C=f.move(d);return _(),s.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},a+c+C}function Jw(n,r,s){return s.options.emphasis||"*"}function ex(n,r){let s=!1;return bh(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,Qu}),!!((!n.depth||n.depth<3)&&ph(n)&&(r.options.setext||s))}function tx(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),_=s.createTracker(o);if(ex(n,s)){const g=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{..._.current(),before:`
83
83
  `,after:`
84
84
  `});return u(),g(),b+`
85
85
  `+(d===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
86
86
  `))+1))}const f="#".repeat(d),a=s.enter("headingAtx"),c=s.enter("phrasing");_.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
87
- `,..._.current()});return/^[\t ]/.test(h)&&(h=Tl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),a(),h}x_.peek=nx;function x_(n){return n.value||""}function nx(){return"<"}E_.peek=ix;function E_(n,r,s,o){const d=wh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),a(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),h+=c.move(")"),f(),h}function ix(){return"!"}k_.peek=rx;function k_(n,r,s,o){const d=n.referenceType,_=s.enter("imageReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("![");const h=s.safe(n.alt,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=g,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function rx(){return"!"}A_.peek=sx;function A_(n,r,s){let o=n.value||"",d="`",_=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(o);)d+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++_<s.unsafe.length;){const f=s.unsafe[_],a=s.compilePattern(f);let c;if(f.atBreak)for(;c=a.exec(o);){let h=c.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(c.index+1)}}return d+o+d}function sx(){return"`"}function T_(n,r){const s=ph(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))}R_.peek=lx;function R_(n,r,s,o){const d=wh(s),_=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let a,c;if(T_(n,s)){const g=s.stack;s.stack=[],a=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),a(),s.stack=g,u}a=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${_}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),a(),h}function lx(n,r,s){return T_(n,s)?"<":"["}D_.peek=ax;function D_(n,r,s,o){const d=n.referenceType,_=s.enter("linkReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=g,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function ax(){return"["}function xh(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 ox(n){const r=xh(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 cx(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 M_(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 ux(n,r,s,o){const d=s.enter("list"),_=s.bulletCurrent;let f=n.ordered?cx(s):xh(s);const a=n.ordered?f==="."?")":".":ox(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const g=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.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),M_(s)===f&&g){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=a),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=_,d(),h}function hx(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 fx(n,r,s,o){const d=hx(s);let _=s.bulletCurrent||xh(s);r&&r.type==="list"&&r.ordered&&(_=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+_);let f=_.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const a=s.createTracker(o);a.move(_+" ".repeat(f-_.length)),a.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,a.current()),g);return c(),h;function g(u,b,C){return b?(C?"":" ".repeat(f))+u:(C?_:_+" ".repeat(f-_.length))+u}}function dx(n,r,s,o){const d=s.enter("paragraph"),_=s.enter("phrasing"),f=s.containerPhrasing(n,o);return _(),d(),f}const px=fo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mx(n,r,s,o){return(n.children.some(function(f){return px(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function gx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}L_.peek=_x;function L_(n,r,s,o){const d=gx(s),_=s.enter("strong"),f=s.createTracker(o),a=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),g=so(o.before.charCodeAt(o.before.length-1),h,d);g.inside&&(c=Tl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=so(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Tl(u));const C=f.move(d+d);return _(),s.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},a+c+C}function _x(n,r,s){return s.options.strong||"*"}function vx(n,r,s,o){return s.safe(n.value,o)}function yx(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 Sx(n,r,s){const o=(M_(s)+(s.options.ruleSpaces?" ":"")).repeat(yx(s));return s.options.ruleSpaces?o.slice(0,-1):o}const O_={blockquote:qw,break:gg,code:Yw,definition:Qw,emphasis:w_,hardBreak:gg,heading:tx,html:x_,image:E_,imageReference:k_,inlineCode:A_,link:R_,linkReference:D_,list:ux,listItem:fx,paragraph:dx,root:mx,strong:L_,text:vx,thematicBreak:Sx};function bx(){return{enter:{table:Cx,tableData:_g,tableHeader:_g,tableRow:xx},exit:{codeText:Ex,table:wx,tableData:Gu,tableHeader:Gu,tableRow:Gu}}}function Cx(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 wx(n){this.exit(n),this.data.inTable=void 0}function xx(n){this.enter({type:"tableRow",children:[]},n)}function Gu(n){this.exit(n)}function _g(n){this.enter({type:"tableCell",children:[]},n)}function Ex(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,kx));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function kx(n,r){return r==="|"?r:n}function Ax(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,_=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
87
+ `,..._.current()});return/^[\t ]/.test(h)&&(h=Rl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),a(),h}x_.peek=nx;function x_(n){return n.value||""}function nx(){return"<"}E_.peek=ix;function E_(n,r,s,o){const d=wh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),a(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),h+=c.move(")"),f(),h}function ix(){return"!"}k_.peek=rx;function k_(n,r,s,o){const d=n.referenceType,_=s.enter("imageReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("![");const h=s.safe(n.alt,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=g,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function rx(){return"!"}A_.peek=sx;function A_(n,r,s){let o=n.value||"",d="`",_=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(o);)d+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++_<s.unsafe.length;){const f=s.unsafe[_],a=s.compilePattern(f);let c;if(f.atBreak)for(;c=a.exec(o);){let h=c.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(c.index+1)}}return d+o+d}function sx(){return"`"}function T_(n,r){const s=ph(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))}R_.peek=lx;function R_(n,r,s,o){const d=wh(s),_=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let a,c;if(T_(n,s)){const g=s.stack;s.stack=[],a=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),a(),s.stack=g,u}a=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${_}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),a(),h}function lx(n,r,s){return T_(n,s)?"<":"["}D_.peek=ax;function D_(n,r,s,o){const d=n.referenceType,_=s.enter("linkReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=g,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function ax(){return"["}function xh(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 ox(n){const r=xh(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 cx(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 M_(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 ux(n,r,s,o){const d=s.enter("list"),_=s.bulletCurrent;let f=n.ordered?cx(s):xh(s);const a=n.ordered?f==="."?")":".":ox(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const g=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.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),M_(s)===f&&g){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=a),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=_,d(),h}function hx(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 fx(n,r,s,o){const d=hx(s);let _=s.bulletCurrent||xh(s);r&&r.type==="list"&&r.ordered&&(_=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+_);let f=_.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const a=s.createTracker(o);a.move(_+" ".repeat(f-_.length)),a.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,a.current()),g);return c(),h;function g(u,b,C){return b?(C?"":" ".repeat(f))+u:(C?_:_+" ".repeat(f-_.length))+u}}function dx(n,r,s,o){const d=s.enter("paragraph"),_=s.enter("phrasing"),f=s.containerPhrasing(n,o);return _(),d(),f}const px=fo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mx(n,r,s,o){return(n.children.some(function(f){return px(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function gx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}L_.peek=_x;function L_(n,r,s,o){const d=gx(s),_=s.enter("strong"),f=s.createTracker(o),a=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),g=so(o.before.charCodeAt(o.before.length-1),h,d);g.inside&&(c=Rl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=so(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Rl(u));const C=f.move(d+d);return _(),s.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},a+c+C}function _x(n,r,s){return s.options.strong||"*"}function vx(n,r,s,o){return s.safe(n.value,o)}function yx(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 Sx(n,r,s){const o=(M_(s)+(s.options.ruleSpaces?" ":"")).repeat(yx(s));return s.options.ruleSpaces?o.slice(0,-1):o}const O_={blockquote:qw,break:gg,code:Yw,definition:Qw,emphasis:w_,hardBreak:gg,heading:tx,html:x_,image:E_,imageReference:k_,inlineCode:A_,link:R_,linkReference:D_,list:ux,listItem:fx,paragraph:dx,root:mx,strong:L_,text:vx,thematicBreak:Sx};function bx(){return{enter:{table:Cx,tableData:_g,tableHeader:_g,tableRow:xx},exit:{codeText:Ex,table:wx,tableData:Gu,tableHeader:Gu,tableRow:Gu}}}function Cx(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 wx(n){this.exit(n),this.data.inTable=void 0}function xx(n){this.enter({type:"tableRow",children:[]},n)}function Gu(n){this.exit(n)}function _g(n){this.enter({type:"tableCell",children:[]},n)}function Ex(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,kx));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function kx(n,r){return r==="|"?r:n}function Ax(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,_=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
88
88
  `,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:a}};function f(C,A,x,y){return h(g(C,x,y),C.align)}function a(C,A,x,y){const v=u(C,x,y),m=h([v]);return m.slice(0,m.indexOf(`
89
- `))}function c(C,A,x,y){const v=x.enter("tableCell"),m=x.enter("phrasing"),S=x.containerPhrasing(C,{...y,before:_,after:_});return m(),v(),S}function h(C,A){return Pw(C,{align:A,alignDelimiters:o,padding:s,stringLength:d})}function g(C,A,x){const y=C.children;let v=-1;const m=[],S=A.enter("table");for(;++v<y.length;)m[v]=u(y[v],A,x);return S(),m}function u(C,A,x){const y=C.children;let v=-1;const m=[],S=A.enter("tableRow");for(;++v<y.length;)m[v]=c(y[v],C,A,x);return S(),m}function b(C,A,x){let y=O_.inlineCode(C,A,x);return x.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Tx(){return{exit:{taskListCheckValueChecked:vg,taskListCheckValueUnchecked:vg,paragraph:Dx}}}function Rx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Mx}}}function vg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function Dx(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const d=r.children;let _=-1,f;for(;++_<d.length;){const a=d[_];if(a.type==="paragraph"){f=a;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function Mx(n,r,s,o){const d=n.children[0],_=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",a=s.createTracker(o);_&&a.move(f);let c=O_.listItem(n,r,s,{...o,...a.current()});return _&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(g){return g+f}}function Lx(){return[uw(),Mw(),jw(),bx(),Tx()]}function Ox(n){return{extensions:[hw(),Lw(n),Nw(),Ax(n),Rx()]}}const Bx={tokenize:Ux,partial:!0},B_={tokenize:Px,partial:!0},j_={tokenize:Fx,partial:!0},N_={tokenize:qx,partial:!0},jx={tokenize:Gx,partial:!0},H_={name:"wwwAutolink",tokenize:zx,previous:I_},z_={name:"protocolAutolink",tokenize:Ix,previous:U_},Si={name:"emailAutolink",tokenize:Hx,previous:P_},Qn={};function Nx(){return{text:Qn}}let kr=48;for(;kr<123;)Qn[kr]=Si,kr++,kr===58?kr=65:kr===91&&(kr=97);Qn[43]=Si;Qn[45]=Si;Qn[46]=Si;Qn[95]=Si;Qn[72]=[Si,z_];Qn[104]=[Si,z_];Qn[87]=[Si,H_];Qn[119]=[Si,H_];function Hx(n,r,s){const o=this;let d,_;return f;function f(u){return!th(u)||!P_.call(o,o.previous)||Eh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),a(u))}function a(u){return th(u)?(n.consume(u),a):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(jx,g,h)(u):u===45||u===95||$t(u)?(_=!0,n.consume(u),c):g(u)}function h(u){return n.consume(u),d=!0,c}function g(u){return _&&d&&Jt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function zx(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!I_.call(o,o.previous)||Eh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Bx,n.attempt(B_,n.attempt(j_,_),s),s)(f))}function _(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function Ix(n,r,s){const o=this;let d="",_=!1;return f;function f(u){return(u===72||u===104)&&U_.call(o,o.previous)&&!Eh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),a):s(u)}function a(u){if(Jt(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),a;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),_?h:(_=!0,c)):s(u)}function h(u){return u===null||no(u)||ut(u)||Ar(u)||co(u)?s(u):n.attempt(B_,n.attempt(j_,g),s)(u)}function g(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Ux(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),_):s(f)}function _(f){return f===null?s(f):r(f)}}function Px(n,r,s){let o,d,_;return f;function f(h){return h===46||h===95?n.check(N_,c,a)(h):h===null||ut(h)||Ar(h)||h!==45&&co(h)?c(h):(_=!0,n.consume(h),f)}function a(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!_?s(h):r(h)}}function Fx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?_(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(N_,r,_)(f):f===null||ut(f)||Ar(f)?r(f):(n.consume(f),d)}function _(f){return f===41&&o++,n.consume(f),d}}function qx(n,r,s){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(n.consume(a),o):a===38?(n.consume(a),_):a===93?(n.consume(a),d):a===60||a===null||ut(a)||Ar(a)?r(a):s(a)}function d(a){return a===null||a===40||a===91||ut(a)||Ar(a)?r(a):o(a)}function _(a){return Jt(a)?f(a):s(a)}function f(a){return a===59?(n.consume(a),o):Jt(a)?(n.consume(a),f):s(a)}}function Gx(n,r,s){return o;function o(_){return n.consume(_),d}function d(_){return $t(_)?s(_):r(_)}}function I_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ut(n)}function U_(n){return!Jt(n)}function P_(n){return!(n===47||th(n))}function th(n){return n===43||n===45||n===46||n===95||$t(n)}function Eh(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Vx={tokenize:Jx,partial:!0};function $x(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Xx,continuation:{tokenize:Qx},exit:Zx}},text:{91:{name:"gfmFootnoteCall",tokenize:Yx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Wx,resolveTo:Kx}}}}function Wx(n,r,s){const o=this;let d=o.events.length;const _=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!f||!f._balanced)return s(c);const h=Fn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!_.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function Kx(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const _={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},_.start),end:Object.assign({},_.end)},a=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",_,r],["enter",f,r],["exit",f,r],["exit",_,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...a),n}function Yx(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _=0,f;return a;function a(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(_>999||u===93&&!f||u===null||u===91||ut(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes(Fn(o.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ut(u)||(f=!0),_++,n.consume(u),u===92?g:h}function g(u){return u===91||u===92||u===93?(n.consume(u),_++,h):h(u)}}function Xx(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _,f=0,a;return c;function c(A){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(A){return A===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",g):s(A)}function g(A){if(f>999||A===93&&!a||A===null||A===91||ut(A))return s(A);if(A===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return _=Fn(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ut(A)||(a=!0),f++,n.consume(A),A===92?u:g}function u(A){return A===91||A===92||A===93?(n.consume(A),f++,g):g(A)}function b(A){return A===58?(n.enter("definitionMarker"),n.consume(A),n.exit("definitionMarker"),d.includes(_)||d.push(_),Qe(n,C,"gfmFootnoteDefinitionWhitespace")):s(A)}function C(A){return r(A)}}function Qx(n,r,s){return n.check(Dl,r,n.attempt(Vx,r,s))}function Zx(n){n.exit("gfmFootnoteDefinition")}function Jx(n,r,s){const o=this;return Qe(n,d,"gfmFootnoteDefinitionIndent",5);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(_):s(_)}}function eE(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:_,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,a){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const g={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",g,a],["enter",f[h][1],a],["exit",f[h][1],a],["enter",u,a]],C=a.parser.constructs.insideSpan.null;C&&Cn(b,b.length,0,uo(C,f.slice(h+1,c),a)),Cn(b,b.length,0,[["exit",u,a],["enter",f[c][1],a],["exit",f[c][1],a],["exit",g,a]]),Cn(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 _(f,a,c){const h=this.previous,g=this.events;let u=0;return b;function b(A){return h===126&&g[g.length-1][1].type!=="characterEscape"?c(A):(f.enter("strikethroughSequenceTemporary"),C(A))}function C(A){const x=ms(h);if(A===126)return u>1?c(A):(f.consume(A),u++,C);if(u<2&&!s)return c(A);const y=f.exit("strikethroughSequenceTemporary"),v=ms(A);return y._open=!v||v===2&&!!x,y._close=!x||x===2&&!!v,a(A)}}}class tE{constructor(){this.map=[]}add(r,s,o){nE(this,r,s,o)}consume(r){if(this.map.sort(function(_,f){return _[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const _ of d)r.push(_);d=o.pop()}this.map.length=0}}function nE(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function iE(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const _=o.length-1;o[_]=o[_]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function rE(){return{flow:{null:{name:"table",tokenize:sE,resolveAll:lE}}}}function sE(n,r,s){const o=this;let d=0,_=0,f;return a;function a(O){let I=o.events.length-1;for(;I>-1;){const W=o.events[I][1].type;if(W==="lineEnding"||W==="linePrefix")I--;else break}const F=I>-1?o.events[I][1].type:null,U=F==="tableHead"||F==="tableRow"?R:c;return U===R&&o.parser.lazy[o.now().line]?s(O):U(O)}function c(O){return n.enter("tableHead"),n.enter("tableRow"),h(O)}function h(O){return O===124||(f=!0,_+=1),g(O)}function g(O){return O===null?s(O):Le(O)?_>1?(_=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),C):s(O):$e(O)?Qe(n,g,"whitespace")(O):(_+=1,f&&(f=!1,d+=1),O===124?(n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),f=!0,g):(n.enter("data"),u(O)))}function u(O){return O===null||O===124||ut(O)?(n.exit("data"),g(O)):(n.consume(O),O===92?b:u)}function b(O){return O===92||O===124?(n.consume(O),u):u(O)}function C(O){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(O):(n.enter("tableDelimiterRow"),f=!1,$e(O)?Qe(n,A,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):A(O))}function A(O){return O===45||O===58?y(O):O===124?(f=!0,n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),x):M(O)}function x(O){return $e(O)?Qe(n,y,"whitespace")(O):y(O)}function y(O){return O===58?(_+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(O),n.exit("tableDelimiterMarker"),v):O===45?(_+=1,v(O)):O===null||Le(O)?k(O):M(O)}function v(O){return O===45?(n.enter("tableDelimiterFiller"),m(O)):M(O)}function m(O){return O===45?(n.consume(O),m):O===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(O),n.exit("tableDelimiterMarker"),S):(n.exit("tableDelimiterFiller"),S(O))}function S(O){return $e(O)?Qe(n,k,"whitespace")(O):k(O)}function k(O){return O===124?A(O):O===null||Le(O)?!f||d!==_?M(O):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(O)):M(O)}function M(O){return s(O)}function R(O){return n.enter("tableRow"),D(O)}function D(O){return O===124?(n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),D):O===null||Le(O)?(n.exit("tableRow"),r(O)):$e(O)?Qe(n,D,"whitespace")(O):(n.enter("data"),E(O))}function E(O){return O===null||O===124||ut(O)?(n.exit("data"),D(O)):(n.consume(O),O===92?L:E)}function L(O){return O===92||O===124?(n.consume(O),E):E(O)}}function lE(n,r){let s=-1,o=!0,d=0,_=[0,0,0,0],f=[0,0,0,0],a=!1,c=0,h,g,u;const b=new tE;for(;++s<n.length;){const C=n[s],A=C[1];C[0]==="enter"?A.type==="tableHead"?(a=!1,c!==0&&(yg(b,r,c,h,g),g=void 0,c=0),h={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},b.add(s,0,[["enter",h,r]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(o=!0,u=void 0,_=[0,0,0,0],f=[0,s+1,0,0],a&&(a=!1,g={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},b.add(s,0,[["enter",g,r]])),d=A.type==="tableDelimiterRow"?2:g?3:1):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(_[1]!==0&&(f[0]=f[1],u=Za(b,r,_,d,void 0,u),_=[0,0,0,0]),f[2]=s)):A.type==="tableCellDivider"&&(o?o=!1:(_[1]!==0&&(f[0]=f[1],u=Za(b,r,_,d,void 0,u)),_=f,f=[_[1],s,0,0])):A.type==="tableHead"?(a=!0,c=s):A.type==="tableRow"||A.type==="tableDelimiterRow"?(c=s,_[1]!==0?(f[0]=f[1],u=Za(b,r,_,d,s,u)):f[1]!==0&&(u=Za(b,r,f,d,s,u)),d=0):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&yg(b,r,c,h,g),b.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=iE(r.events,s))}return n}function Za(n,r,s,o,d,_){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(_.end=Object.assign({},fs(r.events,s[0])),n.add(s[0],0,[["exit",_,r]]));const c=fs(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=fs(r.events,s[2]),g=fs(r.events,s[3]),u={type:a,start:Object.assign({},h),end:Object.assign({},g)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const b=r.events[s[2]],C=r.events[s[3]];if(b[1].end=Object.assign({},C[1].end),b[1].type="chunkText",b[1].contentType="text",s[3]>s[2]+1){const A=s[2]+1,x=s[3]-s[2]-1;n.add(A,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(_.end=Object.assign({},fs(r.events,d)),n.add(d,0,[["exit",_,r]]),_=void 0),_}function yg(n,r,s,o,d){const _=[],f=fs(r.events,s);d&&(d.end=Object.assign({},f),_.push(["exit",d,r])),o.end=Object.assign({},f),_.push(["exit",o,r]),n.add(s+1,0,_)}function fs(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const aE={name:"tasklistCheck",tokenize:cE};function oE(){return{text:{91:aE}}}function cE(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),_)}function _(c){return ut(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),a):s(c)}function a(c){return Le(c)?r(c):$e(c)?n.check({tokenize:uE},r,s)(c):s(c)}}function uE(n,r,s){return Qe(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function hE(n){return Qg([Nx(),$x(),eE(n),rE(),oE()])}const fE={};function F_(n){const r=this,s=n||fE,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),_=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(hE(s)),_.push(Lx()),f.push(Ox(s))}const dE=500,lo=`
89
+ `))}function c(C,A,x,y){const v=x.enter("tableCell"),m=x.enter("phrasing"),S=x.containerPhrasing(C,{...y,before:_,after:_});return m(),v(),S}function h(C,A){return Pw(C,{align:A,alignDelimiters:o,padding:s,stringLength:d})}function g(C,A,x){const y=C.children;let v=-1;const m=[],S=A.enter("table");for(;++v<y.length;)m[v]=u(y[v],A,x);return S(),m}function u(C,A,x){const y=C.children;let v=-1;const m=[],S=A.enter("tableRow");for(;++v<y.length;)m[v]=c(y[v],C,A,x);return S(),m}function b(C,A,x){let y=O_.inlineCode(C,A,x);return x.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Tx(){return{exit:{taskListCheckValueChecked:vg,taskListCheckValueUnchecked:vg,paragraph:Dx}}}function Rx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Mx}}}function vg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function Dx(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const d=r.children;let _=-1,f;for(;++_<d.length;){const a=d[_];if(a.type==="paragraph"){f=a;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function Mx(n,r,s,o){const d=n.children[0],_=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",a=s.createTracker(o);_&&a.move(f);let c=O_.listItem(n,r,s,{...o,...a.current()});return _&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(g){return g+f}}function Lx(){return[uw(),Mw(),jw(),bx(),Tx()]}function Ox(n){return{extensions:[hw(),Lw(n),Nw(),Ax(n),Rx()]}}const Bx={tokenize:Ux,partial:!0},B_={tokenize:Px,partial:!0},j_={tokenize:Fx,partial:!0},N_={tokenize:qx,partial:!0},jx={tokenize:Gx,partial:!0},H_={name:"wwwAutolink",tokenize:zx,previous:I_},z_={name:"protocolAutolink",tokenize:Ix,previous:U_},Si={name:"emailAutolink",tokenize:Hx,previous:P_},Zn={};function Nx(){return{text:Zn}}let wr=48;for(;wr<123;)Zn[wr]=Si,wr++,wr===58?wr=65:wr===91&&(wr=97);Zn[43]=Si;Zn[45]=Si;Zn[46]=Si;Zn[95]=Si;Zn[72]=[Si,z_];Zn[104]=[Si,z_];Zn[87]=[Si,H_];Zn[119]=[Si,H_];function Hx(n,r,s){const o=this;let d,_;return f;function f(u){return!th(u)||!P_.call(o,o.previous)||Eh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),a(u))}function a(u){return th(u)?(n.consume(u),a):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(jx,g,h)(u):u===45||u===95||$t(u)?(_=!0,n.consume(u),c):g(u)}function h(u){return n.consume(u),d=!0,c}function g(u){return _&&d&&en(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function zx(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!I_.call(o,o.previous)||Eh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Bx,n.attempt(B_,n.attempt(j_,_),s),s)(f))}function _(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function Ix(n,r,s){const o=this;let d="",_=!1;return f;function f(u){return(u===72||u===104)&&U_.call(o,o.previous)&&!Eh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),a):s(u)}function a(u){if(en(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),a;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),_?h:(_=!0,c)):s(u)}function h(u){return u===null||no(u)||ot(u)||xr(u)||co(u)?s(u):n.attempt(B_,n.attempt(j_,g),s)(u)}function g(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Ux(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),_):s(f)}function _(f){return f===null?s(f):r(f)}}function Px(n,r,s){let o,d,_;return f;function f(h){return h===46||h===95?n.check(N_,c,a)(h):h===null||ot(h)||xr(h)||h!==45&&co(h)?c(h):(_=!0,n.consume(h),f)}function a(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!_?s(h):r(h)}}function Fx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?_(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(N_,r,_)(f):f===null||ot(f)||xr(f)?r(f):(n.consume(f),d)}function _(f){return f===41&&o++,n.consume(f),d}}function qx(n,r,s){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(n.consume(a),o):a===38?(n.consume(a),_):a===93?(n.consume(a),d):a===60||a===null||ot(a)||xr(a)?r(a):s(a)}function d(a){return a===null||a===40||a===91||ot(a)||xr(a)?r(a):o(a)}function _(a){return en(a)?f(a):s(a)}function f(a){return a===59?(n.consume(a),o):en(a)?(n.consume(a),f):s(a)}}function Gx(n,r,s){return o;function o(_){return n.consume(_),d}function d(_){return $t(_)?s(_):r(_)}}function I_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ot(n)}function U_(n){return!en(n)}function P_(n){return!(n===47||th(n))}function th(n){return n===43||n===45||n===46||n===95||$t(n)}function Eh(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Vx={tokenize:Jx,partial:!0};function $x(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Xx,continuation:{tokenize:Qx},exit:Zx}},text:{91:{name:"gfmFootnoteCall",tokenize:Yx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Wx,resolveTo:Kx}}}}function Wx(n,r,s){const o=this;let d=o.events.length;const _=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!f||!f._balanced)return s(c);const h=Pn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!_.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function Kx(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const _={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},_.start),end:Object.assign({},_.end)},a=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",_,r],["enter",f,r],["exit",f,r],["exit",_,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...a),n}function Yx(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _=0,f;return a;function a(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(_>999||u===93&&!f||u===null||u===91||ot(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes(Pn(o.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ot(u)||(f=!0),_++,n.consume(u),u===92?g:h}function g(u){return u===91||u===92||u===93?(n.consume(u),_++,h):h(u)}}function Xx(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _,f=0,a;return c;function c(A){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(A){return A===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",g):s(A)}function g(A){if(f>999||A===93&&!a||A===null||A===91||ot(A))return s(A);if(A===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return _=Pn(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(A),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ot(A)||(a=!0),f++,n.consume(A),A===92?u:g}function u(A){return A===91||A===92||A===93?(n.consume(A),f++,g):g(A)}function b(A){return A===58?(n.enter("definitionMarker"),n.consume(A),n.exit("definitionMarker"),d.includes(_)||d.push(_),Xe(n,C,"gfmFootnoteDefinitionWhitespace")):s(A)}function C(A){return r(A)}}function Qx(n,r,s){return n.check(Ml,r,n.attempt(Vx,r,s))}function Zx(n){n.exit("gfmFootnoteDefinition")}function Jx(n,r,s){const o=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(_):s(_)}}function e2(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:_,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,a){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const g={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",g,a],["enter",f[h][1],a],["exit",f[h][1],a],["enter",u,a]],C=a.parser.constructs.insideSpan.null;C&&wn(b,b.length,0,uo(C,f.slice(h+1,c),a)),wn(b,b.length,0,[["exit",u,a],["enter",f[c][1],a],["exit",f[c][1],a],["exit",g,a]]),wn(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 _(f,a,c){const h=this.previous,g=this.events;let u=0;return b;function b(A){return h===126&&g[g.length-1][1].type!=="characterEscape"?c(A):(f.enter("strikethroughSequenceTemporary"),C(A))}function C(A){const x=ms(h);if(A===126)return u>1?c(A):(f.consume(A),u++,C);if(u<2&&!s)return c(A);const y=f.exit("strikethroughSequenceTemporary"),v=ms(A);return y._open=!v||v===2&&!!x,y._close=!x||x===2&&!!v,a(A)}}}class t2{constructor(){this.map=[]}add(r,s,o){n2(this,r,s,o)}consume(r){if(this.map.sort(function(_,f){return _[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const _ of d)r.push(_);d=o.pop()}this.map.length=0}}function n2(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function i2(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const _=o.length-1;o[_]=o[_]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function r2(){return{flow:{null:{name:"table",tokenize:s2,resolveAll:l2}}}}function s2(n,r,s){const o=this;let d=0,_=0,f;return a;function a(O){let I=o.events.length-1;for(;I>-1;){const W=o.events[I][1].type;if(W==="lineEnding"||W==="linePrefix")I--;else break}const F=I>-1?o.events[I][1].type:null,U=F==="tableHead"||F==="tableRow"?R:c;return U===R&&o.parser.lazy[o.now().line]?s(O):U(O)}function c(O){return n.enter("tableHead"),n.enter("tableRow"),h(O)}function h(O){return O===124||(f=!0,_+=1),g(O)}function g(O){return O===null?s(O):Le(O)?_>1?(_=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),C):s(O):$e(O)?Xe(n,g,"whitespace")(O):(_+=1,f&&(f=!1,d+=1),O===124?(n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),f=!0,g):(n.enter("data"),u(O)))}function u(O){return O===null||O===124||ot(O)?(n.exit("data"),g(O)):(n.consume(O),O===92?b:u)}function b(O){return O===92||O===124?(n.consume(O),u):u(O)}function C(O){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(O):(n.enter("tableDelimiterRow"),f=!1,$e(O)?Xe(n,A,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):A(O))}function A(O){return O===45||O===58?y(O):O===124?(f=!0,n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),x):M(O)}function x(O){return $e(O)?Xe(n,y,"whitespace")(O):y(O)}function y(O){return O===58?(_+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(O),n.exit("tableDelimiterMarker"),v):O===45?(_+=1,v(O)):O===null||Le(O)?k(O):M(O)}function v(O){return O===45?(n.enter("tableDelimiterFiller"),m(O)):M(O)}function m(O){return O===45?(n.consume(O),m):O===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(O),n.exit("tableDelimiterMarker"),S):(n.exit("tableDelimiterFiller"),S(O))}function S(O){return $e(O)?Xe(n,k,"whitespace")(O):k(O)}function k(O){return O===124?A(O):O===null||Le(O)?!f||d!==_?M(O):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(O)):M(O)}function M(O){return s(O)}function R(O){return n.enter("tableRow"),D(O)}function D(O){return O===124?(n.enter("tableCellDivider"),n.consume(O),n.exit("tableCellDivider"),D):O===null||Le(O)?(n.exit("tableRow"),r(O)):$e(O)?Xe(n,D,"whitespace")(O):(n.enter("data"),E(O))}function E(O){return O===null||O===124||ot(O)?(n.exit("data"),D(O)):(n.consume(O),O===92?L:E)}function L(O){return O===92||O===124?(n.consume(O),E):E(O)}}function l2(n,r){let s=-1,o=!0,d=0,_=[0,0,0,0],f=[0,0,0,0],a=!1,c=0,h,g,u;const b=new t2;for(;++s<n.length;){const C=n[s],A=C[1];C[0]==="enter"?A.type==="tableHead"?(a=!1,c!==0&&(yg(b,r,c,h,g),g=void 0,c=0),h={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},b.add(s,0,[["enter",h,r]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(o=!0,u=void 0,_=[0,0,0,0],f=[0,s+1,0,0],a&&(a=!1,g={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},b.add(s,0,[["enter",g,r]])),d=A.type==="tableDelimiterRow"?2:g?3:1):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(_[1]!==0&&(f[0]=f[1],u=Za(b,r,_,d,void 0,u),_=[0,0,0,0]),f[2]=s)):A.type==="tableCellDivider"&&(o?o=!1:(_[1]!==0&&(f[0]=f[1],u=Za(b,r,_,d,void 0,u)),_=f,f=[_[1],s,0,0])):A.type==="tableHead"?(a=!0,c=s):A.type==="tableRow"||A.type==="tableDelimiterRow"?(c=s,_[1]!==0?(f[0]=f[1],u=Za(b,r,_,d,s,u)):f[1]!==0&&(u=Za(b,r,f,d,s,u)),d=0):d&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&yg(b,r,c,h,g),b.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=i2(r.events,s))}return n}function Za(n,r,s,o,d,_){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(_.end=Object.assign({},fs(r.events,s[0])),n.add(s[0],0,[["exit",_,r]]));const c=fs(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=fs(r.events,s[2]),g=fs(r.events,s[3]),u={type:a,start:Object.assign({},h),end:Object.assign({},g)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const b=r.events[s[2]],C=r.events[s[3]];if(b[1].end=Object.assign({},C[1].end),b[1].type="chunkText",b[1].contentType="text",s[3]>s[2]+1){const A=s[2]+1,x=s[3]-s[2]-1;n.add(A,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(_.end=Object.assign({},fs(r.events,d)),n.add(d,0,[["exit",_,r]]),_=void 0),_}function yg(n,r,s,o,d){const _=[],f=fs(r.events,s);d&&(d.end=Object.assign({},f),_.push(["exit",d,r])),o.end=Object.assign({},f),_.push(["exit",o,r]),n.add(s+1,0,_)}function fs(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const a2={name:"tasklistCheck",tokenize:c2};function o2(){return{text:{91:a2}}}function c2(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),_)}function _(c){return ot(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),a):s(c)}function a(c){return Le(c)?r(c):$e(c)?n.check({tokenize:u2},r,s)(c):s(c)}}function u2(n,r,s){return Xe(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function h2(n){return Qg([Nx(),$x(),e2(n),r2(),o2()])}const f2={};function F_(n){const r=this,s=n||f2,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),_=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(h2(s)),_.push(Lx()),f.push(Ox(s))}const d2=500,lo=`
90
90
 
91
91
  --- Translation ---
92
- `;function pE({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:o,role:d,sessionId:_}){const[f,a]=ne.useState([]),[c,h]=ne.useState([]),[g,u]=ne.useState(""),[b,C]=ne.useState(!1),[A,x]=ne.useState("ready"),[y,v]=ne.useState(""),[m,S]=ne.useState(Date.now()),[k,M]=ne.useState(!1),[R,D]=ne.useState(""),[E,L]=ne.useState(0),O=ne.useRef(n),I=ne.useRef(1),F=ne.useRef(null);ne.useEffect(()=>{O.current=n},[n]),ne.useEffect(()=>{a([]),h([]),D(""),x("ready"),v(""),I.current=1;let N=!1,Z;const ue=()=>{N||(Z=window.setTimeout(ve,O.current?200:1e3))},ve=async()=>{if(!N)try{const X=await Se.pollTranslationSession(_,I.current);if(N)return;Y(X.events),I.current=X.nextCursor,x(X.status),O.current&&v(RE(new Date().toISOString()))}catch(X){N||D(X instanceof Error?X.message:"Translation poll failed.")}finally{ue()}};return Se.startTranslationSession(o,d).then(X=>{N||(x(X.status),I.current=X.nextCursor,ve())}).catch(X=>{N||D(X instanceof Error?X.message:"Translation start failed.")}),()=>{N=!0,Z!==void 0&&window.clearTimeout(Z),Se.stopTranslationSession(_).catch(()=>{})}},[_,o,d]),ne.useEffect(()=>{if(!n)return;const N=F.current;if(!N)return;const Z=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(Z)},[n,E]);const U=bE(f);ne.useEffect(()=>{if(!U)return;S(Date.now());const N=window.setInterval(()=>S(Date.now()),250);return()=>window.clearInterval(N)},[U]);async function W(N=!1){const Z=g;M(!0),D(""),C(!1);try{const ue=await Se.translateUserInput(o,d,{text:Z,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});ue.sent?(u(""),C(!1)):(u(q_(Z,ue.englishPreview)),C(!0))}catch(ue){D(ue instanceof Error?ue.message:"Translation failed.")}finally{M(!1)}}function Y(N){if(N.length===0)return;for(const ue of N)ue.type==="status"?x(ue.status):ue.type==="error"?D(ue.message):ue.type==="failures"&&h(ue.failures);const Z=N.filter(ue=>ue.type==="entry");Z.length>0&&(a(ue=>{const ve=Z.reduce((q,fe)=>AE(q,fe.entry),ue),X=wE(ve);return X.removedIds.size>0&&h(q=>q.filter(fe=>!X.removedIds.has(fe.translationId))),X.entries}),L(ue=>ue+1))}async function V(){const N=b?bg(g):g;if(N.trim()){M(!0),D("");try{await Se.sendTranslatedInput(o,d,{englishText:N}),u(""),C(!1)}catch(Z){D(Z instanceof Error?Z.message:"Failed to send English input.")}finally{M(!1)}}}function K(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!k&&g.trim()&&(b?V():W(r)))}async function J(){a([]),h([]),I.current=1,await Se.clearTranslationSession(_).catch(N=>D(N.message))}async function z(){M(!0),D("");try{const N=await Se.ignoreTranslationFailures(_);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to ignore translation failures.")}finally{M(!1)}}async function j(){M(!0),D("");try{const N=await Se.retryTranslationFailures(_);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to retry translation failures.")}finally{M(!1)}}const H=CE(f,A,m),G=c.length;return T.jsxs("aside",{className:"translation-panel",children:[T.jsxs("header",{className:"translation-panel-header",children:[T.jsxs("div",{className:"translation-panel-titlebar",children:[T.jsx("h2",{children:"Translation"}),T.jsxs("div",{className:"translation-panel-actions",children:[G>0?T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",disabled:k,onClick:()=>void z(),children:["Ignore ",G]}),T.jsxs("button",{type:"button",disabled:k,onClick:()=>void j(),children:["Retry ",G]})]}):null,T.jsx("button",{type:"button",onClick:()=>void J(),children:"Clear"})]})]}),T.jsxs("div",{className:"translation-status-row",children:[T.jsxs("p",{children:["Claude Code · target ",mE(s)," · ",H]}),T.jsx("p",{children:y?`poll ${y}`:"poll -"})]})]}),R?T.jsx("div",{className:"error-banner",children:R}):null,T.jsxs("div",{className:"translation-entry-list",ref:F,children:[f.length===0?T.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(N=>T.jsx(yE,{entry:N},N.id))]}),T.jsx("div",{className:"translation-composer",children:T.jsxs("div",{className:"translation-composer-row",children:[T.jsx("textarea",{value:g,onChange:N=>{u(N.target.value),(!N.target.value.trim()||b&&!kE(N.target.value))&&C(!1)},onKeyDown:K,placeholder:"输入中文,先翻译成英文工程指令..."}),T.jsx("div",{className:"translation-composer-actions",children:T.jsx("button",{type:"button",disabled:k||!b||!bg(g).trim(),onClick:()=>void V(),children:"Send English"})})]})})]})}function mE(n){var r;return((r=Og.find(s=>s.value===n))==null?void 0:r.label)??n}function gE({open:n,taskSlug:r,targetLanguage:s,onClose:o}){const[d,_]=ne.useState(!1),[f,a]=ne.useState(""),[c,h]=ne.useState(null),[g,u]=ne.useState(""),[b,C]=ne.useState(""),[A,x]=ne.useState(""),[y,v]=ne.useState(!1),[m,S]=ne.useState(null),[k,M]=ne.useState(""),[R,D]=ne.useState(""),[E,L]=ne.useState(""),[O,I]=ne.useState(!1);ne.useEffect(()=>{if(!n)return;let K=!1,J;const z=async()=>{K||(await F(!0),K||(J=window.setTimeout(z,2e3)))};return z(),()=>{K=!0,J!==void 0&&window.clearTimeout(J)}},[n,g]);async function F(K=!1){try{const J=await Se.getTranslationState();h(J);const z=g?J.fileIndex.jobs.some(j=>j.id===g):!1;if((!g||!z)&&J.fileIndex.jobs[0])U(J.fileIndex.jobs[0].id);else if(!J.fileIndex.jobs[0])u(""),C(""),x("");else if(K&&g){const j=await Se.readFileTranslation(g);C(j.output),x(j.report)}}catch(J){a(J instanceof Error?J.message:"Failed to load file translations.")}}async function U(K){u(K),C(""),x("");try{const J=await Se.readFileTranslation(K);C(J.output),x(J.report)}catch(J){a(J instanceof Error?J.message:"Failed to read translated file.")}}async function W(){v(!0),await Y(k,R)}async function Y(K="",J=""){I(!0),a("");try{const z=await Se.browseTranslationSourceFiles({path:K,query:J,limit:250});S(z),M(z.currentPath),D(J)}catch(z){a(z instanceof Error?z.message:"Failed to browse source files.")}finally{I(!1)}}async function V(K=E){const J=K.trim();if(J){_(!0),a("");try{if(!r)throw new Error("Create or select a task before translating files.");const z=await Se.createFileTranslation({taskSlug:r,sourcePath:J,targetLanguage:s});v(!1),await F(),await U(z.id)}catch(z){a(z instanceof Error?z.message:"Failed to create file translation.")}finally{_(!1)}}}return n?T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:T.jsx(vE,{busy:d,error:f,state:c,selectedJobId:g,output:b,report:A,onClose:()=>{v(!1),o()},onRefresh:()=>void F(),onSelectJob:K=>void U(K),onTranslate:()=>void W()})}),y?T.jsx(_E,{busy:d||O,state:m,currentPath:k,query:R,selectedPath:E,onBrowse:(K,J)=>void Y(K,J),onClose:()=>v(!1),onQueryChange:D,onSelectPath:L,onTranslate:()=>void V()}):null]}):null}function _E({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:_,onClose:f,onQueryChange:a,onSelectPath:c,onTranslate:h}){const g=(r==null?void 0:r.entries)??[],u=g.filter(C=>C.type==="directory"),b=g.filter(C=>C.type==="file");return T.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:T.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Select Source File"}),T.jsx("p",{children:s||"."})]}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]}),T.jsxs("div",{className:"translation-file-browser-controls",children:[T.jsxs("div",{className:"translation-file-browser-nav",children:[T.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_((r==null?void 0:r.parentPath)??"",""),children:"Up"}),T.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_("",""),children:"Root"})]}),T.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),_(s,o)},children:[T.jsx("input",{value:o,onChange:C=>a(C.target.value),placeholder:"Search files"}),T.jsx("button",{type:"submit",disabled:n,children:"Search"}),T.jsx("button",{type:"button",disabled:n||!o,onClick:()=>_(s,""),children:"Clear"})]})]}),T.jsxs("div",{className:"translation-file-browser-layout",children:[T.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?T.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&g.length===0?T.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?T.jsxs("div",{className:"translation-file-browser-group",children:[T.jsx("h3",{children:"Folders"}),u.map(C=>T.jsx(Sg,{entry:C,selected:d===C.path,onBrowse:_,onSelectPath:c},C.path))]}):null,b.length>0?T.jsxs("div",{className:"translation-file-browser-group",children:[T.jsx("h3",{children:"Files"}),b.map(C=>T.jsx(Sg,{entry:C,selected:d===C.path,onBrowse:_,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?T.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),T.jsxs("aside",{className:"translation-file-browser-selection",children:[T.jsxs("label",{children:[T.jsx("span",{children:"Source path"}),T.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),T.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Sg({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return T.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[T.jsx("span",{children:d?"DIR":"FILE"}),T.jsx("strong",{children:n.name}),T.jsx("small",{children:n.path})]})}function vE({busy:n,error:r,state:s,selectedJobId:o,output:d,report:_,onClose:f,onRefresh:a,onSelectJob:c,onTranslate:h}){const g=(s==null?void 0:s.fileIndex.jobs)??[],u=g.find(b=>b.id===o);return T.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[T.jsxs("header",{className:"file-translation-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"File Translation"}),T.jsx("p",{children:"Claude Code · 中英互译"})]}),T.jsxs("div",{className:"file-translation-toolbar",children:[T.jsx("button",{type:"button",disabled:n,onClick:h,children:"Translate"}),T.jsx("button",{type:"button",disabled:n,onClick:a,children:"Refresh"}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]})]}),r?T.jsx("div",{className:"error-banner",children:r}):null,s!=null&&s.memoryInitialized?null:T.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),T.jsxs("div",{className:"file-translation-layout",children:[T.jsxs("div",{className:"file-translation-list",children:[g.length===0?T.jsx("p",{className:"muted",children:"No translated files yet."}):null,g.map(b=>T.jsxs("button",{className:b.id===o?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>c(b.id),children:[T.jsx("strong",{children:b.sourcePath}),T.jsxs("span",{children:[b.status," · ",b.targetLanguage]})]},b.id))]}),T.jsx("div",{className:"file-translation-preview",children:u?T.jsxs(T.Fragment,{children:[T.jsxs("header",{children:[T.jsx("strong",{children:u.sourcePath}),T.jsx("span",{children:u.status})]}),T.jsx("div",{className:"translation-markdown",children:T.jsx(v_,{remarkPlugins:[F_],children:d||_||"Translation output is not available yet."})})]}):T.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function yE({entry:n}){if(n.sourceKind==="conversation-boundary")return T.jsx(SE,{entry:n});const r=EE(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return T.jsxs("article",{className:d,children:[s?T.jsx("pre",{children:r}):T.jsx("div",{className:"translation-markdown",children:T.jsx(v_,{remarkPlugins:[F_],children:r})}),n.warning?T.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?T.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function SE({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=DE(n.occurredAt??n.createdAt);return T.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[T.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),T.jsx("span",{children:r}),T.jsxs("span",{children:["第 ",s," 轮"]}),T.jsx("time",{children:o}),T.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function bE(n){const r=n.find(kh);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function CE(n,r,s){const o=n.find(kh);if(o)return`translating ${TE(Math.max(0,s-xE(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function kh(n){return n.status==="queued"||n.status==="translating"}function wE(n){const r=n.length-dE;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;kh(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function xE(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function EE(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?q_(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function q_(n,r){return`${n.trimEnd()}${lo}${r.trimStart()}`}function kE(n){return n.includes(lo)}function bg(n){const r=n.indexOf(lo);return r===-1?n:n.slice(r+lo.length)}function AE(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function TE(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function RE(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function DE(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function ME(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function LE(n,r){const s=ps.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));if(r.gateReviewerEnabled){const o=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:o.permissionMode,model:o.model,effort:o.effort})}return s}const OE=["architecture-plan","validation-adequacy","final-diff"];function BE({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return T.jsxs("section",{className:"event-log",children:[s?T.jsx("h2",{children:"Events"}):null,n.length===0?T.jsx("p",{className:"muted",children:"No terminal events yet."}):T.jsx("ol",{children:o.map((d,_)=>T.jsx("li",{children:d},`${d}-${_}`))})]})}function jE({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:o=!1,busy:d=!1,onRefresh:_,onApply:f,onOpenStudio:a,onOpenRepositoryDiff:c,onStartBootstrap:h,onRestartBootstrap:g,onStopBootstrap:u,onRunBootstrap:b}){const[C,A]=ne.useState(!1),[x,y]=ne.useState("default"),[v,m]=ne.useState("default"),[S,k]=ne.useState("default"),M=r==null?void 0:r.session,R=(r==null?void 0:r.status)==="running",D=(M==null?void 0:M.status)==="running",E=(r==null?void 0:r.status)!=="complete";ne.useEffect(()=>{M!=null&&M.permissionMode&&y(M.permissionMode),M!=null&&M.model&&m(M.model),M!=null&&M.effort&&k(M.effort)},[M]);const L={permissionMode:x,model:v,effort:S};return o?n?T.jsxs("section",{className:"harness-panel",children:[T.jsxs("div",{className:"harness-stage",children:[T.jsxs("div",{className:"harness-panel-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Fixed install"}),T.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),T.jsx("div",{className:"harness-actions",children:n.initialized?T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:d,onClick:()=>void _(),children:"Refresh"}),n.needsApply?T.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Update"}):null]}):T.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Initialize"})})]}),n.initialized&&n.needsApply?T.jsxs(T.Fragment,{children:[T.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),T.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(O=>T.jsxs("li",{children:[T.jsx("span",{children:O.path}),T.jsx(yi,{status:O.action})]},`${O.path}:${O.action}`))})]}):null]}),T.jsx("div",{className:"harness-stage",children:T.jsxs("div",{className:"harness-panel-header",children:[T.jsx("div",{children:T.jsx("strong",{children:"Harness Studio"})}),T.jsxs("div",{className:"harness-actions",children:[T.jsx("button",{type:"button",disabled:d,onClick:c,children:"Review Diff"}),T.jsx("button",{type:"button",disabled:d,onClick:a,children:"Open Studio"})]})]})}),E?T.jsx("div",{className:"harness-stage",children:T.jsxs("div",{className:"harness-panel-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Bootstrap"}),T.jsx("p",{className:"muted",children:r?NE(r.status):"not loaded"})]}),T.jsx("div",{className:"harness-actions",children:T.jsx("button",{type:"button",disabled:d||!(r!=null&&r.canStart),onClick:()=>{A(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?T.jsx("div",{className:"harness-result",children:T.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?T.jsx("ul",{className:"warnings",children:n.warnings.map(O=>T.jsx("li",{children:O},O))}):null,r!=null&&r.warnings.length?T.jsx("ul",{className:"warnings",children:r.warnings.map(O=>T.jsx("li",{children:O},O))}):null,E&&C?T.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:T.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[T.jsxs("header",{className:"harness-bootstrap-modal-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Harness Engineer Bootstrap"}),T.jsx("p",{className:"muted",children:(M==null?void 0:M.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),T.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[M?T.jsx(yi,{status:M.status}):null,T.jsx("button",{type:"button",onClick:()=>A(!1),children:"Close"})]})]}),T.jsxs("div",{className:"harness-bootstrap-controls",children:[T.jsxs("label",{children:[T.jsx("span",{children:"Permission"}),T.jsxs("select",{value:x,disabled:d||R||D,onChange:O=>y(O.target.value),children:[T.jsx("option",{value:"default",children:"默认"}),T.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),T.jsxs("label",{children:[T.jsx("span",{children:"Model"}),T.jsx("select",{value:v,disabled:d||R||D,onChange:O=>m(O.target.value),children:jg.map(O=>T.jsx("option",{value:O.value,children:O.label},O.value))})]}),T.jsxs("label",{children:[T.jsx("span",{children:"Effort"}),T.jsx("select",{value:S,disabled:d||R||D,onChange:O=>k(O.target.value),children:Ng.map(O=>T.jsx("option",{value:O.value,children:O.label},O.value))})]}),T.jsxs("div",{className:"harness-bootstrap-control-actions",children:[T.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void h(L),children:"Start"}),T.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void g(L),children:"Restart"}),T.jsx("button",{type:"button",disabled:d||!M,onClick:()=>void u(),children:"Stop"}),T.jsx("button",{type:"button",disabled:d||R||!D,onClick:()=>void b(),children:"Run bootstrap"})]})]}),T.jsx("div",{className:"harness-bootstrap-terminal",children:D?T.jsx(oo,{sessionId:M.id,active:C}):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"Harness Bootstrap"}),T.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:T.jsx("section",{className:"harness-panel",children:T.jsxs("div",{className:"harness-result",children:[T.jsx("strong",{children:"Task required"}),T.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function NE(n){return n.replaceAll("_"," ")}function Ah(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function HE(n,r=6){const s=[...n].sort(UE).map((d,_)=>({message:d,sequence:_+1}));return[...r===null?s:s.slice(-r)].sort((d,_)=>_.sequence-d.sequence)}function zE({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:_=!0,onModeChange:f,onMarkAllDone:a}){const[c,h]=ne.useState(null),g=Ah(n),u=(r==null?void 0:r.mode)??"auto",b=HE(n,o);async function C(A){await PE(A.body),h(A.id),window.setTimeout(()=>h(x=>x===A.id?null:x),1200)}return T.jsxs("section",{className:"message-panel",children:[_?T.jsxs("div",{className:"message-panel-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Messages"}),T.jsxs("p",{className:"muted",children:[g.total," total / ",g.accepted," accepted"]})]}),d&&f?T.jsx("div",{className:"message-controls",children:T.jsxs("label",{className:"message-mode-toggle",children:[T.jsx("input",{type:"checkbox",checked:u==="auto",disabled:s,onChange:A=>f(A.target.checked?"auto":"manual")}),T.jsx("span",{children:"Auto orchestration"})]})}):null,d&&a?T.jsx("button",{type:"button",disabled:s,onClick:a,children:"Mark All Done"}):null]}):null,n.length===0?T.jsx("p",{className:"muted",children:"No role messages yet."}):T.jsx("ol",{className:"message-list",children:b.map(({message:A,sequence:x})=>T.jsxs("li",{className:"message-item",children:[T.jsxs("div",{className:"message-item-main",children:[T.jsxs("div",{className:"message-meta",children:[T.jsxs("span",{className:"message-sequence",children:["#",x]}),T.jsx("time",{dateTime:ao(A),children:IE(ao(A))}),T.jsxs("strong",{children:[A.fromRole," ","->"," ",A.toRole]}),T.jsx("span",{children:A.type})]}),T.jsx("p",{children:A.body}),A.failureReason?T.jsx("span",{className:"message-reason",children:A.failureReason}):null,A.bodyPath?T.jsx("span",{className:"message-path",children:A.bodyPath}):null]}),T.jsx("div",{className:"message-actions",children:T.jsx("button",{type:"button",disabled:s,onClick:()=>void C(A),children:c===A.id?"Copied":"Copy"})})]},A.id))})]})}function IE(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 ao(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function UE(n,r){const s=ao(n).localeCompare(ao(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function PE(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 FE({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,_]=ne.useState(n);ne.useEffect(()=>{n&&_(n)},[n]);async function f(a){a.preventDefault(),await o(d)}return T.jsx("form",{className:"repo-connect",onSubmit:f,children:T.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[T.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:a=>_(a.target.value),placeholder:"/path/to/repo"}),r.length>0?T.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:a=>{a.target.value&&_(a.target.value)},children:[T.jsx("option",{value:"",children:"Recent"}),r.map(a=>T.jsx("option",{value:a,children:a},a))]}):null,T.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function qE({tasks:n,activeTaskSlug:r,onSelect:s}){return T.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>T.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[T.jsx("span",{children:o.title||o.taskSlug}),T.jsx(yi,{status:o.status})]},o.taskSlug))})}function GE({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:_,events:f,roundState:a,gateReview:c,translationEnabled:h,translationAutoSendEnabled:g,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:C,translatorSession:A,harnessStatus:x,harnessBootstrapStatus:y,harnessApplyResult:v,gatewayStatus:m,gatewayQrLogin:S,gatewayQrCheck:k,busy:M,onConnect:R,onRefreshConnectedRepository:D,onPullConnectedRepository:E,onRefreshHarness:L,onApplyHarness:O,onStartHarnessBootstrap:I,onRestartHarnessBootstrap:F,onStopHarnessBootstrap:U,onRunHarnessBootstrap:W,onOpenHarnessStudio:Y,onOpenRepositoryDiff:V,onRefreshGateway:K,onGatewayEnabledChange:J,onGatewayTranslationChange:z,onStartGatewayQrLogin:j,onResetGatewayBinding:H,onGateReviewGateEnabledChange:G,onTranslationEnabledChange:N,onTranslationAutoSendChange:Z,onTranslationTargetLanguageChange:ue,onTranslationOutputModeChange:ve,onOpenFileTranslation:X,onOpenTranslatorSession:q,onCreateTranslationBootstrap:fe,onUpdateTranslationMemory:ce,onCreateTask:de,onSelectTask:re,themeMode:Ce,onThemeModeChange:Ee,flowPauseAlerts:xe,onFlowPauseAlertsChange:dt,permissionRequestMode:Re,onPermissionRequestModeChange:en,launchTemplate:qt,canSaveLaunchTemplate:Kt,canOneClickStart:tn,onSaveLaunchTemplate:wn,onOneClickStart:wt,onTryFlowPauseAlert:pt,onMarkAllMessagesDone:At,onDeleteMessageHistory:se}){const[ye,ke]=ne.useState(""),[Be,je]=ne.useState(!1),[mt,Ue]=ne.useState(!1),[et,Me]=ne.useState(()=>o?null:"repository-path"),ht=Ah(d),qe=ye.trim(),nn=KE(n,o,x),Tt=s.find(ze=>ze.taskSlug===o)??null;ne.useEffect(()=>{Me(ze=>o&&ze==="repository-path"?null:!o&&ze===null?"repository-path":ze)},[o]);function Yt(ze,qn){Me(qn?ze:null)}async function On(ze){ze.preventDefault(),await de({taskSlug:qe}),ke("")}return T.jsxs("div",{className:"project-dashboard",children:[T.jsx("header",{className:"brand-header",children:T.jsx("strong",{children:"VibeCodingMaster"})}),T.jsx(vi,{title:"Repository Path",open:et==="repository-path",onOpenChange:ze=>Yt("repository-path",ze),children:T.jsx(FE,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:M,onConnect:R})}),n?T.jsx(vi,{title:"Connected Repository",open:et==="connected-repository",onOpenChange:ze=>{Yt("connected-repository",ze),ze&&D()},children:T.jsx(ZE,{busy:M,project:n,onPull:E})}):null,T.jsx(vi,{title:"Settings",open:et==="settings",onOpenChange:ze=>Yt("settings",ze),children:T.jsxs("div",{className:"sidebar-settings",children:[T.jsxs("button",{"aria-label":`Theme mode: ${wg(Ce)}`,className:"settings-toggle theme-mode-toggle",disabled:M,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Ee(i2(Ce)),children:[T.jsx("span",{children:"Theme"}),T.jsx("span",{children:wg(Ce)})]}),T.jsxs("button",{"aria-pressed":!(m!=null&&m.enabled)&&xe,className:!(m!=null&&m.enabled)&&xe?"settings-toggle is-active":"settings-toggle",disabled:M||(m==null?void 0:m.enabled),title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:()=>dt(!xe),children:[T.jsx("span",{children:"Flow pause alert"}),T.jsx("span",{children:m!=null&&m.enabled?"off":xe?"on":"off"})]}),T.jsxs("button",{className:"settings-toggle",disabled:M||(m==null?void 0:m.enabled),title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:pt,children:[T.jsx("span",{children:"Try alert"}),T.jsx("span",{children:"test"})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Permission requests"}),T.jsxs("select",{value:Re,disabled:M,onChange:ze=>en(ze.target.value),children:[T.jsx("option",{value:"off",children:"off"}),T.jsx("option",{value:"allowAll",children:"allow all"})]})]}),T.jsxs("button",{className:"settings-toggle",disabled:M||!Kt,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:wn,children:[T.jsx("span",{children:"Save launch template"}),T.jsx("span",{children:Kt?"ready":"needs core sessions"})]}),tn?T.jsxs("button",{className:"settings-toggle is-active",disabled:M,title:VE(qt),type:"button",onClick:wt,children:[T.jsx("span",{children:"One-click start"}),T.jsx("span",{children:G_(qt)})]}):null,o?T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",onClick:()=>je(!0),children:[T.jsx("span",{children:"Messages"}),T.jsxs("span",{className:"muted",children:[ht.total," total"]})]}),T.jsxs("button",{type:"button",onClick:()=>Ue(!0),children:[T.jsx("span",{children:"Events"}),T.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),T.jsx(vi,{title:"Translation",open:et==="translation",onOpenChange:ze=>Yt("translation",ze),children:T.jsx($E,{busy:M,enabled:h,autoSendEnabled:g,targetLanguage:u,outputMode:b,memoryInitialized:C,baseUnavailableReason:nn,translatorSession:A,onAutoSendChange:Z,onCreateBootstrap:fe,onEnabledChange:N,onUpdateMemory:ce,onTargetLanguageChange:ue,onOutputModeChange:ve,onOpenFileTranslation:X,onOpenTranslatorSession:q})}),n&&o?T.jsx(vi,{title:"Gate Review Gates",open:et==="gate-review-gates",onOpenChange:ze=>Yt("gate-review-gates",ze),children:T.jsx(YE,{busy:M,state:c,onGateEnabledChange:G})}):null,T.jsx(vi,{title:"Gateway",open:et==="gateway",onOpenChange:ze=>{Yt("gateway",ze),ze&&K()},children:T.jsx(QE,{busy:M,qrCheck:k,qrLogin:S,status:m,onEnabledChange:J,onResetBinding:H,onStartQrLogin:j,onTranslationChange:z})}),n?T.jsx(vi,{title:"VCM Harness",open:et==="vcm-harness",onOpenChange:ze=>Yt("vcm-harness",ze),children:T.jsx(jE,{status:x,bootstrapStatus:y,applyResult:v,hasActiveTask:!!Tt,busy:M,onRefresh:L,onApply:O,onOpenStudio:Y,onOpenRepositoryDiff:V,onStartBootstrap:I,onRestartBootstrap:F,onStopBootstrap:U,onRunBootstrap:W})}):null,n?T.jsx(vi,{title:"New Task",open:et==="new-task",onOpenChange:ze=>Yt("new-task",ze),children:T.jsx("div",{className:"task-create",children:T.jsxs("form",{onSubmit:On,children:[T.jsx("input",{value:ye,onChange:ze=>ke(ze.target.value),placeholder:"task name"}),T.jsxs("div",{className:"task-create-preview",children:[T.jsxs("small",{children:["branch: ",qe?`feature/${qe}`:"feature/<task>"]}),T.jsxs("small",{children:["worktree: ",qe?`.claude/worktrees/${qe}`:".claude/worktrees/<task>"]})]}),T.jsx("button",{type:"submit",disabled:M||!qe,children:"Create"})]})})}):null,s.length>0?T.jsx(vi,{title:"Tasks",open:et==="tasks",onOpenChange:ze=>Yt("tasks",ze),children:T.jsx(qE,{tasks:s,activeTaskSlug:o,onSelect:re})}):null,n&&Tt?T.jsx(t2,{task:Tt,roundState:a}):null,Be?T.jsx(s2,{busy:M,messages:d,orchestration:_,onClose:()=>je(!1),onMarkAllDone:()=>{o&&At(o)},onDeleteMessageHistory:()=>{o&&se(o)}}):null,mt?T.jsx(r2,{events:f,onClose:()=>Ue(!1)}):null]})}function G_(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function VE(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${G_(n)}; ${r}`}function $E({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:o,memoryInitialized:d,outputMode:_,targetLanguage:f,translatorSession:a,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:g,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:C,onOpenFileTranslation:A,onOpenTranslatorSession:x}){const y=!!(s||r),v=(a==null?void 0:a.status)==="running",m=!!(o&&!r&&v),S=r??(v?null:"Start Translator session first."),k=!!(s||S),R=r??"Open Translator session",D=S??"Translation tools are ready";return T.jsxs("div",{className:"sidebar-settings",children:[T.jsxs("button",{"aria-pressed":m,className:m?"settings-toggle is-active":"settings-toggle",disabled:y||!v,title:D,type:"button",onClick:()=>g(!m),children:[T.jsx("span",{children:"Conversation translation"}),T.jsx("span",{children:m?"on":"off"})]}),T.jsxs("button",{"aria-pressed":n,className:n?"settings-toggle is-active":"settings-toggle",disabled:y,type:"button",onClick:()=>c(!n),children:[T.jsx("span",{children:"Auto-send"}),T.jsx("span",{children:n?"on":"off"})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Language"}),T.jsx("select",{value:f,disabled:y,onChange:E=>C(E.target.value),children:Og.map(E=>T.jsx("option",{value:E.value,children:E.label},E.value))})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Reply scope"}),T.jsx("select",{value:_,disabled:y,onChange:E=>b(E.target.value),children:x1.map(E=>T.jsx("option",{value:E.value,children:E.label},E.value))})]}),T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:A,children:[T.jsx("span",{children:"File translation"}),T.jsx("span",{children:"open"})]}),d?null:T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:h,children:[T.jsx("span",{children:"Bootstrap"}),T.jsx("span",{children:"run"})]}),T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:u,children:[T.jsx("span",{children:"Update memory"}),T.jsx("span",{children:"run"})]}),S?T.jsx("p",{className:"settings-help-text",children:S}):null,T.jsxs("div",{className:"settings-status-row",children:[T.jsx("span",{children:"Session status"}),T.jsx("strong",{children:WE(a)})]}),T.jsxs("button",{className:"settings-toggle",disabled:y,title:R,type:"button",onClick:x,children:[T.jsx("span",{children:"Open Session"}),T.jsx("span",{children:"open"})]})]})}function WE(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function KE(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 YE({busy:n,onGateEnabledChange:r,state:s}){return T.jsx("div",{className:"sidebar-settings",children:OE.map(o=>{const d=s==null?void 0:s.gates[o],_=!!(d!=null&&d.required);return T.jsxs("button",{"aria-pressed":_,className:_?"settings-toggle is-active":"settings-toggle",disabled:n||!s,title:d!=null&&d.status?`status: ${d.status}`:void 0,type:"button",onClick:()=>r(o,!_),children:[T.jsx("span",{children:XE(o)}),T.jsx("span",{children:_?"on":"off"})]},o)})})}function XE(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function QE({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:_,qrLogin:f,status:a}){const c=!!(a!=null&&a.binding.tokenConfigured),h=!!(a!=null&&a.binding.tokenConfigured);return T.jsxs("div",{className:"gateway-panel",children:[T.jsxs("div",{className:"gateway-actions",children:[T.jsxs("button",{"aria-pressed":!!(a!=null&&a.enabled),className:a!=null&&a.enabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a||!a.enabled&&!c,title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",type:"button",onClick:()=>a?r(!a.enabled):void 0,children:[T.jsx("span",{children:"Gateway"}),T.jsx("span",{children:a!=null&&a.enabled?"on":"off"})]}),T.jsxs("button",{"aria-pressed":!!(a!=null&&a.translationEnabled),className:a!=null&&a.translationEnabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a,type:"button",onClick:()=>a?d(!a.translationEnabled):void 0,children:[T.jsx("span",{children:"Translation"}),T.jsx("span",{children:a!=null&&a.translationEnabled?"on":"off"})]}),h?T.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):T.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?T.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,_?T.jsxs("p",{className:"muted",children:["QR status: ",_.status,_.message?` · ${_.message}`:""]}):null]})}function ZE({busy:n,onPull:r,project:s}){const o=s.pullDisabledReason,d=!!s.canPull;return T.jsxs("div",{className:"project-summary",children:[T.jsxs("dl",{children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Base path"}),T.jsx("dd",{children:s.repoRoot})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Branch"}),T.jsx("dd",{children:JE(s)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Remote"}),T.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Status"}),T.jsx("dd",{children:e2(s)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Commit"}),T.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Working tree"}),T.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),T.jsxs("div",{className:"connected-repo-actions",children:[T.jsx("button",{type:"button",disabled:n||!d,title:o??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),T.jsx("span",{className:"muted",children:s.checkedAt?`checked ${nh(s.checkedAt)}`:"status not refreshed"})]}),o?T.jsx("p",{className:"muted",children:o}):null,s.warnings.length>0?T.jsx("ul",{className:"warnings",children:s.warnings.map(_=>T.jsx("li",{children:_},_))}):null]})}function JE(n){return n.branch||"unknown"}function e2(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 t2({roundState:n,task:r}){var g;const[s,o]=ne.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),_=V_(r.createdAt,s),f=Cg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),a=d&&n?Cg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?n2(n,s):0,h=((g=r.title)==null?void 0:g.trim())||r.taskSlug;return ne.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),T.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[T.jsxs("div",{className:"task-status-dock-title",children:[T.jsx("strong",{title:h,children:h}),T.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),T.jsxs("dl",{className:"task-status-stats",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Session start"}),T.jsx("dd",{children:nh(r.createdAt)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Session total"}),T.jsx("dd",{children:Ja(_)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Rounds"}),T.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Role runtime"}),T.jsx("dd",{children:Ja(f)})]})]}),d&&n?T.jsxs("div",{className:"current-round-status",children:[T.jsxs("div",{className:"current-round-title",children:[T.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),T.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),T.jsxs("dl",{className:"task-status-stats",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Started"}),T.jsx("dd",{children:nh(n.startedAt)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Total"}),T.jsx("dd",{children:Ja(c)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Role runtime"}),T.jsx("dd",{children:Ja(a)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Turn count"}),T.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Cg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function n2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return V_(n.startedAt??"",Number.isFinite(s)?s:r)}function V_(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function nh(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 Ja(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function i2(n){return n==="system"?"light":n==="light"?"dark":"system"}function wg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function r2({events:n,onClose:r}){return T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Events"}),T.jsxs("p",{className:"muted",children:[n.length," total"]})]}),T.jsx("button",{type:"button",onClick:r,children:"Close"})]}),T.jsx(BE,{events:n,maxEvents:null,showHeader:!1})]})})}function s2({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:_}){const f=Ah(r);function a(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
92
+ `;function p2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:o,role:d,sessionId:_}){const[f,a]=ie.useState([]),[c,h]=ie.useState([]),[g,u]=ie.useState(""),[b,C]=ie.useState(!1),[A,x]=ie.useState("ready"),[y,v]=ie.useState(""),[m,S]=ie.useState(Date.now()),[k,M]=ie.useState(!1),[R,D]=ie.useState(""),[E,L]=ie.useState(0),O=ie.useRef(n),I=ie.useRef(1),F=ie.useRef(null);ie.useEffect(()=>{O.current=n},[n]),ie.useEffect(()=>{a([]),h([]),D(""),x("ready"),v(""),I.current=1;let N=!1,Z;const ue=()=>{N||(Z=window.setTimeout(ve,O.current?200:1e3))},ve=async()=>{if(!N)try{const X=await Se.pollTranslationSession(_,I.current);if(N)return;Y(X.events),I.current=X.nextCursor,x(X.status),O.current&&v(R2(new Date().toISOString()))}catch(X){N||D(X instanceof Error?X.message:"Translation poll failed.")}finally{ue()}};return Se.startTranslationSession(o,d).then(X=>{N||(x(X.status),I.current=X.nextCursor,ve())}).catch(X=>{N||D(X instanceof Error?X.message:"Translation start failed.")}),()=>{N=!0,Z!==void 0&&window.clearTimeout(Z),Se.stopTranslationSession(_).catch(()=>{})}},[_,o,d]),ie.useEffect(()=>{if(!n)return;const N=F.current;if(!N)return;const Z=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(Z)},[n,E]);const U=b2(f);ie.useEffect(()=>{if(!U)return;S(Date.now());const N=window.setInterval(()=>S(Date.now()),250);return()=>window.clearInterval(N)},[U]);async function W(N=!1){const Z=g;M(!0),D(""),C(!1);try{const ue=await Se.translateUserInput(o,d,{text:Z,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});ue.sent?(u(""),C(!1)):(u(q_(Z,ue.englishPreview)),C(!0))}catch(ue){D(ue instanceof Error?ue.message:"Translation failed.")}finally{M(!1)}}function Y(N){if(N.length===0)return;for(const ue of N)ue.type==="status"?x(ue.status):ue.type==="error"?D(ue.message):ue.type==="failures"&&h(ue.failures);const Z=N.filter(ue=>ue.type==="entry");Z.length>0&&(a(ue=>{const ve=Z.reduce((q,fe)=>A2(q,fe.entry),ue),X=w2(ve);return X.removedIds.size>0&&h(q=>q.filter(fe=>!X.removedIds.has(fe.translationId))),X.entries}),L(ue=>ue+1))}async function V(){const N=b?bg(g):g;if(N.trim()){M(!0),D("");try{await Se.sendTranslatedInput(o,d,{englishText:N}),u(""),C(!1)}catch(Z){D(Z instanceof Error?Z.message:"Failed to send English input.")}finally{M(!1)}}}function K(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!k&&g.trim()&&(b?V():W(r)))}async function J(){a([]),h([]),I.current=1,await Se.clearTranslationSession(_).catch(N=>D(N.message))}async function z(){M(!0),D("");try{const N=await Se.ignoreTranslationFailures(_);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to ignore translation failures.")}finally{M(!1)}}async function j(){M(!0),D("");try{const N=await Se.retryTranslationFailures(_);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to retry translation failures.")}finally{M(!1)}}const H=C2(f,A,m),G=c.length;return T.jsxs("aside",{className:"translation-panel",children:[T.jsxs("header",{className:"translation-panel-header",children:[T.jsxs("div",{className:"translation-panel-titlebar",children:[T.jsx("h2",{children:"Translation"}),T.jsxs("div",{className:"translation-panel-actions",children:[G>0?T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",disabled:k,onClick:()=>void z(),children:["Ignore ",G]}),T.jsxs("button",{type:"button",disabled:k,onClick:()=>void j(),children:["Retry ",G]})]}):null,T.jsx("button",{type:"button",onClick:()=>void J(),children:"Clear"})]})]}),T.jsxs("div",{className:"translation-status-row",children:[T.jsxs("p",{children:["Claude Code · target ",m2(s)," · ",H]}),T.jsx("p",{children:y?`poll ${y}`:"poll -"})]})]}),R?T.jsx("div",{className:"error-banner",children:R}):null,T.jsxs("div",{className:"translation-entry-list",ref:F,children:[f.length===0?T.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(N=>T.jsx(y2,{entry:N},N.id))]}),T.jsx("div",{className:"translation-composer",children:T.jsxs("div",{className:"translation-composer-row",children:[T.jsx("textarea",{value:g,onChange:N=>{u(N.target.value),(!N.target.value.trim()||b&&!k2(N.target.value))&&C(!1)},onKeyDown:K,placeholder:"输入中文,先翻译成英文工程指令..."}),T.jsx("div",{className:"translation-composer-actions",children:T.jsx("button",{type:"button",disabled:k||!b||!bg(g).trim(),onClick:()=>void V(),children:"Send English"})})]})})]})}function m2(n){var r;return((r=Og.find(s=>s.value===n))==null?void 0:r.label)??n}function g2({open:n,taskSlug:r,targetLanguage:s,onClose:o}){const[d,_]=ie.useState(!1),[f,a]=ie.useState(""),[c,h]=ie.useState(null),[g,u]=ie.useState(""),[b,C]=ie.useState(""),[A,x]=ie.useState(""),[y,v]=ie.useState(!1),[m,S]=ie.useState(null),[k,M]=ie.useState(""),[R,D]=ie.useState(""),[E,L]=ie.useState(""),[O,I]=ie.useState(!1);ie.useEffect(()=>{if(!n)return;let K=!1,J;const z=async()=>{K||(await F(!0),K||(J=window.setTimeout(z,2e3)))};return z(),()=>{K=!0,J!==void 0&&window.clearTimeout(J)}},[n,g]);async function F(K=!1){try{const J=await Se.getTranslationState();h(J);const z=g?J.fileIndex.jobs.some(j=>j.id===g):!1;if((!g||!z)&&J.fileIndex.jobs[0])U(J.fileIndex.jobs[0].id);else if(!J.fileIndex.jobs[0])u(""),C(""),x("");else if(K&&g){const j=await Se.readFileTranslation(g);C(j.output),x(j.report)}}catch(J){a(J instanceof Error?J.message:"Failed to load file translations.")}}async function U(K){u(K),C(""),x("");try{const J=await Se.readFileTranslation(K);C(J.output),x(J.report)}catch(J){a(J instanceof Error?J.message:"Failed to read translated file.")}}async function W(){v(!0),await Y(k,R)}async function Y(K="",J=""){I(!0),a("");try{const z=await Se.browseTranslationSourceFiles({path:K,query:J,limit:250});S(z),M(z.currentPath),D(J)}catch(z){a(z instanceof Error?z.message:"Failed to browse source files.")}finally{I(!1)}}async function V(K=E){const J=K.trim();if(J){_(!0),a("");try{if(!r)throw new Error("Create or select a task before translating files.");const z=await Se.createFileTranslation({taskSlug:r,sourcePath:J,targetLanguage:s});v(!1),await F(),await U(z.id)}catch(z){a(z instanceof Error?z.message:"Failed to create file translation.")}finally{_(!1)}}}return n?T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:T.jsx(v2,{busy:d,error:f,state:c,selectedJobId:g,output:b,report:A,onClose:()=>{v(!1),o()},onRefresh:()=>void F(),onSelectJob:K=>void U(K),onTranslate:()=>void W()})}),y?T.jsx(_2,{busy:d||O,state:m,currentPath:k,query:R,selectedPath:E,onBrowse:(K,J)=>void Y(K,J),onClose:()=>v(!1),onQueryChange:D,onSelectPath:L,onTranslate:()=>void V()}):null]}):null}function _2({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:_,onClose:f,onQueryChange:a,onSelectPath:c,onTranslate:h}){const g=(r==null?void 0:r.entries)??[],u=g.filter(C=>C.type==="directory"),b=g.filter(C=>C.type==="file");return T.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:T.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Select Source File"}),T.jsx("p",{children:s||"."})]}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]}),T.jsxs("div",{className:"translation-file-browser-controls",children:[T.jsxs("div",{className:"translation-file-browser-nav",children:[T.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_((r==null?void 0:r.parentPath)??"",""),children:"Up"}),T.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_("",""),children:"Root"})]}),T.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),_(s,o)},children:[T.jsx("input",{value:o,onChange:C=>a(C.target.value),placeholder:"Search files"}),T.jsx("button",{type:"submit",disabled:n,children:"Search"}),T.jsx("button",{type:"button",disabled:n||!o,onClick:()=>_(s,""),children:"Clear"})]})]}),T.jsxs("div",{className:"translation-file-browser-layout",children:[T.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?T.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&g.length===0?T.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?T.jsxs("div",{className:"translation-file-browser-group",children:[T.jsx("h3",{children:"Folders"}),u.map(C=>T.jsx(Sg,{entry:C,selected:d===C.path,onBrowse:_,onSelectPath:c},C.path))]}):null,b.length>0?T.jsxs("div",{className:"translation-file-browser-group",children:[T.jsx("h3",{children:"Files"}),b.map(C=>T.jsx(Sg,{entry:C,selected:d===C.path,onBrowse:_,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?T.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),T.jsxs("aside",{className:"translation-file-browser-selection",children:[T.jsxs("label",{children:[T.jsx("span",{children:"Source path"}),T.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),T.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Sg({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return T.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[T.jsx("span",{children:d?"DIR":"FILE"}),T.jsx("strong",{children:n.name}),T.jsx("small",{children:n.path})]})}function v2({busy:n,error:r,state:s,selectedJobId:o,output:d,report:_,onClose:f,onRefresh:a,onSelectJob:c,onTranslate:h}){const g=(s==null?void 0:s.fileIndex.jobs)??[],u=g.find(b=>b.id===o);return T.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[T.jsxs("header",{className:"file-translation-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"File Translation"}),T.jsx("p",{children:"Claude Code · 中英互译"})]}),T.jsxs("div",{className:"file-translation-toolbar",children:[T.jsx("button",{type:"button",disabled:n,onClick:h,children:"Translate"}),T.jsx("button",{type:"button",disabled:n,onClick:a,children:"Refresh"}),T.jsx("button",{type:"button",onClick:f,children:"Close"})]})]}),r?T.jsx("div",{className:"error-banner",children:r}):null,s!=null&&s.memoryInitialized?null:T.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),T.jsxs("div",{className:"file-translation-layout",children:[T.jsxs("div",{className:"file-translation-list",children:[g.length===0?T.jsx("p",{className:"muted",children:"No translated files yet."}):null,g.map(b=>T.jsxs("button",{className:b.id===o?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>c(b.id),children:[T.jsx("strong",{children:b.sourcePath}),T.jsxs("span",{children:[b.status," · ",b.targetLanguage]})]},b.id))]}),T.jsx("div",{className:"file-translation-preview",children:u?T.jsxs(T.Fragment,{children:[T.jsxs("header",{children:[T.jsx("strong",{children:u.sourcePath}),T.jsx("span",{children:u.status})]}),T.jsx("div",{className:"translation-markdown",children:T.jsx(v_,{remarkPlugins:[F_],children:d||_||"Translation output is not available yet."})})]}):T.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function y2({entry:n}){if(n.sourceKind==="conversation-boundary")return T.jsx(S2,{entry:n});const r=E2(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return T.jsxs("article",{className:d,children:[s?T.jsx("pre",{children:r}):T.jsx("div",{className:"translation-markdown",children:T.jsx(v_,{remarkPlugins:[F_],children:r})}),n.warning?T.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?T.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function S2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=D2(n.occurredAt??n.createdAt);return T.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[T.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),T.jsx("span",{children:r}),T.jsxs("span",{children:["第 ",s," 轮"]}),T.jsx("time",{children:o}),T.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function b2(n){const r=n.find(kh);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function C2(n,r,s){const o=n.find(kh);if(o)return`translating ${T2(Math.max(0,s-x2(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function kh(n){return n.status==="queued"||n.status==="translating"}function w2(n){const r=n.length-d2;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;kh(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function x2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function E2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?q_(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function q_(n,r){return`${n.trimEnd()}${lo}${r.trimStart()}`}function k2(n){return n.includes(lo)}function bg(n){const r=n.indexOf(lo);return r===-1?n:n.slice(r+lo.length)}function A2(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function T2(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function R2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function D2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function M2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function L2(n,r){const s=ps.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));if(r.gateReviewerEnabled){const o=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:o.permissionMode,model:o.model,effort:o.effort})}return s}const O2=["architecture-plan","validation-adequacy","final-diff"];function B2({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return T.jsxs("section",{className:"event-log",children:[s?T.jsx("h2",{children:"Events"}):null,n.length===0?T.jsx("p",{className:"muted",children:"No terminal events yet."}):T.jsx("ol",{children:o.map((d,_)=>T.jsx("li",{children:d},`${d}-${_}`))})]})}function j2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:o=!1,busy:d=!1,onRefresh:_,onApply:f,onOpenStudio:a,onOpenRepositoryDiff:c,onStartBootstrap:h,onRestartBootstrap:g,onStopBootstrap:u,onRunBootstrap:b}){const[C,A]=ie.useState(!1),[x,y]=ie.useState("default"),[v,m]=ie.useState("default"),[S,k]=ie.useState("default"),M=r==null?void 0:r.session,R=(r==null?void 0:r.status)==="running",D=(M==null?void 0:M.status)==="running",E=(r==null?void 0:r.status)!=="complete";ie.useEffect(()=>{M!=null&&M.permissionMode&&y(M.permissionMode),M!=null&&M.model&&m(M.model),M!=null&&M.effort&&k(M.effort)},[M]);const L={permissionMode:x,model:v,effort:S};return o?n?T.jsxs("section",{className:"harness-panel",children:[T.jsxs("div",{className:"harness-stage",children:[T.jsxs("div",{className:"harness-panel-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Fixed install"}),T.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),T.jsx("div",{className:"harness-actions",children:n.initialized?T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:d,onClick:()=>void _(),children:"Refresh"}),n.needsApply?T.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Update"}):null]}):T.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Initialize"})})]}),n.initialized&&n.needsApply?T.jsxs(T.Fragment,{children:[T.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),T.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(O=>T.jsxs("li",{children:[T.jsx("span",{children:O.path}),T.jsx(yi,{status:O.action})]},`${O.path}:${O.action}`))})]}):null]}),T.jsx("div",{className:"harness-stage",children:T.jsxs("div",{className:"harness-panel-header",children:[T.jsx("div",{children:T.jsx("strong",{children:"Harness Studio"})}),T.jsxs("div",{className:"harness-actions",children:[T.jsx("button",{type:"button",disabled:d,onClick:c,children:"Review Diff"}),T.jsx("button",{type:"button",disabled:d,onClick:a,children:"Open Studio"})]})]})}),E?T.jsx("div",{className:"harness-stage",children:T.jsxs("div",{className:"harness-panel-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Bootstrap"}),T.jsx("p",{className:"muted",children:r?N2(r.status):"not loaded"})]}),T.jsx("div",{className:"harness-actions",children:T.jsx("button",{type:"button",disabled:d||!(r!=null&&r.canStart),onClick:()=>{A(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?T.jsx("div",{className:"harness-result",children:T.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?T.jsx("ul",{className:"warnings",children:n.warnings.map(O=>T.jsx("li",{children:O},O))}):null,r!=null&&r.warnings.length?T.jsx("ul",{className:"warnings",children:r.warnings.map(O=>T.jsx("li",{children:O},O))}):null,E&&C?T.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:T.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[T.jsxs("header",{className:"harness-bootstrap-modal-header",children:[T.jsxs("div",{children:[T.jsx("strong",{children:"Harness Engineer Bootstrap"}),T.jsx("p",{className:"muted",children:(M==null?void 0:M.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),T.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[M?T.jsx(yi,{status:M.status}):null,T.jsx("button",{type:"button",onClick:()=>A(!1),children:"Close"})]})]}),T.jsxs("div",{className:"harness-bootstrap-controls",children:[T.jsxs("label",{children:[T.jsx("span",{children:"Permission"}),T.jsxs("select",{value:x,disabled:d||R||D,onChange:O=>y(O.target.value),children:[T.jsx("option",{value:"default",children:"默认"}),T.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),T.jsxs("label",{children:[T.jsx("span",{children:"Model"}),T.jsx("select",{value:v,disabled:d||R||D,onChange:O=>m(O.target.value),children:jg.map(O=>T.jsx("option",{value:O.value,children:O.label},O.value))})]}),T.jsxs("label",{children:[T.jsx("span",{children:"Effort"}),T.jsx("select",{value:S,disabled:d||R||D,onChange:O=>k(O.target.value),children:Ng.map(O=>T.jsx("option",{value:O.value,children:O.label},O.value))})]}),T.jsxs("div",{className:"harness-bootstrap-control-actions",children:[T.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void h(L),children:"Start"}),T.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void g(L),children:"Restart"}),T.jsx("button",{type:"button",disabled:d||!M,onClick:()=>void u(),children:"Stop"}),T.jsx("button",{type:"button",disabled:d||R||!D,onClick:()=>void b(),children:"Run bootstrap"})]})]}),T.jsx("div",{className:"harness-bootstrap-terminal",children:D?T.jsx(oo,{sessionId:M.id,active:C}):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:"Harness Bootstrap"}),T.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:T.jsx("section",{className:"harness-panel",children:T.jsxs("div",{className:"harness-result",children:[T.jsx("strong",{children:"Task required"}),T.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function N2(n){return n.replaceAll("_"," ")}function Ah(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function H2(n,r=6){const s=[...n].sort(U2).map((d,_)=>({message:d,sequence:_+1}));return[...r===null?s:s.slice(-r)].sort((d,_)=>_.sequence-d.sequence)}function z2({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:_=!0,onModeChange:f,onMarkAllDone:a}){const[c,h]=ie.useState(null),g=Ah(n),u=(r==null?void 0:r.mode)??"auto",b=H2(n,o);async function C(A){await P2(A.body),h(A.id),window.setTimeout(()=>h(x=>x===A.id?null:x),1200)}return T.jsxs("section",{className:"message-panel",children:[_?T.jsxs("div",{className:"message-panel-header",children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Messages"}),T.jsxs("p",{className:"muted",children:[g.total," total / ",g.accepted," accepted"]})]}),d&&f?T.jsx("div",{className:"message-controls",children:T.jsxs("label",{className:"message-mode-toggle",children:[T.jsx("input",{type:"checkbox",checked:u==="auto",disabled:s,onChange:A=>f(A.target.checked?"auto":"manual")}),T.jsx("span",{children:"Auto orchestration"})]})}):null,d&&a?T.jsx("button",{type:"button",disabled:s,onClick:a,children:"Mark All Done"}):null]}):null,n.length===0?T.jsx("p",{className:"muted",children:"No role messages yet."}):T.jsx("ol",{className:"message-list",children:b.map(({message:A,sequence:x})=>T.jsxs("li",{className:"message-item",children:[T.jsxs("div",{className:"message-item-main",children:[T.jsxs("div",{className:"message-meta",children:[T.jsxs("span",{className:"message-sequence",children:["#",x]}),T.jsx("time",{dateTime:ao(A),children:I2(ao(A))}),T.jsxs("strong",{children:[A.fromRole," ","->"," ",A.toRole]}),T.jsx("span",{children:A.type})]}),T.jsx("p",{children:A.body}),A.failureReason?T.jsx("span",{className:"message-reason",children:A.failureReason}):null,A.bodyPath?T.jsx("span",{className:"message-path",children:A.bodyPath}):null]}),T.jsx("div",{className:"message-actions",children:T.jsx("button",{type:"button",disabled:s,onClick:()=>void C(A),children:c===A.id?"Copied":"Copy"})})]},A.id))})]})}function I2(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 ao(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function U2(n,r){const s=ao(n).localeCompare(ao(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function P2(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 F2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,_]=ie.useState(n);ie.useEffect(()=>{n&&_(n)},[n]);async function f(a){a.preventDefault(),await o(d)}return T.jsx("form",{className:"repo-connect",onSubmit:f,children:T.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[T.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:a=>_(a.target.value),placeholder:"/path/to/repo"}),r.length>0?T.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:a=>{a.target.value&&_(a.target.value)},children:[T.jsx("option",{value:"",children:"Recent"}),r.map(a=>T.jsx("option",{value:a,children:a},a))]}):null,T.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function q2({tasks:n,activeTaskSlug:r,onSelect:s}){return T.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>T.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[T.jsx("span",{children:o.title||o.taskSlug}),T.jsx(yi,{status:o.status})]},o.taskSlug))})}function G2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:_,events:f,roundState:a,gateReview:c,translationEnabled:h,translationAutoSendEnabled:g,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:C,translatorSession:A,harnessStatus:x,harnessBootstrapStatus:y,harnessApplyResult:v,gatewayStatus:m,gatewayQrLogin:S,gatewayQrCheck:k,busy:M,onConnect:R,onRefreshConnectedRepository:D,onPullConnectedRepository:E,onRefreshHarness:L,onApplyHarness:O,onStartHarnessBootstrap:I,onRestartHarnessBootstrap:F,onStopHarnessBootstrap:U,onRunHarnessBootstrap:W,onOpenHarnessStudio:Y,onOpenRepositoryDiff:V,onRefreshGateway:K,onGatewayEnabledChange:J,onGatewayTranslationChange:z,onStartGatewayQrLogin:j,onResetGatewayBinding:H,onGateReviewGateEnabledChange:G,onTranslationEnabledChange:N,onTranslationAutoSendChange:Z,onTranslationTargetLanguageChange:ue,onTranslationOutputModeChange:ve,onOpenFileTranslation:X,onOpenTranslatorSession:q,onCreateTranslationBootstrap:fe,onUpdateTranslationMemory:ce,onCreateTask:de,onSelectTask:se,themeMode:Ce,onThemeModeChange:ke,flowPauseAlerts:Ee,onFlowPauseAlertsChange:ht,permissionRequestMode:De,onPermissionRequestModeChange:tn,launchTemplate:qt,canSaveLaunchTemplate:Kt,canOneClickStart:nn,onSaveLaunchTemplate:xn,onOneClickStart:wt,onTryFlowPauseAlert:ft,onMarkAllMessagesDone:At,onDeleteMessageHistory:ne}){const[ye,Ae]=ie.useState(""),[Be,Ne]=ie.useState(!1),[dt,Ue]=ie.useState(!1),[Je,we]=ie.useState(()=>o?null:"repository-path"),ct=Ah(d),qe=ye.trim(),rn=K2(n,o,x),Tt=s.find(ze=>ze.taskSlug===o)??null;ie.useEffect(()=>{we(ze=>o&&ze==="repository-path"?null:!o&&ze===null?"repository-path":ze)},[o]);function Yt(ze,Fn){we(Fn?ze:null)}async function Bn(ze){ze.preventDefault(),await de({taskSlug:qe}),Ae("")}return T.jsxs("div",{className:"project-dashboard",children:[T.jsx("header",{className:"brand-header",children:T.jsx("strong",{children:"VibeCodingMaster"})}),T.jsx(vi,{title:"Repository Path",open:Je==="repository-path",onOpenChange:ze=>Yt("repository-path",ze),children:T.jsx(F2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:M,onConnect:R})}),n?T.jsx(vi,{title:"Connected Repository",open:Je==="connected-repository",onOpenChange:ze=>{Yt("connected-repository",ze),ze&&D()},children:T.jsx(Z2,{busy:M,project:n,onPull:E})}):null,T.jsx(vi,{title:"Settings",open:Je==="settings",onOpenChange:ze=>Yt("settings",ze),children:T.jsxs("div",{className:"sidebar-settings",children:[T.jsxs("button",{"aria-label":`Theme mode: ${wg(Ce)}`,className:"settings-toggle theme-mode-toggle",disabled:M,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>ke(iE(Ce)),children:[T.jsx("span",{children:"Theme"}),T.jsx("span",{children:wg(Ce)})]}),T.jsxs("button",{"aria-pressed":!(m!=null&&m.enabled)&&Ee,className:!(m!=null&&m.enabled)&&Ee?"settings-toggle is-active":"settings-toggle",disabled:M||(m==null?void 0:m.enabled),title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:()=>ht(!Ee),children:[T.jsx("span",{children:"Flow pause alert"}),T.jsx("span",{children:m!=null&&m.enabled?"off":Ee?"on":"off"})]}),T.jsxs("button",{className:"settings-toggle",disabled:M||(m==null?void 0:m.enabled),title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:ft,children:[T.jsx("span",{children:"Try alert"}),T.jsx("span",{children:"test"})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Permission requests"}),T.jsxs("select",{value:De,disabled:M,onChange:ze=>tn(ze.target.value),children:[T.jsx("option",{value:"off",children:"off"}),T.jsx("option",{value:"allowAll",children:"allow all"})]})]}),T.jsxs("button",{className:"settings-toggle",disabled:M||!Kt,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:xn,children:[T.jsx("span",{children:"Save launch template"}),T.jsx("span",{children:Kt?"ready":"needs core sessions"})]}),nn?T.jsxs("button",{className:"settings-toggle is-active",disabled:M,title:V2(qt),type:"button",onClick:wt,children:[T.jsx("span",{children:"One-click start"}),T.jsx("span",{children:G_(qt)})]}):null,o?T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",onClick:()=>Ne(!0),children:[T.jsx("span",{children:"Messages"}),T.jsxs("span",{className:"muted",children:[ct.total," total"]})]}),T.jsxs("button",{type:"button",onClick:()=>Ue(!0),children:[T.jsx("span",{children:"Events"}),T.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),T.jsx(vi,{title:"Translation",open:Je==="translation",onOpenChange:ze=>Yt("translation",ze),children:T.jsx($2,{busy:M,enabled:h,autoSendEnabled:g,targetLanguage:u,outputMode:b,memoryInitialized:C,baseUnavailableReason:rn,translatorSession:A,onAutoSendChange:Z,onCreateBootstrap:fe,onEnabledChange:N,onUpdateMemory:ce,onTargetLanguageChange:ue,onOutputModeChange:ve,onOpenFileTranslation:X,onOpenTranslatorSession:q})}),n&&o?T.jsx(vi,{title:"Gate Review Gates",open:Je==="gate-review-gates",onOpenChange:ze=>Yt("gate-review-gates",ze),children:T.jsx(Y2,{busy:M,state:c,onGateEnabledChange:G})}):null,T.jsx(vi,{title:"Gateway",open:Je==="gateway",onOpenChange:ze=>{Yt("gateway",ze),ze&&K()},children:T.jsx(Q2,{busy:M,qrCheck:k,qrLogin:S,status:m,onEnabledChange:J,onResetBinding:H,onStartQrLogin:j,onTranslationChange:z})}),n?T.jsx(vi,{title:"VCM Harness",open:Je==="vcm-harness",onOpenChange:ze=>Yt("vcm-harness",ze),children:T.jsx(j2,{status:x,bootstrapStatus:y,applyResult:v,hasActiveTask:!!Tt,busy:M,onRefresh:L,onApply:O,onOpenStudio:Y,onOpenRepositoryDiff:V,onStartBootstrap:I,onRestartBootstrap:F,onStopBootstrap:U,onRunBootstrap:W})}):null,n?T.jsx(vi,{title:"New Task",open:Je==="new-task",onOpenChange:ze=>Yt("new-task",ze),children:T.jsx("div",{className:"task-create",children:T.jsxs("form",{onSubmit:Bn,children:[T.jsx("input",{value:ye,onChange:ze=>Ae(ze.target.value),placeholder:"task name"}),T.jsxs("div",{className:"task-create-preview",children:[T.jsxs("small",{children:["branch: ",qe?`feature/${qe}`:"feature/<task>"]}),T.jsxs("small",{children:["worktree: ",qe?`.claude/worktrees/${qe}`:".claude/worktrees/<task>"]})]}),T.jsx("button",{type:"submit",disabled:M||!qe,children:"Create"})]})})}):null,s.length>0?T.jsx(vi,{title:"Tasks",open:Je==="tasks",onOpenChange:ze=>Yt("tasks",ze),children:T.jsx(q2,{tasks:s,activeTaskSlug:o,onSelect:se})}):null,n&&Tt?T.jsx(tE,{task:Tt,roundState:a}):null,Be?T.jsx(sE,{busy:M,messages:d,orchestration:_,onClose:()=>Ne(!1),onMarkAllDone:()=>{o&&At(o)},onDeleteMessageHistory:()=>{o&&ne(o)}}):null,dt?T.jsx(rE,{events:f,onClose:()=>Ue(!1)}):null]})}function G_(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function V2(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${G_(n)}; ${r}`}function $2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:o,memoryInitialized:d,outputMode:_,targetLanguage:f,translatorSession:a,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:g,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:C,onOpenFileTranslation:A,onOpenTranslatorSession:x}){const y=!!(s||r),v=(a==null?void 0:a.status)==="running",m=!!(o&&!r&&v),S=r??(v?null:"Start Translator session first."),k=!!(s||S),R=r??"Open Translator session",D=S??"Translation tools are ready";return T.jsxs("div",{className:"sidebar-settings",children:[T.jsxs("button",{"aria-pressed":m,className:m?"settings-toggle is-active":"settings-toggle",disabled:y||!v,title:D,type:"button",onClick:()=>g(!m),children:[T.jsx("span",{children:"Conversation translation"}),T.jsx("span",{children:m?"on":"off"})]}),T.jsxs("button",{"aria-pressed":n,className:n?"settings-toggle is-active":"settings-toggle",disabled:y,type:"button",onClick:()=>c(!n),children:[T.jsx("span",{children:"Auto-send"}),T.jsx("span",{children:n?"on":"off"})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Language"}),T.jsx("select",{value:f,disabled:y,onChange:E=>C(E.target.value),children:Og.map(E=>T.jsx("option",{value:E.value,children:E.label},E.value))})]}),T.jsxs("label",{className:"settings-select-row",children:[T.jsx("span",{children:"Reply scope"}),T.jsx("select",{value:_,disabled:y,onChange:E=>b(E.target.value),children:x1.map(E=>T.jsx("option",{value:E.value,children:E.label},E.value))})]}),T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:A,children:[T.jsx("span",{children:"File translation"}),T.jsx("span",{children:"open"})]}),d?null:T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:h,children:[T.jsx("span",{children:"Bootstrap"}),T.jsx("span",{children:"run"})]}),T.jsxs("button",{className:"settings-toggle",disabled:k,title:D,type:"button",onClick:u,children:[T.jsx("span",{children:"Update memory"}),T.jsx("span",{children:"run"})]}),S?T.jsx("p",{className:"settings-help-text",children:S}):null,T.jsxs("div",{className:"settings-status-row",children:[T.jsx("span",{children:"Session status"}),T.jsx("strong",{children:W2(a)})]}),T.jsxs("button",{className:"settings-toggle",disabled:y,title:R,type:"button",onClick:x,children:[T.jsx("span",{children:"Open Session"}),T.jsx("span",{children:"open"})]})]})}function W2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function K2(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 Y2({busy:n,onGateEnabledChange:r,state:s}){return T.jsx("div",{className:"sidebar-settings",children:O2.map(o=>{const d=s==null?void 0:s.gates[o],_=!!(d!=null&&d.required);return T.jsxs("button",{"aria-pressed":_,className:_?"settings-toggle is-active":"settings-toggle",disabled:n||!s,title:d!=null&&d.status?`status: ${d.status}`:void 0,type:"button",onClick:()=>r(o,!_),children:[T.jsx("span",{children:X2(o)}),T.jsx("span",{children:_?"on":"off"})]},o)})})}function X2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function Q2({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:_,qrLogin:f,status:a}){const c=!!(a!=null&&a.binding.tokenConfigured),h=!!(a!=null&&a.binding.tokenConfigured);return T.jsxs("div",{className:"gateway-panel",children:[T.jsxs("div",{className:"gateway-actions",children:[T.jsxs("button",{"aria-pressed":!!(a!=null&&a.enabled),className:a!=null&&a.enabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a||!a.enabled&&!c,title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",type:"button",onClick:()=>a?r(!a.enabled):void 0,children:[T.jsx("span",{children:"Gateway"}),T.jsx("span",{children:a!=null&&a.enabled?"on":"off"})]}),T.jsxs("button",{"aria-pressed":!!(a!=null&&a.translationEnabled),className:a!=null&&a.translationEnabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a,type:"button",onClick:()=>a?d(!a.translationEnabled):void 0,children:[T.jsx("span",{children:"Translation"}),T.jsx("span",{children:a!=null&&a.translationEnabled?"on":"off"})]}),h?T.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):T.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?T.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,_?T.jsxs("p",{className:"muted",children:["QR status: ",_.status,_.message?` · ${_.message}`:""]}):null]})}function Z2({busy:n,onPull:r,project:s}){const o=s.pullDisabledReason,d=!!s.canPull;return T.jsxs("div",{className:"project-summary",children:[T.jsxs("dl",{children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Base path"}),T.jsx("dd",{children:s.repoRoot})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Branch"}),T.jsx("dd",{children:J2(s)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Remote"}),T.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Status"}),T.jsx("dd",{children:eE(s)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Commit"}),T.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Working tree"}),T.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),T.jsxs("div",{className:"connected-repo-actions",children:[T.jsx("button",{type:"button",disabled:n||!d,title:o??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),T.jsx("span",{className:"muted",children:s.checkedAt?`checked ${nh(s.checkedAt)}`:"status not refreshed"})]}),o?T.jsx("p",{className:"muted",children:o}):null,s.warnings.length>0?T.jsx("ul",{className:"warnings",children:s.warnings.map(_=>T.jsx("li",{children:_},_))}):null]})}function J2(n){return n.branch||"unknown"}function eE(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 tE({roundState:n,task:r}){var g;const[s,o]=ie.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),_=V_(r.createdAt,s),f=Cg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),a=d&&n?Cg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?nE(n,s):0,h=((g=r.title)==null?void 0:g.trim())||r.taskSlug;return ie.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),T.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[T.jsxs("div",{className:"task-status-dock-title",children:[T.jsx("strong",{title:h,children:h}),T.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),T.jsxs("dl",{className:"task-status-stats",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Session start"}),T.jsx("dd",{children:nh(r.createdAt)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Session total"}),T.jsx("dd",{children:Ja(_)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Rounds"}),T.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Role runtime"}),T.jsx("dd",{children:Ja(f)})]})]}),d&&n?T.jsxs("div",{className:"current-round-status",children:[T.jsxs("div",{className:"current-round-title",children:[T.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),T.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),T.jsxs("dl",{className:"task-status-stats",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Started"}),T.jsx("dd",{children:nh(n.startedAt)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Total"}),T.jsx("dd",{children:Ja(c)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Role runtime"}),T.jsx("dd",{children:Ja(a)})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Turn count"}),T.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Cg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function nE(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return V_(n.startedAt??"",Number.isFinite(s)?s:r)}function V_(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function nh(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 Ja(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function iE(n){return n==="system"?"light":n==="light"?"dark":"system"}function wg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function rE({events:n,onClose:r}){return T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Events"}),T.jsxs("p",{className:"muted",children:[n.length," total"]})]}),T.jsx("button",{type:"button",onClick:r,children:"Close"})]}),T.jsx(B2,{events:n,maxEvents:null,showHeader:!1})]})})}function sE({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:_}){const f=Ah(r);function a(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
93
93
  `))&&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(`
94
- `))&&_()}return T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Messages"}),T.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),T.jsxs("div",{className:"modal-actions",children:[T.jsx("button",{type:"button",disabled:n,onClick:a,children:"Mark All Done"}),T.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),T.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),T.jsx(zE,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function vi({children:n,onOpenChange:r,open:s,title:o}){return T.jsxs("section",{className:"sidebar-section",children:[T.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[T.jsx("span",{children:o}),T.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?T.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function $_(n,r){return n.find(s=>s.role===r)}function l2({activeRole:n,roles:r=lh,sessions:s,onSelect:o}){return T.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const _=$_(s,d.name),f=(_==null?void 0:_.status)==="running"?_.activityStatus??"idle":(_==null?void 0:_.status)??"not_started";return T.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[T.jsx("span",{children:d.label}),T.jsx(yi,{status:f})]},d.name)})})}function a2({role:n,session:r,permissionMode:s,model:o,effort:d,active:_=!0,busy:f,translationEnabled:a,translationAutoSendEnabled:c,translationTargetLanguage:h,onPermissionModeChange:g,onModelChange:u,onEffortChange:b,onStart:C,onResume:A,onStop:x,onRestart:y,onNotifyHarnessUpdated:v,onTerminalEvent:m}){const S=b1(n)&&a&&(r==null?void 0:r.status)==="running";return T.jsx("section",{className:"session-console",children:T.jsxs("div",{className:S?"session-console-body has-translation":"session-console-body",children:[T.jsxs("div",{className:"terminal-pane",children:[T.jsx(ah,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:g,onModelChange:u,onEffortChange:b,onStart:C,onResume:A,onStop:x,onRestart:y,onNotifyHarnessUpdated:v}),(r==null?void 0:r.status)==="running"?T.jsx(oo,{sessionId:r.id,active:_,onEvent:m},r.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:n}),T.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."})]})]}),S?T.jsx("div",{className:"translation-pane",children:T.jsx(pE,{active:_,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id},r.id)}):null]})})}function o2(n,r,s){var _;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var a;return f.dispatchingAt?((a=o.get(f.id))==null?void 0:a.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((_=d.sort(c2)[d.length-1])==null?void 0:_.toRole)??null}function c2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const u2=2e3;function h2({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,refreshNonce:f=0,onTaskChanged:a,onActiveRoleChange:c,onBeforeCloseTask:h,onMessagesChanged:g,onOrchestrationChanged:u,onRoundStateChanged:b,onEventsChanged:C,onLaunchStateChanged:A}){const[x,y]=ne.useState(null),[v,m]=ne.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[S,k]=ne.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[M,R]=ne.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"}),[D,E]=ne.useState(!1),[L,O]=ne.useState(""),[I,F]=ne.useState([]),[U,W]=ne.useState(null),Y=ne.useRef(null),V=ne.useRef(""),K=!!(x!=null&&x.sessions.some(de=>de.role==="gate-reviewer")),J=s||K,z=[...ps,...J?[Dg]:[]],j=ne.useCallback((de,re)=>{var xe;const Ce=((xe=Y.current)==null?void 0:xe.taskSlug)===n.taskSlug?Y.current.messages:null,Ee=o2(Ce,de,re);Y.current={taskSlug:n.taskSlug,messages:de},W(re),g==null||g(de),u==null||u(re),Ee&&(c(Ee),ue(`auto switched to ${Ee} before VCM dispatch`))},[c,g,u,n.taskSlug]),H=ne.useCallback((de,re,Ce,Ee)=>{y(de),j(re,Ce),b==null||b(Ee)},[j,b]),G=ne.useCallback(async()=>{const[de,re,Ce,Ee]=await Promise.all([Se.getTaskStatus(n.taskSlug),Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug),Se.getSessionRoundState(n.taskSlug)]);H(de,re,Ce,Ee)},[H,n.taskSlug]);ne.useEffect(()=>{G().catch(de=>O(de.message))},[G,f]),ne.useEffect(()=>{F([]),C==null||C([])},[C,n.taskSlug]),ne.useEffect(()=>{x&&!J&&r==="gate-reviewer"&&c("project-manager"),x&&r==="translator"&&c("project-manager")},[r,J,c,x]),ne.useEffect(()=>{const de=x==null?void 0:x.task;if(!de||de.taskSlug!==n.taskSlug)return;const re=xg(de);if(re===xg(n)){V.current="";return}V.current!==re&&(V.current=re,a().catch(Ce=>{V.current="",O(Ce.message)}))},[a,x==null?void 0:x.task,n]),ne.useEffect(()=>{m(de=>{let re=!1;const Ce={...de};for(const Ee of(x==null?void 0:x.sessions)??[])Ce[Ee.role]!==Ee.permissionMode&&(Ce[Ee.role]=Ee.permissionMode,re=!0);return re?Ce:de})},[x==null?void 0:x.sessions]),ne.useEffect(()=>{k(de=>{let re=!1;const Ce={...de};for(const Ee of(x==null?void 0:x.sessions)??[]){const xe=Ee.model??"default";Ce[Ee.role]!==xe&&(Ce[Ee.role]=xe,re=!0)}return re?Ce:de})},[x==null?void 0:x.sessions]),ne.useEffect(()=>{R(de=>{let re=!1;const Ce={...de};for(const Ee of(x==null?void 0:x.sessions)??[]){const xe=Ee.effort??"default";Ce[Ee.role]!==xe&&(Ce[Ee.role]=xe,re=!0)}return re?Ce:de})},[x==null?void 0:x.sessions]),ne.useEffect(()=>{const re=((x==null?void 0:x.sessions)??[]).filter(xe=>f2(xe.role)),Ce=new Set(re.map(xe=>xe.role)),Ee={};for(const xe of sh)Ee[xe.name]={permissionMode:v[xe.name],model:S[xe.name],effort:M[xe.name]};A==null||A({taskSlug:n.taskSlug,roles:Ee,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!x,sessionCount:re.length,hasAnySession:re.length>0,allRolesHaveSession:ps.every(xe=>Ce.has(xe.name))})},[S,M,A,U==null?void 0:U.mode,v,x,n.taskSlug]),ne.useEffect(()=>{const de=window.setInterval(()=>{Promise.all([Se.getTaskStatus(n.taskSlug),Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug),Se.getSessionRoundState(n.taskSlug)]).then(([re,Ce,Ee,xe])=>{H(re,Ce,Ee,xe)}).catch(re=>O(re.message))},3e3);return()=>window.clearInterval(de)},[H,n.taskSlug]),ne.useEffect(()=>{let de=!1,re=!1;const Ce=window.setInterval(()=>{re||(re=!0,Promise.all([Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug)]).then(([Ee,xe])=>{de||j(Ee,xe)}).catch(Ee=>{de||O(Ee.message)}).finally(()=>{re=!1}))},u2);return()=>{de=!0,window.clearInterval(Ce)}},[j,n.taskSlug]);async function N(de){E(!0),O("");try{await de(),await G(),await a()}catch(re){O(re instanceof Error?re.message:"Action failed.")}finally{E(!1)}}async function Z(){const de=[`Close task "${n.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- stops project-scoped Translator and Harness Engineer sessions",`- deletes the task worktree: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
95
- `);if(window.confirm(de)){E(!0),O("");try{await(h==null?void 0:h()),await Se.cleanupTask(n.taskSlug,{force:!0,forceDeleteBranch:!0}),ue(`closed ${n.taskSlug}`),await a()}catch(Ce){O(Ce instanceof Error?Ce.message:"Close task failed.")}finally{E(!1)}}}function ue(de){F(re=>{const Ce=[...re,`${new Date().toLocaleTimeString()} ${de}`];return C==null||C(Ce),Ce})}function ve(de,re){m(Ce=>({...Ce,[de]:re}))}function X(de,re){k(Ce=>({...Ce,[de]:re}))}function q(de,re){R(Ce=>({...Ce,[de]:re}))}async function fe(de){E(!0),O("");try{const re=await Se.updateOrchestrationState(n.taskSlug,{mode:de});W(re),u==null||u(re),ue(`auto orchestration ${de==="auto"?"enabled":"disabled"}`)}catch(re){O(re instanceof Error?re.message:"Failed to update orchestration mode.")}finally{E(!1)}}const ce=((U==null?void 0:U.mode)??"auto")==="auto";return T.jsxs("div",{className:"task-workspace",children:[T.jsxs("header",{className:"workspace-header",children:[T.jsx("div",{className:"workspace-title-line",children:T.jsx("h1",{children:n.title||n.taskSlug})}),T.jsx(l2,{activeRole:r,roles:z,sessions:(x==null?void 0:x.sessions)??[],onSelect:c}),T.jsxs("div",{className:"workspace-header-actions",children:[T.jsxs("button",{"aria-label":`Auto orchestration is ${ce?"on":"off"}`,"aria-pressed":ce,className:`orchestration-toggle${ce?" is-active":""}`,disabled:D,type:"button",onClick:()=>void fe(ce?"manual":"auto"),children:[T.jsx("span",{children:"Auto orchestration"}),T.jsx("strong",{children:ce?"on":"off"})]}),T.jsx("button",{className:"danger-button",type:"button",disabled:D,onClick:()=>void Z(),children:"Close Task"})]})]}),L?T.jsx("div",{className:"error-banner",children:L}):null,T.jsx("div",{className:"workspace-grid",children:T.jsx("div",{className:"workspace-main",children:T.jsx("div",{className:"role-console-stack",children:z.map(de=>{const re=de.name,Ce=re===r,Ee=$_((x==null?void 0:x.sessions)??[],re);return T.jsx("div",{className:Ce?"role-console-panel is-active":"role-console-panel","aria-hidden":!Ce,children:T.jsx(a2,{role:re,session:Ee,permissionMode:v[re],model:S[re],effort:M[re],active:Ce,busy:D,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,onPermissionModeChange:xe=>ve(re,xe),onModelChange:xe=>X(re,xe),onEffortChange:xe=>q(re,xe),onStart:()=>void N(async()=>{await Se.startRoleSession(n.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:M[re]}),ue(`started ${re} with ${v[re]} / ${S[re]} / ${M[re]}`)}),onResume:()=>void N(async()=>{await Se.resumeRoleSession(n.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:M[re]}),ue(`resumed ${re} with ${v[re]} / ${S[re]} / ${M[re]}`)}),onStop:()=>void N(async()=>{await Se.stopRoleSession(n.taskSlug,re),ue(`stopped ${re}`)}),onRestart:()=>void N(async()=>{await Se.restartRoleSession(n.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:M[re]}),ue(`restarted ${re} with ${v[re]} / ${S[re]} / ${M[re]}`)}),onNotifyHarnessUpdated:()=>void N(async()=>{await Se.notifyRoleHarnessUpdated(n.taskSlug,re),ue(`notified ${re} to reload latest harness`)}),onTerminalEvent:xe=>ue(`${de.label}: ${xe}`)})},re)})})})})]})}function f2(n){return ps.some(r=>r.name===n)}function xg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}const d2=120*1e3,Eg=1400,p2=3;function m2(n){return!!(n!=null&&n.initialized)}function g2(){const[n,r]=ne.useState(null),[s,o]=ne.useState([]),[d,_]=ne.useState(null),[f,a]=ne.useState(null),[c,h]=ne.useState(null),[g,u]=ne.useState(null),[b,C]=ne.useState(null),[A,x]=ne.useState(null),[y,v]=ne.useState(null),[m,S]=ne.useState(null),[k,M]=ne.useState(!1),[R,D]=ne.useState([]),[E,L]=ne.useState(null),[O,I]=ne.useState(null),[F,U]=ne.useState(null),[W,Y]=ne.useState(null),[V,K]=ne.useState(null),[J,z]=ne.useState(null),[j,H]=ne.useState("project-manager"),[G,N]=ne.useState("system"),[Z,ue]=ne.useState(!0),[ve,X]=ne.useState("off"),[q,fe]=ne.useState(!1),[ce,de]=ne.useState(!1),[re,Ce]=ne.useState(C1),[Ee,xe]=ne.useState(w1),[dt,Re]=ne.useState(!1),[en,qt]=ne.useState(!1),[Kt,tn]=ne.useState(!1),[wn,wt]=ne.useState(!1),[pt,At]=ne.useState(!1),[se,ye]=ne.useState(null),[ke,Be]=ne.useState("default"),[je,mt]=ne.useState("default"),[Ue,et]=ne.useState("medium"),[Me,ht]=ne.useState(null),[qe,nn]=ne.useState("default"),[Tt,Yt]=ne.useState("default"),[On,ze]=ne.useState("medium"),[qn,Zn]=ne.useState(()=>E1()),[Jn,rr]=ne.useState(null),[mo,Ll]=ne.useState(0),[Rr,Gn]=ne.useState(null),[Ol,Bl]=ne.useState(!1),[sr,ys]=ne.useState(!1),[Dr,St]=ne.useState(""),Ss=ne.useRef({}),Bn=ne.useRef(null),rn=ne.useRef(""),yt=ne.useRef(""),Rt=ne.useRef(""),jn=ne.useRef(""),te=ne.useMemo(()=>ME(R,E),[R,E]),Xt=(Jn==null?void 0:Jn.taskSlug)===(te==null?void 0:te.taskSlug)?Jn:null,bs=c===(te==null?void 0:te.taskSlug)?d:null,Cs=g===(te==null?void 0:te.taskSlug)?f:null,Nn=!!(n&&te&&m2(bs)),lr=(se==null?void 0:se.status)==="running",ei=!!(q&&Nn&&lr),bi=!!(Xt!=null&&Xt.statusLoaded&&Xt.allRolesHaveSession),ar=!!(te&&(Xt!=null&&Xt.statusLoaded)&&!Xt.hasAnySession),Dt=ne.useCallback($=>{N($.themeMode),ue($.flowPauseAlerts),X($.permissionRequestMode),fe($.translationEnabled),de($.translationAutoSendEnabled),Ce($.translationTargetLanguage),xe($.translationOutputMode),Zn($.launchTemplate)},[]),nt=ne.useCallback(()=>{Bn.current!==null&&(window.clearInterval(Bn.current),Bn.current=null)},[]),ws=ne.useCallback(($={})=>{nt(),$.resetAudio&&C2(),eo(),Bn.current=window.setInterval(()=>{eo()},Eg)},[nt]),xs=ne.useCallback(()=>{nt(),Gn(null);let $=1;eo(),Bn.current=window.setInterval(()=>{$+=1,eo(),$>=p2&&Bn.current!==null&&(window.clearInterval(Bn.current),Bn.current=null)},Eg)},[nt]),Hn=ne.useCallback(($,pe=`manual-${Date.now()}`,We={})=>{Gn({id:pe,text:$}),ws(We)},[ws]),Ci=ne.useCallback(()=>{nt(),Gn(null)},[nt]),Mr=ne.useCallback(()=>{nt(),Gn(null),ue(!1)},[nt]),jl=ne.useCallback($=>{te!=null&&te.taskSlug&&I({taskSlug:te.taskSlug,messages:$})},[te==null?void 0:te.taskSlug]),Nl=ne.useCallback($=>{te!=null&&te.taskSlug&&U({taskSlug:te.taskSlug,orchestration:$})},[te==null?void 0:te.taskSlug]),go=ne.useCallback($=>{te!=null&&te.taskSlug&&Y({taskSlug:te.taskSlug,events:$})},[te==null?void 0:te.taskSlug]),Lr=ne.useCallback($=>{if(!(te!=null&&te.taskSlug)||$.taskSlug!==te.taskSlug||(K({taskSlug:$.taskSlug,roundState:$}),$.status!=="stopped"||!$.roundId))return;const pe=S2($);if(Ss.current[$.taskSlug]===pe||(Ss.current[$.taskSlug]=pe,!Z))return;const st=$.activeRole??"role";y2($)>=d2?Hn(`No new turn started after ${st} stopped.`,pe):xs()},[te==null?void 0:te.taskSlug,Z,xs,Hn]),Or=ne.useCallback($=>{rr(pe=>(pe==null?void 0:pe.taskSlug)===$.taskSlug&&pe.statusLoaded===$.statusLoaded&&pe.sessionCount===$.sessionCount&&pe.hasAnySession===$.hasAnySession&&pe.allRolesHaveSession===$.allRolesHaveSession&&pe.autoOrchestration===$.autoOrchestration&&JSON.stringify(pe.roles)===JSON.stringify($.roles)?pe:$)},[]);async function Qt(){const $=await Se.listTasks();return D($),L(pe=>{var We;return pe&&$.some(st=>st.taskSlug===pe)?pe:((We=$[0])==null?void 0:We.taskSlug)??null}),$}async function Ht($=te==null?void 0:te.taskSlug){if(!$)return _(null),h(null),null;const pe=await Se.getHarnessStatus($);return _(pe),h($),pe}async function wi($=te==null?void 0:te.taskSlug){if(!$)return a(null),u(null),null;const pe=await Se.getHarnessBootstrapStatus($);return a(pe),u($),pe}async function Es(){const $=await Se.getGatewayStatus();return x($),$}async function ks(){const $=await Se.getRecentRepositoryPaths();return o($),$}async function or(){if(!n)return Re(!1),!1;const $=await Se.getTranslationState();return Re($.memoryInitialized),$.memoryInitialized}async function xi($){const[pe,We]=await Promise.all([Se.listMessages($),Se.getOrchestrationState($)]);I({taskSlug:$,messages:pe}),U({taskSlug:$,orchestration:We})}async function As($){const pe=await Se.getGateReviewState($);return z({taskSlug:$,state:pe}),pe}function xt($){$&&(Be($.permissionMode),$.model&&mt($.model),$.effort&&et($.effort))}async function Ei($={}){const pe=await Se.getTranslatorSession();return ye(pe),$.syncLaunchOptions&&xt(pe),pe}function Vn($){$&&(nn($.permissionMode),$.model&&Yt($.model),$.effort&&ze($.effort))}async function zn($={}){const pe=await Se.getHarnessEngineerSession();return ht(pe),$.syncLaunchOptions&&Vn(pe),pe}async function ki(){const $=te==null?void 0:te.taskSlug,pe=n==null?void 0:n.repoRoot,We=[];pe&&$&&(se!=null&&se.claudeSessionId)&&se.status!=="exited"&&(Rt.current=`${pe}:${$}:${se.claudeSessionId}`,We.push(Se.stopTranslatorSession().then(st=>{ye(st),xt(st)}).catch(Ts))),pe&&$&&(Me!=null&&Me.claudeSessionId)&&Me.status!=="exited"&&(jn.current=`${pe}:${$}:${Me.claudeSessionId}`,We.push(Se.stopHarnessEngineerSession().then(st=>{ht(st),Vn(st)}).catch(Ts))),await Promise.all(We)}function Ts($){if(!($ instanceof Error&&$.message.includes("session has not been started")))throw $}ne.useEffect(()=>{Promise.all([Se.getCurrentProject(),Se.getRecentRepositoryPaths(),Se.getAppPreferences(),Se.getGatewayStatus()]).then(async([$,pe,We,st])=>{r($),o(pe),x(st),Dt(We),$&&await Qt()}).catch($=>St($.message))},[Dt]),ne.useEffect(()=>{const $=window.matchMedia("(prefers-color-scheme: dark)"),pe=()=>Bl($.matches);return pe(),$.addEventListener("change",pe),()=>$.removeEventListener("change",pe)},[]),ne.useEffect(()=>()=>nt(),[nt]),ne.useEffect(()=>{const $=G==="system"?Ol?"dark":"light":G;document.documentElement.dataset.theme=$,document.documentElement.dataset.themeMode=G},[Ol,G]),ne.useEffect(()=>{!(A!=null&&A.enabled)||!Z||(Mr(),Se.updateAppPreferences({flowPauseAlerts:!1}).then($=>Dt($)).catch($=>St($.message)))},[Dt,Mr,Z,A==null?void 0:A.enabled]),ne.useEffect(()=>{if(!(A!=null&&A.enabled)||!n||!te)return;const $=`${n.repoRoot}:${te.taskSlug}`;if(A.currentProjectId===n.repoRoot&&A.currentTaskSlug===te.taskSlug){rn.current=$;return}rn.current!==$&&(rn.current=$,Se.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:te.taskSlug}).then(pe=>x(pe)).catch(pe=>{rn.current===$&&(rn.current=""),St(pe.message)}))},[te==null?void 0:te.taskSlug,A==null?void 0:A.currentProjectId,A==null?void 0:A.currentTaskSlug,A==null?void 0:A.enabled,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!(te!=null&&te.taskSlug)){z(null);return}As(te.taskSlug).catch($=>St($.message))},[te==null?void 0:te.taskSlug]),ne.useEffect(()=>{yt.current="",Rt.current="",jn.current="",ye(null),Be("default"),mt("default"),et("medium"),Re(!1),ht(null),nn("default"),Yt("default"),ze("medium"),_(null),a(null),h(null),u(null)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n){Re(!1);return}Ei({syncLaunchOptions:!0}).catch(pe=>St(pe.message)),or().catch(pe=>St(pe.message));const $=window.setInterval(()=>{Ei().catch(pe=>St(pe.message)),or().catch(pe=>St(pe.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n)return;zn({syncLaunchOptions:!0}).catch(pe=>St(pe.message));const $=window.setInterval(()=>{zn().catch(pe=>St(pe.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n||!(te!=null&&te.taskSlug)||!(Me!=null&&Me.claudeSessionId)||Me.status==="running"||Me.status==="done")return;const $=`${n.repoRoot}:${te.taskSlug}:${Me.claudeSessionId}`;jn.current!==$&&(jn.current=$,Se.resumeHarnessEngineerSession({taskSlug:te.taskSlug,permissionMode:Me.permissionMode,model:Me.model,effort:Me.effort}).then(pe=>{ht(pe),Vn(pe)}).catch(pe=>St(pe.message)))},[te==null?void 0:te.taskSlug,Me==null?void 0:Me.claudeSessionId,Me==null?void 0:Me.effort,Me==null?void 0:Me.model,Me==null?void 0:Me.permissionMode,Me==null?void 0:Me.status,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n||!(te!=null&&te.taskSlug)||!Nn||!(se!=null&&se.claudeSessionId)||se.status==="running"||se.status==="done")return;const $=`${n.repoRoot}:${te.taskSlug}:${se.claudeSessionId}`;Rt.current!==$&&(Rt.current=$,Se.resumeTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:se.permissionMode,model:se.model,effort:se.effort}).then(pe=>{ye(pe),xt(pe)}).catch(pe=>{Rt.current="",St(pe.message)}))},[te==null?void 0:te.taskSlug,n==null?void 0:n.repoRoot,Nn,se==null?void 0:se.claudeSessionId,se==null?void 0:se.effort,se==null?void 0:se.model,se==null?void 0:se.permissionMode,se==null?void 0:se.status]),ne.useEffect(()=>{if(!n||!(te!=null&&te.taskSlug)){_(null),a(null),h(null),u(null);return}const $=te.taskSlug;Promise.all([Ht($),wi($)]).catch(We=>St(We.message));const pe=window.setInterval(()=>{Promise.all([Ht($),wi($)]).catch(We=>St(We.message))},3e3);return()=>window.clearInterval(pe)},[n==null?void 0:n.repoRoot,te==null?void 0:te.taskSlug]),ne.useEffect(()=>{if(!n||!q||!(te!=null&&te.taskSlug)||!Nn||!lr){yt.current="";return}const $=`${n.repoRoot}:${te.taskSlug}`;yt.current===$&&(se==null?void 0:se.status)==="running"||(yt.current=$,Se.ensureTranslatorSession({taskSlug:te.taskSlug}).then(pe=>{ye(pe),xt(pe)}).catch(pe=>{yt.current="",St(pe.message)}))},[n==null?void 0:n.repoRoot,te==null?void 0:te.taskSlug,q,Nn,lr]),ne.useEffect(()=>{if(!(te!=null&&te.taskSlug))return;const $=te.taskSlug,pe=window.setInterval(()=>{As($).catch(We=>St(We.message))},3e3);return()=>window.clearInterval(pe)},[te==null?void 0:te.taskSlug]);async function Ne($){ys(!0),St("");try{await $()}catch(pe){St(pe instanceof Error?pe.message:"Action failed.")}finally{ys(!1)}}const Ai=O&&O.taskSlug===(te==null?void 0:te.taskSlug)?O.messages:[],_o=F&&F.taskSlug===(te==null?void 0:te.taskSlug)?F.orchestration:null,Hl=W&&W.taskSlug===(te==null?void 0:te.taskSlug)?W.events:[],zl=V&&V.taskSlug===(te==null?void 0:te.taskSlug)?V.roundState:null,cr=J&&J.taskSlug===(te==null?void 0:te.taskSlug)?J.state:null,Il=!!(cr&&Object.values(cr.gates).some($=>$.required));return T.jsxs(k1,{sidebar:T.jsx(GE,{project:n,recentRepositoryPaths:s,tasks:R,activeTaskSlug:(te==null?void 0:te.taskSlug)??null,messages:Ai,orchestration:_o,events:Hl,roundState:zl,gateReview:cr,translationEnabled:ei,translationAutoSendEnabled:ce,translationTargetLanguage:re,translationOutputMode:Ee,translationMemoryInitialized:dt,translatorSession:se,harnessStatus:bs,harnessBootstrapStatus:Cs,harnessApplyResult:b,gatewayStatus:A,gatewayQrLogin:y,gatewayQrCheck:m,busy:sr,onConnect:$=>Ne(async()=>{const pe=await Se.connectProject({repoPath:$});r(pe),C(null),await Promise.all([Qt(),ks()])}),onRefreshConnectedRepository:()=>Ne(async()=>{const $=await Se.getCurrentProject();r($)}),onPullConnectedRepository:()=>Ne(async()=>{const $=await Se.pullCurrentProject();r($)}),onRefreshHarness:()=>Ne(async()=>{if(!te)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([Ht(te.taskSlug),wi(te.taskSlug)])}),onApplyHarness:()=>Ne(async()=>{if(!te)throw new Error("Create or select a task before applying VCM Harness.");const $=await Se.applyHarness({taskSlug:te.taskSlug});C($),await Promise.all([Ht(te.taskSlug),wi(te.taskSlug)])}),onStartHarnessBootstrap:$=>Ne(async()=>{if(!te)throw new Error("Create or select a task before starting Harness Bootstrap.");const pe=await Se.startHarnessBootstrap({taskSlug:te.taskSlug,cols:120,rows:32,...$});a(pe.status),u(te.taskSlug),await zn({syncLaunchOptions:!0})}),onRestartHarnessBootstrap:$=>Ne(async()=>{if(!te)throw new Error("Create or select a task before restarting Harness Bootstrap.");const pe=await Se.restartHarnessBootstrap({taskSlug:te.taskSlug,cols:120,rows:32,...$});a(pe.status),u(te.taskSlug),await zn({syncLaunchOptions:!0})}),onStopHarnessBootstrap:()=>Ne(async()=>{const $=await Se.stopHarnessBootstrap();a($),u((te==null?void 0:te.taskSlug)??null),await zn()}),onRunHarnessBootstrap:()=>Ne(async()=>{if(!te)throw new Error("Create or select a task before running Harness Bootstrap.");const $=await Se.runHarnessBootstrap({taskSlug:te.taskSlug});a($.status),u(te.taskSlug),await zn()}),onOpenHarnessStudio:()=>wt(!0),onOpenRepositoryDiff:()=>At(!0),onRefreshGateway:()=>Ne(async()=>{await Es()}),onGatewayEnabledChange:$=>{Ne(async()=>{const[pe,We]=await Promise.all([Se.updateGatewaySettings({enabled:$,...$&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(te==null?void 0:te.taskSlug)??null}:{}}),$?Se.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);We&&Dt(We),$&&Mr(),x(pe)})},onGatewayTranslationChange:$=>{Ne(async()=>{const pe=await Se.updateGatewaySettings({translationEnabled:$});x(pe)})},onStartGatewayQrLogin:()=>{Ne(async()=>{const $=await Se.startGatewayQrLogin();v($),S(null),M(!0),await Es()})},onResetGatewayBinding:()=>{Ne(async()=>{const $=await Se.resetGatewayBinding();x($),v(null),S(null),M(!1)})},onGateReviewGateEnabledChange:($,pe)=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before changing Gate Review Gates.");const We=await Se.updateGateReviewSettings(te.taskSlug,{gates:{[$]:pe}});z({taskSlug:te.taskSlug,state:We})})},onTranslationEnabledChange:$=>{fe($),Ne(async()=>{const pe=await Se.updateAppPreferences({translationEnabled:$});Dt(pe)})},onTranslationAutoSendChange:$=>{de($),Ne(async()=>{const pe=await Se.updateAppPreferences({translationAutoSendEnabled:$});Dt(pe)})},onTranslationTargetLanguageChange:$=>{Ce($),Ne(async()=>{const pe=await Se.updateAppPreferences({translationTargetLanguage:$});Dt(pe)})},onTranslationOutputModeChange:$=>{xe($),Ne(async()=>{const pe=await Se.updateAppPreferences({translationOutputMode:$});Dt(pe)})},onOpenFileTranslation:()=>qt(!0),onOpenTranslatorSession:()=>tn(!0),onCreateTranslationBootstrap:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before running Translation Bootstrap.");await Se.createTranslationBootstrap({taskSlug:te.taskSlug,targetLanguage:re}),await or(),await Ei()})},onUpdateTranslationMemory:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before updating translation memory.");await Se.createTranslationMemoryUpdate({taskSlug:te.taskSlug,targetLanguage:re}),await or(),await Ei()})},onCreateTask:$=>Ne(async()=>{const pe=await Se.createTask($);await Qt(),L(pe.taskSlug),await As(pe.taskSlug)}),onSelectTask:L,themeMode:G,onThemeModeChange:$=>{N($),Ne(async()=>{const pe=await Se.updateAppPreferences({themeMode:$});Dt(pe)})},flowPauseAlerts:Z,onFlowPauseAlertsChange:$=>{if(A!=null&&A.enabled){Mr();return}ue($),$&&b2(),Ne(async()=>{const pe=await Se.updateAppPreferences({flowPauseAlerts:$});Dt(pe)})},permissionRequestMode:ve,onPermissionRequestModeChange:$=>{X($),Ne(async()=>{const pe=await Se.updateAppPreferences({permissionRequestMode:$});Dt(pe)})},launchTemplate:qn,canSaveLaunchTemplate:bi,canOneClickStart:ar,onSaveLaunchTemplate:()=>{Ne(async()=>{if(!(Xt!=null&&Xt.allRolesHaveSession))throw new Error("Start all core role sessions before saving a launch template.");const $=await Se.updateAppPreferences({launchTemplate:{version:1,roles:Xt.roles,autoOrchestration:Xt.autoOrchestration}});Dt($)})},onOneClickStart:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before one-click start.");const $=await Se.getTaskStatus(te.taskSlug);if($.sessions.some(st=>S1.some(ti=>ti===st.role)))throw new Error("One-click start is only available before any role session has started.");const pe=await Se.updateOrchestrationState(te.taskSlug,{mode:qn.autoOrchestration?"auto":"manual"});U({taskSlug:te.taskSlug,orchestration:pe});const We=LE(qn,{gateReviewerEnabled:Il});for(const st of We){const ti={cols:100,rows:28,permissionMode:st.permissionMode,model:st.model,effort:st.effort},dn=$.sessions.find(Ti=>Ti.role===st.role);if((dn==null?void 0:dn.status)==="running"){st.role==="gate-reviewer"&&await Se.resumeRoleSession(te.taskSlug,st.role,ti);continue}dn!=null&&dn.claudeSessionId?await Se.resumeRoleSession(te.taskSlug,st.role,ti):await Se.startRoleSession(te.taskSlug,st.role,ti)}H("project-manager"),await xi(te.taskSlug),await Qt(),Ll(st=>st+1)})},onTryFlowPauseAlert:()=>{Hn("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:$=>{Ne(async()=>{const pe=await Se.markAllMessagesDone($);I({taskSlug:$,messages:pe.messages}),await xi($)})},onDeleteMessageHistory:$=>{Ne(async()=>{const pe=await Se.deleteMessageHistory($);I({taskSlug:$,messages:pe.messages}),await xi($)})}}),children:[Dr?T.jsx("div",{className:"error-banner",children:Dr}):null,Rr?T.jsx("div",{className:"flow-pause-alert-backdrop",children:T.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:[T.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),T.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),T.jsx("p",{id:"flow-pause-alert-body",children:Rr.text}),T.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."}),T.jsx("button",{type:"button",autoFocus:!0,onClick:Ci,children:"Confirm"})]})}):null,k&&y?T.jsx(_2,{busy:sr,qrCheck:m,qrLogin:y,onCheck:()=>{Ne(async()=>{const $=await Se.checkGatewayQrLogin();S($),($.status==="confirmed"||$.status==="binded_redirect")&&M(!1),await Es()})},onClose:()=>M(!1)}):null,n&&te?T.jsx(h2,{task:te,activeRole:j,gateReviewerEnabled:Il,translationEnabled:ei,translationAutoSendEnabled:ce,translationTargetLanguage:re,refreshNonce:mo,onTaskChanged:async()=>{await Qt()},onActiveRoleChange:H,onBeforeCloseTask:ki,onMessagesChanged:jl,onOrchestrationChanged:Nl,onRoundStateChanged:Lr,onEventsChanged:go,onLaunchStateChanged:Or}):T.jsxs("section",{className:"empty-workspace",children:[T.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),T.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."})]}),T.jsx(gE,{open:en,taskSlug:(te==null?void 0:te.taskSlug)??null,targetLanguage:re,onClose:()=>qt(!1)}),T.jsx(N1,{open:wn,busy:sr,status:bs,bootstrapStatus:Cs,engineerSession:Me,permissionMode:qe,model:Tt,effort:On,taskSlug:(te==null?void 0:te.taskSlug)??null,onClose:()=>wt(!1),onRefresh:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Ht(te.taskSlug),wi(te.taskSlug),zn()])})},onPermissionModeChange:nn,onModelChange:Yt,onEffortChange:ze,onEngineerStart:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before starting Harness Engineer.");const $=await Se.startHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:On});ht($),Vn($)})},onEngineerResume:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before resuming Harness Engineer.");const $=await Se.resumeHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:On});ht($),Vn($)})},onEngineerRestart:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before restarting Harness Engineer.");const $=await Se.restartHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:On});ht($),Vn($)})},onEngineerStop:()=>{Ne(async()=>{const $=await Se.stopHarnessEngineerSession();ht($)})},onEngineerNotifyHarnessUpdated:()=>{Ne(async()=>{const $=await Se.notifyHarnessEngineerHarnessUpdated();ht($),Vn($)})},onOpenRepositoryDiff:()=>At(!0)}),T.jsx(H1,{open:pt,taskSlug:(te==null?void 0:te.taskSlug)??null,onClose:()=>At(!1)}),T.jsx(F1,{open:Kt,busy:sr,session:se,permissionMode:ke,model:je,effort:Ue,onClose:()=>tn(!1),onPermissionModeChange:Be,onModelChange:mt,onEffortChange:et,onStart:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before starting Translator.");const $=await Se.startTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:ke,model:je,effort:Ue});ye($),xt($)})},onResume:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before resuming Translator.");const $=await Se.resumeTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:ke,model:je,effort:Ue});ye($),xt($)})},onRestart:()=>{Ne(async()=>{if(!te)throw new Error("Create or select a task before restarting Translator.");const $=await Se.restartTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:ke,model:je,effort:Ue});ye($),xt($)})},onStop:()=>{Ne(async()=>{const $=await Se.stopTranslatorSession();ye($)})},onNotifyHarnessUpdated:()=>{Ne(async()=>{const $=await Se.notifyTranslatorHarnessUpdated();ye($),xt($)})}})]})}function _2({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[_,f]=ne.useState(""),[a,c]=ne.useState("");return ne.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const g=gs(0,"M");g.addData(d.qrcodeUrl),g.make(),h||f(g.createDataURL(8,2))}catch(g){h||c(g instanceof Error?g.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),T.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),T.jsx("button",{type:"button",onClick:s,children:"Close"})]}),T.jsxs("div",{className:"gateway-qr-modal-body",children:[T.jsx("div",{className:"gateway-qr-code-frame",children:_?T.jsx("img",{alt:"Weixin Gateway QR login",src:_}):T.jsx("div",{className:"gateway-qr-placeholder",children:a||"Rendering QR code..."})}),T.jsxs("dl",{className:"gateway-qr-meta",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Status"}),T.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Expires"}),T.jsx("dd",{children:v2(d.expiresAt)})]}),o!=null&&o.message?T.jsxs("div",{children:[T.jsx("dt",{children:"Message"}),T.jsx("dd",{children:o.message})]}):null]})]}),T.jsx("footer",{children:T.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function v2(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 nr=null;function y2(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 S2(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function b2(){const n=W_();return n?K_(n):!1}async function eo(){const n=W_();if(!n||!await K_(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Ag(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),Ag(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function W_(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!nr||nr.state==="closed")&&(nr=new n),nr}catch{return null}}function C2(){ih(nr)}function ih(n){nr=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function K_(n){if(kg(n))return!0;try{await n.resume();const r=kg(n);return!r&&n===nr&&ih(n),r}catch{return n===nr&&ih(n),!1}}function kg(n){return n.state==="running"}function Ag(n,r,s){const o=n.createGain(),d=n.createOscillator(),_=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),_.type="triangle",_.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),_.connect(o),o.connect(r),d.start(s.startAt),_.start(s.startAt),d.stop(f+.02),_.stop(f+.02)}const Y_=document.getElementById("root");if(!Y_)throw new Error("Missing #root element.");c1.createRoot(Y_).render(T.jsx(ne.StrictMode,{children:T.jsx(g2,{})}));
94
+ `))&&_()}return T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{children:"Messages"}),T.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),T.jsxs("div",{className:"modal-actions",children:[T.jsx("button",{type:"button",disabled:n,onClick:a,children:"Mark All Done"}),T.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),T.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),T.jsx(z2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function vi({children:n,onOpenChange:r,open:s,title:o}){return T.jsxs("section",{className:"sidebar-section",children:[T.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[T.jsx("span",{children:o}),T.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?T.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function $_(n,r){return n.find(s=>s.role===r)}function lE({activeRole:n,roles:r=lh,sessions:s,onSelect:o}){return T.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const _=$_(s,d.name),f=(_==null?void 0:_.status)==="running"?_.activityStatus??"idle":(_==null?void 0:_.status)??"not_started";return T.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[T.jsx("span",{children:d.label}),T.jsx(yi,{status:f})]},d.name)})})}function aE({role:n,session:r,permissionMode:s,model:o,effort:d,active:_=!0,busy:f,translationEnabled:a,translationAutoSendEnabled:c,translationTargetLanguage:h,onPermissionModeChange:g,onModelChange:u,onEffortChange:b,onStart:C,onResume:A,onStop:x,onRestart:y,onNotifyHarnessUpdated:v,onTerminalEvent:m}){const S=b1(n)&&a&&(r==null?void 0:r.status)==="running";return T.jsx("section",{className:"session-console",children:T.jsxs("div",{className:S?"session-console-body has-translation":"session-console-body",children:[T.jsxs("div",{className:"terminal-pane",children:[T.jsx(ah,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:g,onModelChange:u,onEffortChange:b,onStart:C,onResume:A,onStop:x,onRestart:y,onNotifyHarnessUpdated:v}),(r==null?void 0:r.status)==="running"?T.jsx(oo,{sessionId:r.id,active:_,onEvent:m},r.id):T.jsxs("div",{className:"terminal-empty",children:[T.jsx("strong",{children:n}),T.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."})]})]}),S?T.jsx("div",{className:"translation-pane",children:T.jsx(p2,{active:_,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id},r.id)}):null]})})}function oE(n,r,s){var _;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var a;return f.dispatchingAt?((a=o.get(f.id))==null?void 0:a.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((_=d.sort(cE)[d.length-1])==null?void 0:_.toRole)??null}function cE(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const uE=2e3;function hE({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,refreshNonce:f=0,onTaskChanged:a,onActiveRoleChange:c,onBeforeCloseTask:h,onMessagesChanged:g,onOrchestrationChanged:u,onRoundStateChanged:b,onEventsChanged:C,onLaunchStateChanged:A}){const[x,y]=ie.useState(null),[v,m]=ie.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[S,k]=ie.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[M,R]=ie.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"}),[D,E]=ie.useState(!1),[L,O]=ie.useState(""),[I,F]=ie.useState([]),[U,W]=ie.useState(null),Y=ie.useRef(null),V=ie.useRef(""),K=!!(x!=null&&x.sessions.some(de=>de.role==="gate-reviewer")),J=s||K,z=[...ps,...J?[Dg]:[]],j=ie.useCallback((de,se)=>{var Ee;const Ce=((Ee=Y.current)==null?void 0:Ee.taskSlug)===n.taskSlug?Y.current.messages:null,ke=oE(Ce,de,se);Y.current={taskSlug:n.taskSlug,messages:de},W(se),g==null||g(de),u==null||u(se),ke&&(c(ke),ue(`auto switched to ${ke} before VCM dispatch`))},[c,g,u,n.taskSlug]),H=ie.useCallback((de,se,Ce,ke)=>{y(de),j(se,Ce),b==null||b(ke)},[j,b]),G=ie.useCallback(async()=>{const[de,se,Ce,ke]=await Promise.all([Se.getTaskStatus(n.taskSlug),Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug),Se.getSessionRoundState(n.taskSlug)]);H(de,se,Ce,ke)},[H,n.taskSlug]);ie.useEffect(()=>{G().catch(de=>O(de.message))},[G,f]),ie.useEffect(()=>{F([]),C==null||C([])},[C,n.taskSlug]),ie.useEffect(()=>{x&&!J&&r==="gate-reviewer"&&c("project-manager"),x&&r==="translator"&&c("project-manager")},[r,J,c,x]),ie.useEffect(()=>{const de=x==null?void 0:x.task;if(!de||de.taskSlug!==n.taskSlug)return;const se=xg(de);if(se===xg(n)){V.current="";return}V.current!==se&&(V.current=se,a().catch(Ce=>{V.current="",O(Ce.message)}))},[a,x==null?void 0:x.task,n]),ie.useEffect(()=>{m(de=>{let se=!1;const Ce={...de};for(const ke of(x==null?void 0:x.sessions)??[])Ce[ke.role]!==ke.permissionMode&&(Ce[ke.role]=ke.permissionMode,se=!0);return se?Ce:de})},[x==null?void 0:x.sessions]),ie.useEffect(()=>{k(de=>{let se=!1;const Ce={...de};for(const ke of(x==null?void 0:x.sessions)??[]){const Ee=ke.model??"default";Ce[ke.role]!==Ee&&(Ce[ke.role]=Ee,se=!0)}return se?Ce:de})},[x==null?void 0:x.sessions]),ie.useEffect(()=>{R(de=>{let se=!1;const Ce={...de};for(const ke of(x==null?void 0:x.sessions)??[]){const Ee=ke.effort??"default";Ce[ke.role]!==Ee&&(Ce[ke.role]=Ee,se=!0)}return se?Ce:de})},[x==null?void 0:x.sessions]),ie.useEffect(()=>{const se=((x==null?void 0:x.sessions)??[]).filter(Ee=>fE(Ee.role)),Ce=new Set(se.map(Ee=>Ee.role)),ke={};for(const Ee of sh)ke[Ee.name]={permissionMode:v[Ee.name],model:S[Ee.name],effort:M[Ee.name]};A==null||A({taskSlug:n.taskSlug,roles:ke,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!x,sessionCount:se.length,hasAnySession:se.length>0,allRolesHaveSession:ps.every(Ee=>Ce.has(Ee.name))})},[S,M,A,U==null?void 0:U.mode,v,x,n.taskSlug]),ie.useEffect(()=>{const de=window.setInterval(()=>{Promise.all([Se.getTaskStatus(n.taskSlug),Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug),Se.getSessionRoundState(n.taskSlug)]).then(([se,Ce,ke,Ee])=>{H(se,Ce,ke,Ee)}).catch(se=>O(se.message))},3e3);return()=>window.clearInterval(de)},[H,n.taskSlug]),ie.useEffect(()=>{let de=!1,se=!1;const Ce=window.setInterval(()=>{se||(se=!0,Promise.all([Se.listMessages(n.taskSlug),Se.getOrchestrationState(n.taskSlug)]).then(([ke,Ee])=>{de||j(ke,Ee)}).catch(ke=>{de||O(ke.message)}).finally(()=>{se=!1}))},uE);return()=>{de=!0,window.clearInterval(Ce)}},[j,n.taskSlug]);async function N(de){E(!0),O("");try{await de(),await G(),await a()}catch(se){O(se instanceof Error?se.message:"Action failed.")}finally{E(!1)}}async function Z(){const de=[`Close task "${n.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: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
95
+ `);if(window.confirm(de)){E(!0),O("");try{await(h==null?void 0:h()),await Se.cleanupTask(n.taskSlug,{force:!0,forceDeleteBranch:!0}),ue(`closed ${n.taskSlug}`),await a()}catch(Ce){O(Ce instanceof Error?Ce.message:"Close task failed.")}finally{E(!1)}}}function ue(de){F(se=>{const Ce=[...se,`${new Date().toLocaleTimeString()} ${de}`];return C==null||C(Ce),Ce})}function ve(de,se){m(Ce=>({...Ce,[de]:se}))}function X(de,se){k(Ce=>({...Ce,[de]:se}))}function q(de,se){R(Ce=>({...Ce,[de]:se}))}async function fe(de){E(!0),O("");try{const se=await Se.updateOrchestrationState(n.taskSlug,{mode:de});W(se),u==null||u(se),ue(`auto orchestration ${de==="auto"?"enabled":"disabled"}`)}catch(se){O(se instanceof Error?se.message:"Failed to update orchestration mode.")}finally{E(!1)}}const ce=((U==null?void 0:U.mode)??"auto")==="auto";return T.jsxs("div",{className:"task-workspace",children:[T.jsxs("header",{className:"workspace-header",children:[T.jsx("div",{className:"workspace-title-line",children:T.jsx("h1",{children:n.title||n.taskSlug})}),T.jsx(lE,{activeRole:r,roles:z,sessions:(x==null?void 0:x.sessions)??[],onSelect:c}),T.jsxs("div",{className:"workspace-header-actions",children:[T.jsxs("button",{"aria-label":`Auto orchestration is ${ce?"on":"off"}`,"aria-pressed":ce,className:`orchestration-toggle${ce?" is-active":""}`,disabled:D,type:"button",onClick:()=>void fe(ce?"manual":"auto"),children:[T.jsx("span",{children:"Auto orchestration"}),T.jsx("strong",{children:ce?"on":"off"})]}),T.jsx("button",{className:"danger-button",type:"button",disabled:D,onClick:()=>void Z(),children:"Close Task"})]})]}),L?T.jsx("div",{className:"error-banner",children:L}):null,T.jsx("div",{className:"workspace-grid",children:T.jsx("div",{className:"workspace-main",children:T.jsx("div",{className:"role-console-stack",children:z.map(de=>{const se=de.name,Ce=se===r,ke=$_((x==null?void 0:x.sessions)??[],se);return T.jsx("div",{className:Ce?"role-console-panel is-active":"role-console-panel","aria-hidden":!Ce,children:T.jsx(aE,{role:se,session:ke,permissionMode:v[se],model:S[se],effort:M[se],active:Ce,busy:D,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,onPermissionModeChange:Ee=>ve(se,Ee),onModelChange:Ee=>X(se,Ee),onEffortChange:Ee=>q(se,Ee),onStart:()=>void N(async()=>{await Se.startRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:S[se],effort:M[se]}),ue(`started ${se} with ${v[se]} / ${S[se]} / ${M[se]}`)}),onResume:()=>void N(async()=>{await Se.resumeRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:S[se],effort:M[se]}),ue(`resumed ${se} with ${v[se]} / ${S[se]} / ${M[se]}`)}),onStop:()=>void N(async()=>{await Se.stopRoleSession(n.taskSlug,se),ue(`stopped ${se}`)}),onRestart:()=>void N(async()=>{await Se.restartRoleSession(n.taskSlug,se,{cols:100,rows:28,permissionMode:v[se],model:S[se],effort:M[se]}),ue(`restarted ${se} with ${v[se]} / ${S[se]} / ${M[se]}`)}),onNotifyHarnessUpdated:()=>void N(async()=>{await Se.notifyRoleHarnessUpdated(n.taskSlug,se),ue(`notified ${se} to reload latest harness`)}),onTerminalEvent:Ee=>ue(`${de.label}: ${Ee}`)})},se)})})})})]})}function fE(n){return ps.some(r=>r.name===n)}function xg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}const dE=120*1e3,Eg=1400,pE=3;function mE(n){return!!(n!=null&&n.initialized)}function gE(){const[n,r]=ie.useState(null),[s,o]=ie.useState([]),[d,_]=ie.useState(null),[f,a]=ie.useState(null),[c,h]=ie.useState(null),[g,u]=ie.useState(null),[b,C]=ie.useState(null),[A,x]=ie.useState(null),[y,v]=ie.useState(null),[m,S]=ie.useState(null),[k,M]=ie.useState(!1),[R,D]=ie.useState([]),[E,L]=ie.useState(null),[O,I]=ie.useState(null),[F,U]=ie.useState(null),[W,Y]=ie.useState(null),[V,K]=ie.useState(null),[J,z]=ie.useState(null),[j,H]=ie.useState("project-manager"),[G,N]=ie.useState("system"),[Z,ue]=ie.useState(!0),[ve,X]=ie.useState("off"),[q,fe]=ie.useState(!1),[ce,de]=ie.useState(!1),[se,Ce]=ie.useState(C1),[ke,Ee]=ie.useState(w1),[ht,De]=ie.useState(!1),[tn,qt]=ie.useState(!1),[Kt,nn]=ie.useState(!1),[xn,wt]=ie.useState(!1),[ft,At]=ie.useState(!1),[ne,ye]=ie.useState(null),[Ae,Be]=ie.useState("default"),[Ne,dt]=ie.useState("default"),[Ue,Je]=ie.useState("medium"),[we,ct]=ie.useState(null),[qe,rn]=ie.useState("default"),[Tt,Yt]=ie.useState("default"),[Bn,ze]=ie.useState("medium"),[Fn,Jn]=ie.useState(()=>E1()),[ei,nr]=ie.useState(null),[mo,Ol]=ie.useState(0),[kr,qn]=ie.useState(null),[Bl,jl]=ie.useState(!1),[ir,ys]=ie.useState(!1),[Ar,gt]=ie.useState(""),Ss=ie.useRef({}),jn=ie.useRef(null),sn=ie.useRef(""),yt=ie.useRef(""),jt=ie.useRef(""),Gn=ie.useRef(""),ee=ie.useMemo(()=>M2(R,E),[R,E]),Xt=(ei==null?void 0:ei.taskSlug)===(ee==null?void 0:ee.taskSlug)?ei:null,bs=c===(ee==null?void 0:ee.taskSlug)?d:null,Cs=g===(ee==null?void 0:ee.taskSlug)?f:null,pn=!!(n&&ee&&mE(bs)),rr=(ne==null?void 0:ne.status)==="running",ti=!!(q&&pn&&rr),bi=!!(Xt!=null&&Xt.statusLoaded&&Xt.allRolesHaveSession),sr=!!(ee&&(Xt!=null&&Xt.statusLoaded)&&!Xt.hasAnySession),Rt=ie.useCallback($=>{N($.themeMode),ue($.flowPauseAlerts),X($.permissionRequestMode),fe($.translationEnabled),de($.translationAutoSendEnabled),Ce($.translationTargetLanguage),Ee($.translationOutputMode),Jn($.launchTemplate)},[]),tt=ie.useCallback(()=>{jn.current!==null&&(window.clearInterval(jn.current),jn.current=null)},[]),ws=ie.useCallback(($={})=>{tt(),$.resetAudio&&CE(),eo(),jn.current=window.setInterval(()=>{eo()},Eg)},[tt]),xs=ie.useCallback(()=>{tt(),qn(null);let $=1;eo(),jn.current=window.setInterval(()=>{$+=1,eo(),$>=pE&&jn.current!==null&&(window.clearInterval(jn.current),jn.current=null)},Eg)},[tt]),Nn=ie.useCallback(($,me=`manual-${Date.now()}`,_t={})=>{qn({id:me,text:$}),ws(_t)},[ws]),Ci=ie.useCallback(()=>{tt(),qn(null)},[tt]),Tr=ie.useCallback(()=>{tt(),qn(null),ue(!1)},[tt]),Nl=ie.useCallback($=>{ee!=null&&ee.taskSlug&&I({taskSlug:ee.taskSlug,messages:$})},[ee==null?void 0:ee.taskSlug]),Hl=ie.useCallback($=>{ee!=null&&ee.taskSlug&&U({taskSlug:ee.taskSlug,orchestration:$})},[ee==null?void 0:ee.taskSlug]),go=ie.useCallback($=>{ee!=null&&ee.taskSlug&&Y({taskSlug:ee.taskSlug,events:$})},[ee==null?void 0:ee.taskSlug]),Rr=ie.useCallback($=>{if(!(ee!=null&&ee.taskSlug)||$.taskSlug!==ee.taskSlug||(K({taskSlug:$.taskSlug,roundState:$}),$.status!=="stopped"||!$.roundId))return;const me=SE($);if(Ss.current[$.taskSlug]===me||(Ss.current[$.taskSlug]=me,!Z))return;const St=$.activeRole??"role";yE($)>=dE?Nn(`No new turn started after ${St} stopped.`,me):xs()},[ee==null?void 0:ee.taskSlug,Z,xs,Nn]),Dr=ie.useCallback($=>{nr(me=>(me==null?void 0:me.taskSlug)===$.taskSlug&&me.statusLoaded===$.statusLoaded&&me.sessionCount===$.sessionCount&&me.hasAnySession===$.hasAnySession&&me.allRolesHaveSession===$.allRolesHaveSession&&me.autoOrchestration===$.autoOrchestration&&JSON.stringify(me.roles)===JSON.stringify($.roles)?me:$)},[]);async function Qt(){const $=await Se.listTasks();return D($),L(me=>{var _t;return me&&$.some(St=>St.taskSlug===me)?me:((_t=$[0])==null?void 0:_t.taskSlug)??null}),$}async function Ht($=ee==null?void 0:ee.taskSlug){if(!$)return _(null),h(null),null;const me=await Se.getHarnessStatus($);return _(me),h($),me}async function wi($=ee==null?void 0:ee.taskSlug){if(!$)return a(null),u(null),null;const me=await Se.getHarnessBootstrapStatus($);return a(me),u($),me}async function Es(){const $=await Se.getGatewayStatus();return x($),$}async function ks(){const $=await Se.getRecentRepositoryPaths();return o($),$}async function lr(){if(!n)return De(!1),!1;const $=await Se.getTranslationState();return De($.memoryInitialized),$.memoryInitialized}async function xi($){const[me,_t]=await Promise.all([Se.listMessages($),Se.getOrchestrationState($)]);I({taskSlug:$,messages:me}),U({taskSlug:$,orchestration:_t})}async function As($){const me=await Se.getGateReviewState($);return z({taskSlug:$,state:me}),me}function xt($){$&&(Be($.permissionMode),$.model&&dt($.model),$.effort&&Je($.effort))}async function Ei($={}){const me=await Se.getTranslatorSession();return ye(me),$.syncLaunchOptions&&xt(me),me}function Vn($){$&&(rn($.permissionMode),$.model&&Yt($.model),$.effort&&ze($.effort))}async function Hn($={}){const me=await Se.getHarnessEngineerSession();return ct(me),$.syncLaunchOptions&&Vn(me),me}ie.useEffect(()=>{Promise.all([Se.getCurrentProject(),Se.getRecentRepositoryPaths(),Se.getAppPreferences(),Se.getGatewayStatus()]).then(async([$,me,_t,St])=>{r($),o(me),x(St),Rt(_t),$&&await Qt()}).catch($=>gt($.message))},[Rt]),ie.useEffect(()=>{const $=window.matchMedia("(prefers-color-scheme: dark)"),me=()=>jl($.matches);return me(),$.addEventListener("change",me),()=>$.removeEventListener("change",me)},[]),ie.useEffect(()=>()=>tt(),[tt]),ie.useEffect(()=>{const $=G==="system"?Bl?"dark":"light":G;document.documentElement.dataset.theme=$,document.documentElement.dataset.themeMode=G},[Bl,G]),ie.useEffect(()=>{!(A!=null&&A.enabled)||!Z||(Tr(),Se.updateAppPreferences({flowPauseAlerts:!1}).then($=>Rt($)).catch($=>gt($.message)))},[Rt,Tr,Z,A==null?void 0:A.enabled]),ie.useEffect(()=>{if(!(A!=null&&A.enabled)||!n||!ee)return;const $=`${n.repoRoot}:${ee.taskSlug}`;if(A.currentProjectId===n.repoRoot&&A.currentTaskSlug===ee.taskSlug){sn.current=$;return}sn.current!==$&&(sn.current=$,Se.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:ee.taskSlug}).then(me=>x(me)).catch(me=>{sn.current===$&&(sn.current=""),gt(me.message)}))},[ee==null?void 0:ee.taskSlug,A==null?void 0:A.currentProjectId,A==null?void 0:A.currentTaskSlug,A==null?void 0:A.enabled,n==null?void 0:n.repoRoot]),ie.useEffect(()=>{if(!(ee!=null&&ee.taskSlug)){z(null);return}As(ee.taskSlug).catch($=>gt($.message))},[ee==null?void 0:ee.taskSlug]),ie.useEffect(()=>{yt.current="",jt.current="",Gn.current="",ye(null),Be("default"),dt("default"),Je("medium"),De(!1),ct(null),rn("default"),Yt("default"),ze("medium"),_(null),a(null),h(null),u(null)},[n==null?void 0:n.repoRoot]),ie.useEffect(()=>{if(!n){De(!1);return}Ei({syncLaunchOptions:!0}).catch(me=>gt(me.message)),lr().catch(me=>gt(me.message));const $=window.setInterval(()=>{Ei().catch(me=>gt(me.message)),lr().catch(me=>gt(me.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ie.useEffect(()=>{if(!n)return;Hn({syncLaunchOptions:!0}).catch(me=>gt(me.message));const $=window.setInterval(()=>{Hn().catch(me=>gt(me.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ie.useEffect(()=>{if(!n||!(ee!=null&&ee.taskSlug)||!(we!=null&&we.claudeSessionId)||we.status==="running"||we.status==="done")return;const $=`${n.repoRoot}:${ee.taskSlug}:${we.claudeSessionId}`;Gn.current!==$&&(Gn.current=$,Se.resumeHarnessEngineerSession({taskSlug:ee.taskSlug,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(me=>{ct(me),Vn(me)}).catch(me=>gt(me.message)))},[ee==null?void 0:ee.taskSlug,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,n==null?void 0:n.repoRoot]),ie.useEffect(()=>{!n||!(ee!=null&&ee.taskSlug)||!(we!=null&&we.claudeSessionId)||we.status!=="running"||we.cwd===ee.worktreePath||Se.ensureHarnessEngineerSession({taskSlug:ee.taskSlug,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then($=>{ct($),Vn($)}).catch($=>gt($.message))},[ee==null?void 0:ee.taskSlug,ee==null?void 0:ee.worktreePath,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,n==null?void 0:n.repoRoot]),ie.useEffect(()=>{if(!n||!(ee!=null&&ee.taskSlug)||!pn||!(ne!=null&&ne.claudeSessionId)||ne.status==="running"||ne.status==="done")return;const $=`${n.repoRoot}:${ee.taskSlug}:${ne.claudeSessionId}`;jt.current!==$&&(jt.current=$,Se.resumeTranslatorSession({taskSlug:ee.taskSlug,cols:100,rows:28,permissionMode:ne.permissionMode,model:ne.model,effort:ne.effort}).then(me=>{ye(me),xt(me)}).catch(me=>{jt.current="",gt(me.message)}))},[ee==null?void 0:ee.taskSlug,n==null?void 0:n.repoRoot,pn,ne==null?void 0:ne.claudeSessionId,ne==null?void 0:ne.cwd,ne==null?void 0:ne.effort,ne==null?void 0:ne.model,ne==null?void 0:ne.permissionMode,ne==null?void 0:ne.status]),ie.useEffect(()=>{!n||!(ee!=null&&ee.taskSlug)||!pn||!(ne!=null&&ne.claudeSessionId)||ne.status!=="running"||ne.cwd===ee.worktreePath||Se.ensureTranslatorSession({taskSlug:ee.taskSlug,cols:100,rows:28,permissionMode:ne.permissionMode,model:ne.model,effort:ne.effort}).then($=>{ye($),xt($)}).catch($=>gt($.message))},[ee==null?void 0:ee.taskSlug,ee==null?void 0:ee.worktreePath,n==null?void 0:n.repoRoot,pn,ne==null?void 0:ne.claudeSessionId,ne==null?void 0:ne.cwd,ne==null?void 0:ne.effort,ne==null?void 0:ne.model,ne==null?void 0:ne.permissionMode,ne==null?void 0:ne.status]),ie.useEffect(()=>{if(!n||!(ee!=null&&ee.taskSlug)){_(null),a(null),h(null),u(null);return}const $=ee.taskSlug;Promise.all([Ht($),wi($)]).catch(_t=>gt(_t.message));const me=window.setInterval(()=>{Promise.all([Ht($),wi($)]).catch(_t=>gt(_t.message))},3e3);return()=>window.clearInterval(me)},[n==null?void 0:n.repoRoot,ee==null?void 0:ee.taskSlug]),ie.useEffect(()=>{if(!n||!q||!(ee!=null&&ee.taskSlug)||!pn||!rr){yt.current="";return}const $=`${n.repoRoot}:${ee.taskSlug}`;yt.current===$&&(ne==null?void 0:ne.status)==="running"||(yt.current=$,Se.ensureTranslatorSession({taskSlug:ee.taskSlug}).then(me=>{ye(me),xt(me)}).catch(me=>{yt.current="",gt(me.message)}))},[n==null?void 0:n.repoRoot,ee==null?void 0:ee.taskSlug,q,pn,rr]),ie.useEffect(()=>{if(!(ee!=null&&ee.taskSlug))return;const $=ee.taskSlug,me=window.setInterval(()=>{As($).catch(_t=>gt(_t.message))},3e3);return()=>window.clearInterval(me)},[ee==null?void 0:ee.taskSlug]);async function je($){ys(!0),gt("");try{await $()}catch(me){gt(me instanceof Error?me.message:"Action failed.")}finally{ys(!1)}}const zl=O&&O.taskSlug===(ee==null?void 0:ee.taskSlug)?O.messages:[],Il=F&&F.taskSlug===(ee==null?void 0:ee.taskSlug)?F.orchestration:null,ki=W&&W.taskSlug===(ee==null?void 0:ee.taskSlug)?W.events:[],_o=V&&V.taskSlug===(ee==null?void 0:ee.taskSlug)?V.roundState:null,Mr=J&&J.taskSlug===(ee==null?void 0:ee.taskSlug)?J.state:null,Ts=!!(Mr&&Object.values(Mr.gates).some($=>$.required));return T.jsxs(k1,{sidebar:T.jsx(G2,{project:n,recentRepositoryPaths:s,tasks:R,activeTaskSlug:(ee==null?void 0:ee.taskSlug)??null,messages:zl,orchestration:Il,events:ki,roundState:_o,gateReview:Mr,translationEnabled:ti,translationAutoSendEnabled:ce,translationTargetLanguage:se,translationOutputMode:ke,translationMemoryInitialized:ht,translatorSession:ne,harnessStatus:bs,harnessBootstrapStatus:Cs,harnessApplyResult:b,gatewayStatus:A,gatewayQrLogin:y,gatewayQrCheck:m,busy:ir,onConnect:$=>je(async()=>{const me=await Se.connectProject({repoPath:$});r(me),C(null),await Promise.all([Qt(),ks()])}),onRefreshConnectedRepository:()=>je(async()=>{const $=await Se.getCurrentProject();r($)}),onPullConnectedRepository:()=>je(async()=>{const $=await Se.pullCurrentProject();r($)}),onRefreshHarness:()=>je(async()=>{if(!ee)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([Ht(ee.taskSlug),wi(ee.taskSlug)])}),onApplyHarness:()=>je(async()=>{if(!ee)throw new Error("Create or select a task before applying VCM Harness.");const $=await Se.applyHarness({taskSlug:ee.taskSlug});C($),await Promise.all([Ht(ee.taskSlug),wi(ee.taskSlug)])}),onStartHarnessBootstrap:$=>je(async()=>{if(!ee)throw new Error("Create or select a task before starting Harness Bootstrap.");const me=await Se.startHarnessBootstrap({taskSlug:ee.taskSlug,cols:120,rows:32,...$});a(me.status),u(ee.taskSlug),await Hn({syncLaunchOptions:!0})}),onRestartHarnessBootstrap:$=>je(async()=>{if(!ee)throw new Error("Create or select a task before restarting Harness Bootstrap.");const me=await Se.restartHarnessBootstrap({taskSlug:ee.taskSlug,cols:120,rows:32,...$});a(me.status),u(ee.taskSlug),await Hn({syncLaunchOptions:!0})}),onStopHarnessBootstrap:()=>je(async()=>{const $=await Se.stopHarnessBootstrap();a($),u((ee==null?void 0:ee.taskSlug)??null),await Hn()}),onRunHarnessBootstrap:()=>je(async()=>{if(!ee)throw new Error("Create or select a task before running Harness Bootstrap.");const $=await Se.runHarnessBootstrap({taskSlug:ee.taskSlug});a($.status),u(ee.taskSlug),await Hn()}),onOpenHarnessStudio:()=>wt(!0),onOpenRepositoryDiff:()=>At(!0),onRefreshGateway:()=>je(async()=>{await Es()}),onGatewayEnabledChange:$=>{je(async()=>{const[me,_t]=await Promise.all([Se.updateGatewaySettings({enabled:$,...$&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ee==null?void 0:ee.taskSlug)??null}:{}}),$?Se.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);_t&&Rt(_t),$&&Tr(),x(me)})},onGatewayTranslationChange:$=>{je(async()=>{const me=await Se.updateGatewaySettings({translationEnabled:$});x(me)})},onStartGatewayQrLogin:()=>{je(async()=>{const $=await Se.startGatewayQrLogin();v($),S(null),M(!0),await Es()})},onResetGatewayBinding:()=>{je(async()=>{const $=await Se.resetGatewayBinding();x($),v(null),S(null),M(!1)})},onGateReviewGateEnabledChange:($,me)=>{je(async()=>{if(!ee)throw new Error("Create or select a task before changing Gate Review Gates.");const _t=await Se.updateGateReviewSettings(ee.taskSlug,{gates:{[$]:me}});z({taskSlug:ee.taskSlug,state:_t})})},onTranslationEnabledChange:$=>{fe($),je(async()=>{const me=await Se.updateAppPreferences({translationEnabled:$});Rt(me)})},onTranslationAutoSendChange:$=>{de($),je(async()=>{const me=await Se.updateAppPreferences({translationAutoSendEnabled:$});Rt(me)})},onTranslationTargetLanguageChange:$=>{Ce($),je(async()=>{const me=await Se.updateAppPreferences({translationTargetLanguage:$});Rt(me)})},onTranslationOutputModeChange:$=>{Ee($),je(async()=>{const me=await Se.updateAppPreferences({translationOutputMode:$});Rt(me)})},onOpenFileTranslation:()=>qt(!0),onOpenTranslatorSession:()=>nn(!0),onCreateTranslationBootstrap:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before running Translation Bootstrap.");await Se.createTranslationBootstrap({taskSlug:ee.taskSlug,targetLanguage:se}),await lr(),await Ei()})},onUpdateTranslationMemory:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before updating translation memory.");await Se.createTranslationMemoryUpdate({taskSlug:ee.taskSlug,targetLanguage:se}),await lr(),await Ei()})},onCreateTask:$=>je(async()=>{const me=await Se.createTask($);await Qt(),L(me.taskSlug),await As(me.taskSlug)}),onSelectTask:L,themeMode:G,onThemeModeChange:$=>{N($),je(async()=>{const me=await Se.updateAppPreferences({themeMode:$});Rt(me)})},flowPauseAlerts:Z,onFlowPauseAlertsChange:$=>{if(A!=null&&A.enabled){Tr();return}ue($),$&&bE(),je(async()=>{const me=await Se.updateAppPreferences({flowPauseAlerts:$});Rt(me)})},permissionRequestMode:ve,onPermissionRequestModeChange:$=>{X($),je(async()=>{const me=await Se.updateAppPreferences({permissionRequestMode:$});Rt(me)})},launchTemplate:Fn,canSaveLaunchTemplate:bi,canOneClickStart:sr,onSaveLaunchTemplate:()=>{je(async()=>{if(!(Xt!=null&&Xt.allRolesHaveSession))throw new Error("Start all core role sessions before saving a launch template.");const $=await Se.updateAppPreferences({launchTemplate:{version:1,roles:Xt.roles,autoOrchestration:Xt.autoOrchestration}});Rt($)})},onOneClickStart:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before one-click start.");const $=await Se.getTaskStatus(ee.taskSlug);if($.sessions.some(St=>S1.some(Zt=>Zt===St.role)))throw new Error("One-click start is only available before any role session has started.");const me=await Se.updateOrchestrationState(ee.taskSlug,{mode:Fn.autoOrchestration?"auto":"manual"});U({taskSlug:ee.taskSlug,orchestration:me});const _t=L2(Fn,{gateReviewerEnabled:Ts});for(const St of _t){const Zt={cols:100,rows:28,permissionMode:St.permissionMode,model:St.model,effort:St.effort},$n=$.sessions.find(Rs=>Rs.role===St.role);if(($n==null?void 0:$n.status)==="running"){St.role==="gate-reviewer"&&await Se.resumeRoleSession(ee.taskSlug,St.role,Zt);continue}$n!=null&&$n.claudeSessionId?await Se.resumeRoleSession(ee.taskSlug,St.role,Zt):await Se.startRoleSession(ee.taskSlug,St.role,Zt)}H("project-manager"),await xi(ee.taskSlug),await Qt(),Ol(St=>St+1)})},onTryFlowPauseAlert:()=>{Nn("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:$=>{je(async()=>{const me=await Se.markAllMessagesDone($);I({taskSlug:$,messages:me.messages}),await xi($)})},onDeleteMessageHistory:$=>{je(async()=>{const me=await Se.deleteMessageHistory($);I({taskSlug:$,messages:me.messages}),await xi($)})}}),children:[Ar?T.jsx("div",{className:"error-banner",children:Ar}):null,kr?T.jsx("div",{className:"flow-pause-alert-backdrop",children:T.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:[T.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),T.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),T.jsx("p",{id:"flow-pause-alert-body",children:kr.text}),T.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."}),T.jsx("button",{type:"button",autoFocus:!0,onClick:Ci,children:"Confirm"})]})}):null,k&&y?T.jsx(_E,{busy:ir,qrCheck:m,qrLogin:y,onCheck:()=>{je(async()=>{const $=await Se.checkGatewayQrLogin();S($),($.status==="confirmed"||$.status==="binded_redirect")&&M(!1),await Es()})},onClose:()=>M(!1)}):null,n&&ee?T.jsx(hE,{task:ee,activeRole:j,gateReviewerEnabled:Ts,translationEnabled:ti,translationAutoSendEnabled:ce,translationTargetLanguage:se,refreshNonce:mo,onTaskChanged:async()=>{await Qt()},onActiveRoleChange:H,onMessagesChanged:Nl,onOrchestrationChanged:Hl,onRoundStateChanged:Rr,onEventsChanged:go,onLaunchStateChanged:Dr}):T.jsxs("section",{className:"empty-workspace",children:[T.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),T.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."})]}),T.jsx(g2,{open:tn,taskSlug:(ee==null?void 0:ee.taskSlug)??null,targetLanguage:se,onClose:()=>qt(!1)}),T.jsx(N1,{open:xn,busy:ir,status:bs,bootstrapStatus:Cs,engineerSession:we,permissionMode:qe,model:Tt,effort:Bn,taskSlug:(ee==null?void 0:ee.taskSlug)??null,onClose:()=>wt(!1),onRefresh:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Ht(ee.taskSlug),wi(ee.taskSlug),Hn()])})},onPermissionModeChange:rn,onModelChange:Yt,onEffortChange:ze,onEngineerStart:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before starting Harness Engineer.");const $=await Se.startHarnessEngineerSession({taskSlug:ee.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:Bn});ct($),Vn($)})},onEngineerResume:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before resuming Harness Engineer.");const $=await Se.resumeHarnessEngineerSession({taskSlug:ee.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:Bn});ct($),Vn($)})},onEngineerRestart:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before restarting Harness Engineer.");const $=await Se.restartHarnessEngineerSession({taskSlug:ee.taskSlug,cols:120,rows:32,permissionMode:qe,model:Tt,effort:Bn});ct($),Vn($)})},onEngineerStop:()=>{je(async()=>{const $=await Se.stopHarnessEngineerSession();ct($)})},onEngineerNotifyHarnessUpdated:()=>{je(async()=>{const $=await Se.notifyHarnessEngineerHarnessUpdated();ct($),Vn($)})},onOpenRepositoryDiff:()=>At(!0)}),T.jsx(H1,{open:ft,taskSlug:(ee==null?void 0:ee.taskSlug)??null,onClose:()=>At(!1)}),T.jsx(F1,{open:Kt,busy:ir,session:ne,permissionMode:Ae,model:Ne,effort:Ue,onClose:()=>nn(!1),onPermissionModeChange:Be,onModelChange:dt,onEffortChange:Je,onStart:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before starting Translator.");const $=await Se.startTranslatorSession({taskSlug:ee.taskSlug,cols:100,rows:28,permissionMode:Ae,model:Ne,effort:Ue});ye($),xt($)})},onResume:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before resuming Translator.");const $=await Se.resumeTranslatorSession({taskSlug:ee.taskSlug,cols:100,rows:28,permissionMode:Ae,model:Ne,effort:Ue});ye($),xt($)})},onRestart:()=>{je(async()=>{if(!ee)throw new Error("Create or select a task before restarting Translator.");const $=await Se.restartTranslatorSession({taskSlug:ee.taskSlug,cols:100,rows:28,permissionMode:Ae,model:Ne,effort:Ue});ye($),xt($)})},onStop:()=>{je(async()=>{const $=await Se.stopTranslatorSession();ye($)})},onNotifyHarnessUpdated:()=>{je(async()=>{const $=await Se.notifyTranslatorHarnessUpdated();ye($),xt($)})}})]})}function _E({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[_,f]=ie.useState(""),[a,c]=ie.useState("");return ie.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const g=gs(0,"M");g.addData(d.qrcodeUrl),g.make(),h||f(g.createDataURL(8,2))}catch(g){h||c(g instanceof Error?g.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),T.jsx("div",{className:"modal-backdrop",children:T.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[T.jsxs("header",{children:[T.jsxs("div",{children:[T.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),T.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),T.jsx("button",{type:"button",onClick:s,children:"Close"})]}),T.jsxs("div",{className:"gateway-qr-modal-body",children:[T.jsx("div",{className:"gateway-qr-code-frame",children:_?T.jsx("img",{alt:"Weixin Gateway QR login",src:_}):T.jsx("div",{className:"gateway-qr-placeholder",children:a||"Rendering QR code..."})}),T.jsxs("dl",{className:"gateway-qr-meta",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Status"}),T.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Expires"}),T.jsx("dd",{children:vE(d.expiresAt)})]}),o!=null&&o.message?T.jsxs("div",{children:[T.jsx("dt",{children:"Message"}),T.jsx("dd",{children:o.message})]}):null]})]}),T.jsx("footer",{children:T.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function vE(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 er=null;function yE(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 SE(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function bE(){const n=W_();return n?K_(n):!1}async function eo(){const n=W_();if(!n||!await K_(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Ag(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),Ag(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function W_(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!er||er.state==="closed")&&(er=new n),er}catch{return null}}function CE(){ih(er)}function ih(n){er=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function K_(n){if(kg(n))return!0;try{await n.resume();const r=kg(n);return!r&&n===er&&ih(n),r}catch{return n===er&&ih(n),!1}}function kg(n){return n.state==="running"}function Ag(n,r,s){const o=n.createGain(),d=n.createOscillator(),_=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),_.type="triangle",_.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),_.connect(o),o.connect(r),d.start(s.startAt),_.start(s.startAt),d.stop(f+.02),_.stop(f+.02)}const Y_=document.getElementById("root");if(!Y_)throw new Error("Missing #root element.");c1.createRoot(Y_).render(T.jsx(ie.StrictMode,{children:T.jsx(gE,{})}));