@cluesmith/codev 2.0.0-rc.73 → 2.0.0-rc.74

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.
Files changed (62) hide show
  1. package/dashboard/dist/assets/{index-CH_utkcW.js → index-b38SaXk5.js} +31 -31
  2. package/dashboard/dist/assets/{index-CH_utkcW.js.map → index-b38SaXk5.js.map} +1 -1
  3. package/dashboard/dist/index.html +1 -1
  4. package/dist/agent-farm/commands/spawn-worktree.js +1 -1
  5. package/dist/agent-farm/db/index.d.ts.map +1 -1
  6. package/dist/agent-farm/db/index.js +56 -2
  7. package/dist/agent-farm/db/index.js.map +1 -1
  8. package/dist/agent-farm/db/schema.d.ts +1 -1
  9. package/dist/agent-farm/db/schema.js +3 -3
  10. package/dist/agent-farm/servers/tower-instances.d.ts +6 -6
  11. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  12. package/dist/agent-farm/servers/tower-instances.js +47 -34
  13. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  14. package/dist/agent-farm/servers/tower-routes.d.ts +1 -1
  15. package/dist/agent-farm/servers/tower-routes.js +34 -34
  16. package/dist/agent-farm/servers/tower-server.js +17 -17
  17. package/dist/agent-farm/servers/tower-terminals.d.ts +8 -8
  18. package/dist/agent-farm/servers/tower-terminals.js +46 -46
  19. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  20. package/dist/agent-farm/servers/tower-types.d.ts +5 -4
  21. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  22. package/dist/agent-farm/servers/tower-utils.d.ts +7 -0
  23. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  24. package/dist/agent-farm/servers/tower-utils.js +21 -0
  25. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  26. package/dist/agent-farm/utils/shell.d.ts +1 -1
  27. package/dist/agent-farm/utils/shell.js +1 -1
  28. package/dist/commands/porch/next.js +4 -4
  29. package/dist/commands/porch/next.js.map +1 -1
  30. package/dist/terminal/pty-manager.d.ts +1 -1
  31. package/dist/terminal/pty-manager.js +5 -5
  32. package/dist/terminal/pty-session.d.ts +20 -20
  33. package/dist/terminal/pty-session.js +55 -55
  34. package/dist/terminal/session-manager.d.ts +15 -15
  35. package/dist/terminal/session-manager.js +34 -34
  36. package/dist/terminal/{shepherd-client.d.ts → shellper-client.d.ts} +10 -10
  37. package/dist/terminal/{shepherd-client.d.ts.map → shellper-client.d.ts.map} +1 -1
  38. package/dist/terminal/{shepherd-client.js → shellper-client.js} +20 -20
  39. package/dist/terminal/{shepherd-client.js.map → shellper-client.js.map} +1 -1
  40. package/dist/terminal/{shepherd-main.d.ts → shellper-main.d.ts} +3 -3
  41. package/dist/terminal/shellper-main.d.ts.map +1 -0
  42. package/dist/terminal/{shepherd-main.js → shellper-main.js} +17 -17
  43. package/dist/terminal/{shepherd-main.js.map → shellper-main.js.map} +1 -1
  44. package/dist/terminal/{shepherd-process.d.ts → shellper-process.d.ts} +8 -8
  45. package/dist/terminal/{shepherd-process.d.ts.map → shellper-process.d.ts.map} +1 -1
  46. package/dist/terminal/{shepherd-process.js → shellper-process.js} +11 -11
  47. package/dist/terminal/{shepherd-process.js.map → shellper-process.js.map} +1 -1
  48. package/dist/terminal/{shepherd-protocol.d.ts → shellper-protocol.d.ts} +5 -5
  49. package/dist/terminal/{shepherd-protocol.d.ts.map → shellper-protocol.d.ts.map} +1 -1
  50. package/dist/terminal/{shepherd-protocol.js → shellper-protocol.js} +5 -5
  51. package/dist/terminal/{shepherd-protocol.js.map → shellper-protocol.js.map} +1 -1
  52. package/dist/terminal/{shepherd-replay-buffer.d.ts → shellper-replay-buffer.d.ts} +4 -4
  53. package/dist/terminal/{shepherd-replay-buffer.d.ts.map → shellper-replay-buffer.d.ts.map} +1 -1
  54. package/dist/terminal/{shepherd-replay-buffer.js → shellper-replay-buffer.js} +4 -4
  55. package/dist/terminal/{shepherd-replay-buffer.js.map → shellper-replay-buffer.js.map} +1 -1
  56. package/package.json +1 -1
  57. package/skeleton/protocols/bugfix/builder-prompt.md +7 -1
  58. package/skeleton/protocols/maintain/protocol.md +3 -3
  59. package/skeleton/protocols/spir/builder-prompt.md +7 -0
  60. package/skeleton/resources/commands/agent-farm.md +2 -2
  61. package/skeleton/roles/builder.md +15 -1
  62. package/dist/terminal/shepherd-main.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{enumerable:!0,configurable:!0,writable:!0,value:V}):I[G]=V;var ha=(I,G,V)=>Ov(I,typeof G!="symbol"?G+"":G,V);(function(){const G=document.createElement("link").relList;if(G&&G.supports&&G.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))U(J);new MutationObserver(J=>{for(const se of J)if(se.type==="childList")for(const F of se.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&U(F)}).observe(document,{childList:!0,subtree:!0});function V(J){const se={};return J.integrity&&(se.integrity=J.integrity),J.referrerPolicy&&(se.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?se.credentials="include":J.crossOrigin==="anonymous"?se.credentials="omit":se.credentials="same-origin",se}function U(J){if(J.ep)return;J.ep=!0;const se=V(J);fetch(J.href,se)}})();var Ao={exports:{}},Vr={};/**
1
+ var Bv=Object.defineProperty;var Ov=(P,W,X)=>W in P?Bv(P,W,{enumerable:!0,configurable:!0,writable:!0,value:X}):P[W]=X;var ha=(P,W,X)=>Ov(P,typeof W!="symbol"?W+"":W,X);(function(){const W=document.createElement("link").relList;if(W&&W.supports&&W.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))I(J);new MutationObserver(J=>{for(const ie of J)if(ie.type==="childList")for(const F of ie.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&I(F)}).observe(document,{childList:!0,subtree:!0});function X(J){const ie={};return J.integrity&&(ie.integrity=J.integrity),J.referrerPolicy&&(ie.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?ie.credentials="include":J.crossOrigin==="anonymous"?ie.credentials="omit":ie.credentials="same-origin",ie}function I(J){if(J.ep)return;J.ep=!0;const ie=X(J);fetch(J.href,ie)}})();var Ao={exports:{}},Vr={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{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 Id;function kv(){if(Id)return Vr;Id=1;var I=Symbol.for("react.transitional.element"),G=Symbol.for("react.fragment");function V(U,J,se){var F=null;if(se!==void 0&&(F=""+se),J.key!==void 0&&(F=""+J.key),"key"in J){se={};for(var n in J)n!=="key"&&(se[n]=J[n])}else se=J;return J=se.ref,{$$typeof:I,type:U,key:F,ref:J!==void 0?J:null,props:se}}return Vr.Fragment=G,Vr.jsx=V,Vr.jsxs=V,Vr}var Pd;function Hv(){return Pd||(Pd=1,Ao.exports=kv()),Ao.exports}var Q=Hv(),Ro={exports:{}},De={};/**
9
+ */var Id;function kv(){if(Id)return Vr;Id=1;var P=Symbol.for("react.transitional.element"),W=Symbol.for("react.fragment");function X(I,J,ie){var F=null;if(ie!==void 0&&(F=""+ie),J.key!==void 0&&(F=""+J.key),"key"in J){ie={};for(var n in J)n!=="key"&&(ie[n]=J[n])}else ie=J;return J=ie.ref,{$$typeof:P,type:I,key:F,ref:J!==void 0?J:null,props:ie}}return Vr.Fragment=W,Vr.jsx=X,Vr.jsxs=X,Vr}var Pd;function Hv(){return Pd||(Pd=1,Ao.exports=kv()),Ao.exports}var Q=Hv(),Ro={exports:{}},De={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{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 jd;function zv(){if(jd)return De;jd=1;var I=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),F=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=p&&T[p]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},o=Object.assign,r={};function h(T,B,q){this.props=T,this.context=B,this.refs=r,this.updater=q||b}h.prototype.isReactComponent={},h.prototype.setState=function(T,B){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,B,"setState")},h.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function c(){}c.prototype=h.prototype;function l(T,B,q){this.props=T,this.context=B,this.refs=r,this.updater=q||b}var S=l.prototype=new c;S.constructor=l,o(S,h.prototype),S.isPureReactComponent=!0;var x=Array.isArray;function v(){}var y={H:null,A:null,T:null,S:null},m=Object.prototype.hasOwnProperty;function C(T,B,q){var K=q.ref;return{$$typeof:I,type:T,key:B,ref:K!==void 0?K:null,props:q}}function L(T,B){return C(T.type,B,T.props)}function A(T){return typeof T=="object"&&T!==null&&T.$$typeof===I}function E(T){var B={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(q){return B[q]})}var R=/\/+/g;function k(T,B){return typeof T=="object"&&T!==null&&T.key!=null?E(""+T.key):B.toString(36)}function $(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(v,v):(T.status="pending",T.then(function(B){T.status==="pending"&&(T.status="fulfilled",T.value=B)},function(B){T.status==="pending"&&(T.status="rejected",T.reason=B)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function N(T,B,q,K,oe){var ce=typeof T;(ce==="undefined"||ce==="boolean")&&(T=null);var W=!1;if(T===null)W=!0;else switch(ce){case"bigint":case"string":case"number":W=!0;break;case"object":switch(T.$$typeof){case I:case G:W=!0;break;case _:return W=T._init,N(W(T._payload),B,q,K,oe)}}if(W)return oe=oe(T),W=K===""?"."+k(T,0):K,x(oe)?(q="",W!=null&&(q=W.replace(R,"$&/")+"/"),N(oe,B,q,"",function(ee){return ee})):oe!=null&&(A(oe)&&(oe=L(oe,q+(oe.key==null||T&&T.key===oe.key?"":(""+oe.key).replace(R,"$&/")+"/")+W)),B.push(oe)),1;W=0;var z=K===""?".":K+":";if(x(T))for(var re=0;re<T.length;re++)K=T[re],ce=z+k(K,re),W+=N(K,B,q,ce,oe);else if(re=w(T),typeof re=="function")for(T=re.call(T),re=0;!(K=T.next()).done;)K=K.value,ce=z+k(K,re++),W+=N(K,B,q,ce,oe);else if(ce==="object"){if(typeof T.then=="function")return N($(T),B,q,K,oe);throw B=String(T),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return W}function P(T,B,q){if(T==null)return T;var K=[],oe=0;return N(T,K,"","",function(ce){return B.call(q,ce,oe++)}),K}function j(T){if(T._status===-1){var B=T._result;B=B(),B.then(function(q){(T._status===0||T._status===-1)&&(T._status=1,T._result=q)},function(q){(T._status===0||T._status===-1)&&(T._status=2,T._result=q)}),T._status===-1&&(T._status=0,T._result=B)}if(T._status===1)return T._result.default;throw T._result}var D=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},O={map:P,forEach:function(T,B,q){P(T,function(){B.apply(this,arguments)},q)},count:function(T){var B=0;return P(T,function(){B++}),B},toArray:function(T){return P(T,function(B){return B})||[]},only:function(T){if(!A(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return De.Activity=a,De.Children=O,De.Component=h,De.Fragment=V,De.Profiler=J,De.PureComponent=l,De.StrictMode=U,De.Suspense=u,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,De.__COMPILER_RUNTIME={__proto__:null,c:function(T){return y.H.useMemoCache(T)}},De.cache=function(T){return function(){return T.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(T,B,q){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var K=o({},T.props),oe=T.key;if(B!=null)for(ce in B.key!==void 0&&(oe=""+B.key),B)!m.call(B,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&B.ref===void 0||(K[ce]=B[ce]);var ce=arguments.length-2;if(ce===1)K.children=q;else if(1<ce){for(var W=Array(ce),z=0;z<ce;z++)W[z]=arguments[z+2];K.children=W}return C(T.type,oe,K)},De.createContext=function(T){return T={$$typeof:F,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:se,_context:T},T},De.createElement=function(T,B,q){var K,oe={},ce=null;if(B!=null)for(K in B.key!==void 0&&(ce=""+B.key),B)m.call(B,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(oe[K]=B[K]);var W=arguments.length-2;if(W===1)oe.children=q;else if(1<W){for(var z=Array(W),re=0;re<W;re++)z[re]=arguments[re+2];oe.children=z}if(T&&T.defaultProps)for(K in W=T.defaultProps,W)oe[K]===void 0&&(oe[K]=W[K]);return C(T,ce,oe)},De.createRef=function(){return{current:null}},De.forwardRef=function(T){return{$$typeof:n,render:T}},De.isValidElement=A,De.lazy=function(T){return{$$typeof:_,_payload:{_status:-1,_result:T},_init:j}},De.memo=function(T,B){return{$$typeof:d,type:T,compare:B===void 0?null:B}},De.startTransition=function(T){var B=y.T,q={};y.T=q;try{var K=T(),oe=y.S;oe!==null&&oe(q,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(v,D)}catch(ce){D(ce)}finally{B!==null&&q.types!==null&&(B.types=q.types),y.T=B}},De.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},De.use=function(T){return y.H.use(T)},De.useActionState=function(T,B,q){return y.H.useActionState(T,B,q)},De.useCallback=function(T,B){return y.H.useCallback(T,B)},De.useContext=function(T){return y.H.useContext(T)},De.useDebugValue=function(){},De.useDeferredValue=function(T,B){return y.H.useDeferredValue(T,B)},De.useEffect=function(T,B){return y.H.useEffect(T,B)},De.useEffectEvent=function(T){return y.H.useEffectEvent(T)},De.useId=function(){return y.H.useId()},De.useImperativeHandle=function(T,B,q){return y.H.useImperativeHandle(T,B,q)},De.useInsertionEffect=function(T,B){return y.H.useInsertionEffect(T,B)},De.useLayoutEffect=function(T,B){return y.H.useLayoutEffect(T,B)},De.useMemo=function(T,B){return y.H.useMemo(T,B)},De.useOptimistic=function(T,B){return y.H.useOptimistic(T,B)},De.useReducer=function(T,B,q){return y.H.useReducer(T,B,q)},De.useRef=function(T){return y.H.useRef(T)},De.useState=function(T){return y.H.useState(T)},De.useSyncExternalStore=function(T,B,q){return y.H.useSyncExternalStore(T,B,q)},De.useTransition=function(){return y.H.useTransition()},De.version="19.2.4",De}var Fd;function Fo(){return Fd||(Fd=1,Ro.exports=zv()),Ro.exports}var we=Fo(),Do={exports:{}},Yr={},To={exports:{}},Bo={};/**
17
+ */var jd;function zv(){if(jd)return De;jd=1;var P=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),F=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=p&&T[p]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},o=Object.assign,r={};function h(T,k,V){this.props=T,this.context=k,this.refs=r,this.updater=V||b}h.prototype.isReactComponent={},h.prototype.setState=function(T,k){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,k,"setState")},h.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function c(){}c.prototype=h.prototype;function l(T,k,V){this.props=T,this.context=k,this.refs=r,this.updater=V||b}var S=l.prototype=new c;S.constructor=l,o(S,h.prototype),S.isPureReactComponent=!0;var x=Array.isArray;function v(){}var y={H:null,A:null,T:null,S:null},m=Object.prototype.hasOwnProperty;function C(T,k,V){var K=V.ref;return{$$typeof:P,type:T,key:k,ref:K!==void 0?K:null,props:V}}function L(T,k){return C(T.type,k,T.props)}function R(T){return typeof T=="object"&&T!==null&&T.$$typeof===P}function E(T){var k={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return k[V]})}var D=/\/+/g;function O(T,k){return typeof T=="object"&&T!==null&&T.key!=null?E(""+T.key):k.toString(36)}function $(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(v,v):(T.status="pending",T.then(function(k){T.status==="pending"&&(T.status="fulfilled",T.value=k)},function(k){T.status==="pending"&&(T.status="rejected",T.reason=k)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function U(T,k,V,K,ue){var le=typeof T;(le==="undefined"||le==="boolean")&&(T=null);var q=!1;if(T===null)q=!0;else switch(le){case"bigint":case"string":case"number":q=!0;break;case"object":switch(T.$$typeof){case P:case W:q=!0;break;case _:return q=T._init,U(q(T._payload),k,V,K,ue)}}if(q)return ue=ue(T),q=K===""?"."+O(T,0):K,x(ue)?(V="",q!=null&&(V=q.replace(D,"$&/")+"/"),U(ue,k,V,"",function(se){return se})):ue!=null&&(R(ue)&&(ue=L(ue,V+(ue.key==null||T&&T.key===ue.key?"":(""+ue.key).replace(D,"$&/")+"/")+q)),k.push(ue)),1;q=0;var N=K===""?".":K+":";if(x(T))for(var re=0;re<T.length;re++)K=T[re],le=N+O(K,re),q+=U(K,k,V,le,ue);else if(re=w(T),typeof re=="function")for(T=re.call(T),re=0;!(K=T.next()).done;)K=K.value,le=N+O(K,re++),q+=U(K,k,V,le,ue);else if(le==="object"){if(typeof T.then=="function")return U($(T),k,V,K,ue);throw k=String(T),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return q}function j(T,k,V){if(T==null)return T;var K=[],ue=0;return U(T,K,"","",function(le){return k.call(V,le,ue++)}),K}function z(T){if(T._status===-1){var k=T._result;k=k(),k.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=k)}if(T._status===1)return T._result.default;throw T._result}var M=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},B={map:j,forEach:function(T,k,V){j(T,function(){k.apply(this,arguments)},V)},count:function(T){var k=0;return j(T,function(){k++}),k},toArray:function(T){return j(T,function(k){return k})||[]},only:function(T){if(!R(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return De.Activity=a,De.Children=B,De.Component=h,De.Fragment=X,De.Profiler=J,De.PureComponent=l,De.StrictMode=I,De.Suspense=u,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,De.__COMPILER_RUNTIME={__proto__:null,c:function(T){return y.H.useMemoCache(T)}},De.cache=function(T){return function(){return T.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(T,k,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var K=o({},T.props),ue=T.key;if(k!=null)for(le in k.key!==void 0&&(ue=""+k.key),k)!m.call(k,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&k.ref===void 0||(K[le]=k[le]);var le=arguments.length-2;if(le===1)K.children=V;else if(1<le){for(var q=Array(le),N=0;N<le;N++)q[N]=arguments[N+2];K.children=q}return C(T.type,ue,K)},De.createContext=function(T){return T={$$typeof:F,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:ie,_context:T},T},De.createElement=function(T,k,V){var K,ue={},le=null;if(k!=null)for(K in k.key!==void 0&&(le=""+k.key),k)m.call(k,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ue[K]=k[K]);var q=arguments.length-2;if(q===1)ue.children=V;else if(1<q){for(var N=Array(q),re=0;re<q;re++)N[re]=arguments[re+2];ue.children=N}if(T&&T.defaultProps)for(K in q=T.defaultProps,q)ue[K]===void 0&&(ue[K]=q[K]);return C(T,le,ue)},De.createRef=function(){return{current:null}},De.forwardRef=function(T){return{$$typeof:n,render:T}},De.isValidElement=R,De.lazy=function(T){return{$$typeof:_,_payload:{_status:-1,_result:T},_init:z}},De.memo=function(T,k){return{$$typeof:d,type:T,compare:k===void 0?null:k}},De.startTransition=function(T){var k=y.T,V={};y.T=V;try{var K=T(),ue=y.S;ue!==null&&ue(V,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(v,M)}catch(le){M(le)}finally{k!==null&&V.types!==null&&(k.types=V.types),y.T=k}},De.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},De.use=function(T){return y.H.use(T)},De.useActionState=function(T,k,V){return y.H.useActionState(T,k,V)},De.useCallback=function(T,k){return y.H.useCallback(T,k)},De.useContext=function(T){return y.H.useContext(T)},De.useDebugValue=function(){},De.useDeferredValue=function(T,k){return y.H.useDeferredValue(T,k)},De.useEffect=function(T,k){return y.H.useEffect(T,k)},De.useEffectEvent=function(T){return y.H.useEffectEvent(T)},De.useId=function(){return y.H.useId()},De.useImperativeHandle=function(T,k,V){return y.H.useImperativeHandle(T,k,V)},De.useInsertionEffect=function(T,k){return y.H.useInsertionEffect(T,k)},De.useLayoutEffect=function(T,k){return y.H.useLayoutEffect(T,k)},De.useMemo=function(T,k){return y.H.useMemo(T,k)},De.useOptimistic=function(T,k){return y.H.useOptimistic(T,k)},De.useReducer=function(T,k,V){return y.H.useReducer(T,k,V)},De.useRef=function(T){return y.H.useRef(T)},De.useState=function(T){return y.H.useState(T)},De.useSyncExternalStore=function(T,k,V){return y.H.useSyncExternalStore(T,k,V)},De.useTransition=function(){return y.H.useTransition()},De.version="19.2.4",De}var Fd;function Fo(){return Fd||(Fd=1,Ro.exports=zv()),Ro.exports}var we=Fo(),Do={exports:{}},Yr={},To={exports:{}},Bo={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@ var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var $d;function Nv(){return $d||($d=1,(function(I){function G(N,P){var j=N.length;N.push(P);e:for(;0<j;){var D=j-1>>>1,O=N[D];if(0<J(O,P))N[D]=P,N[j]=O,j=D;else break e}}function V(N){return N.length===0?null:N[0]}function U(N){if(N.length===0)return null;var P=N[0],j=N.pop();if(j!==P){N[0]=j;e:for(var D=0,O=N.length,T=O>>>1;D<T;){var B=2*(D+1)-1,q=N[B],K=B+1,oe=N[K];if(0>J(q,j))K<O&&0>J(oe,q)?(N[D]=oe,N[K]=j,D=K):(N[D]=q,N[B]=j,D=B);else if(K<O&&0>J(oe,j))N[D]=oe,N[K]=j,D=K;else break e}}return P}function J(N,P){var j=N.sortIndex-P.sortIndex;return j!==0?j:N.id-P.id}if(I.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var se=performance;I.unstable_now=function(){return se.now()}}else{var F=Date,n=F.now();I.unstable_now=function(){return F.now()-n}}var u=[],d=[],_=1,a=null,p=3,w=!1,b=!1,o=!1,r=!1,h=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;function S(N){for(var P=V(d);P!==null;){if(P.callback===null)U(d);else if(P.startTime<=N)U(d),P.sortIndex=P.expirationTime,G(u,P);else break;P=V(d)}}function x(N){if(o=!1,S(N),!b)if(V(u)!==null)b=!0,v||(v=!0,E());else{var P=V(d);P!==null&&$(x,P.startTime-N)}}var v=!1,y=-1,m=5,C=-1;function L(){return r?!0:!(I.unstable_now()-C<m)}function A(){if(r=!1,v){var N=I.unstable_now();C=N;var P=!0;try{e:{b=!1,o&&(o=!1,c(y),y=-1),w=!0;var j=p;try{t:{for(S(N),a=V(u);a!==null&&!(a.expirationTime>N&&L());){var D=a.callback;if(typeof D=="function"){a.callback=null,p=a.priorityLevel;var O=D(a.expirationTime<=N);if(N=I.unstable_now(),typeof O=="function"){a.callback=O,S(N),P=!0;break t}a===V(u)&&U(u),S(N)}else U(u);a=V(u)}if(a!==null)P=!0;else{var T=V(d);T!==null&&$(x,T.startTime-N),P=!1}}break e}finally{a=null,p=j,w=!1}P=void 0}}finally{P?E():v=!1}}}var E;if(typeof l=="function")E=function(){l(A)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,k=R.port2;R.port1.onmessage=A,E=function(){k.postMessage(null)}}else E=function(){h(A,0)};function $(N,P){y=h(function(){N(I.unstable_now())},P)}I.unstable_IdlePriority=5,I.unstable_ImmediatePriority=1,I.unstable_LowPriority=4,I.unstable_NormalPriority=3,I.unstable_Profiling=null,I.unstable_UserBlockingPriority=2,I.unstable_cancelCallback=function(N){N.callback=null},I.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<N?Math.floor(1e3/N):5},I.unstable_getCurrentPriorityLevel=function(){return p},I.unstable_next=function(N){switch(p){case 1:case 2:case 3:var P=3;break;default:P=p}var j=p;p=P;try{return N()}finally{p=j}},I.unstable_requestPaint=function(){r=!0},I.unstable_runWithPriority=function(N,P){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var j=p;p=N;try{return P()}finally{p=j}},I.unstable_scheduleCallback=function(N,P,j){var D=I.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?D+j:D):j=D,N){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=j+O,N={id:_++,callback:P,priorityLevel:N,startTime:j,expirationTime:O,sortIndex:-1},j>D?(N.sortIndex=j,G(d,N),V(u)===null&&N===V(d)&&(o?(c(y),y=-1):o=!0,$(x,j-D))):(N.sortIndex=O,G(u,N),b||w||(b=!0,v||(v=!0,E()))),N},I.unstable_shouldYield=L,I.unstable_wrapCallback=function(N){var P=p;return function(){var j=p;p=P;try{return N.apply(this,arguments)}finally{p=j}}}})(Bo)),Bo}var qd;function Uv(){return qd||(qd=1,To.exports=Nv()),To.exports}var Oo={exports:{}},wt={};/**
25
+ */var $d;function Nv(){return $d||($d=1,(function(P){function W(U,j){var z=U.length;U.push(j);e:for(;0<z;){var M=z-1>>>1,B=U[M];if(0<J(B,j))U[M]=j,U[z]=B,z=M;else break e}}function X(U){return U.length===0?null:U[0]}function I(U){if(U.length===0)return null;var j=U[0],z=U.pop();if(z!==j){U[0]=z;e:for(var M=0,B=U.length,T=B>>>1;M<T;){var k=2*(M+1)-1,V=U[k],K=k+1,ue=U[K];if(0>J(V,z))K<B&&0>J(ue,V)?(U[M]=ue,U[K]=z,M=K):(U[M]=V,U[k]=z,M=k);else if(K<B&&0>J(ue,z))U[M]=ue,U[K]=z,M=K;else break e}}return j}function J(U,j){var z=U.sortIndex-j.sortIndex;return z!==0?z:U.id-j.id}if(P.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var ie=performance;P.unstable_now=function(){return ie.now()}}else{var F=Date,n=F.now();P.unstable_now=function(){return F.now()-n}}var u=[],d=[],_=1,a=null,p=3,w=!1,b=!1,o=!1,r=!1,h=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;function S(U){for(var j=X(d);j!==null;){if(j.callback===null)I(d);else if(j.startTime<=U)I(d),j.sortIndex=j.expirationTime,W(u,j);else break;j=X(d)}}function x(U){if(o=!1,S(U),!b)if(X(u)!==null)b=!0,v||(v=!0,E());else{var j=X(d);j!==null&&$(x,j.startTime-U)}}var v=!1,y=-1,m=5,C=-1;function L(){return r?!0:!(P.unstable_now()-C<m)}function R(){if(r=!1,v){var U=P.unstable_now();C=U;var j=!0;try{e:{b=!1,o&&(o=!1,c(y),y=-1),w=!0;var z=p;try{t:{for(S(U),a=X(u);a!==null&&!(a.expirationTime>U&&L());){var M=a.callback;if(typeof M=="function"){a.callback=null,p=a.priorityLevel;var B=M(a.expirationTime<=U);if(U=P.unstable_now(),typeof B=="function"){a.callback=B,S(U),j=!0;break t}a===X(u)&&I(u),S(U)}else I(u);a=X(u)}if(a!==null)j=!0;else{var T=X(d);T!==null&&$(x,T.startTime-U),j=!1}}break e}finally{a=null,p=z,w=!1}j=void 0}}finally{j?E():v=!1}}}var E;if(typeof l=="function")E=function(){l(R)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,O=D.port2;D.port1.onmessage=R,E=function(){O.postMessage(null)}}else E=function(){h(R,0)};function $(U,j){y=h(function(){U(P.unstable_now())},j)}P.unstable_IdlePriority=5,P.unstable_ImmediatePriority=1,P.unstable_LowPriority=4,P.unstable_NormalPriority=3,P.unstable_Profiling=null,P.unstable_UserBlockingPriority=2,P.unstable_cancelCallback=function(U){U.callback=null},P.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<U?Math.floor(1e3/U):5},P.unstable_getCurrentPriorityLevel=function(){return p},P.unstable_next=function(U){switch(p){case 1:case 2:case 3:var j=3;break;default:j=p}var z=p;p=j;try{return U()}finally{p=z}},P.unstable_requestPaint=function(){r=!0},P.unstable_runWithPriority=function(U,j){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var z=p;p=U;try{return j()}finally{p=z}},P.unstable_scheduleCallback=function(U,j,z){var M=P.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?M+z:M):z=M,U){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=z+B,U={id:_++,callback:j,priorityLevel:U,startTime:z,expirationTime:B,sortIndex:-1},z>M?(U.sortIndex=z,W(d,U),X(u)===null&&U===X(d)&&(o?(c(y),y=-1):o=!0,$(x,z-M))):(U.sortIndex=B,W(u,U),b||w||(b=!0,v||(v=!0,E()))),U},P.unstable_shouldYield=L,P.unstable_wrapCallback=function(U){var j=p;return function(){var z=p;p=j;try{return U.apply(this,arguments)}finally{p=z}}}})(Bo)),Bo}var qd;function Uv(){return qd||(qd=1,To.exports=Nv()),To.exports}var Oo={exports:{}},wt={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -30,7 +30,7 @@ var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{enumerable:!0,config
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Wd;function Iv(){if(Wd)return wt;Wd=1;var I=Fo();function G(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)d+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function V(){}var U={d:{f:V,r:function(){throw Error(G(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},J=Symbol.for("react.portal");function se(u,d,_){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:a==null?null:""+a,children:u,containerInfo:d,implementation:_}}var F=I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,wt.createPortal=function(u,d){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(G(299));return se(u,d,null,_)},wt.flushSync=function(u){var d=F.T,_=U.p;try{if(F.T=null,U.p=2,u)return u()}finally{F.T=d,U.p=_,U.d.f()}},wt.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,U.d.C(u,d))},wt.prefetchDNS=function(u){typeof u=="string"&&U.d.D(u)},wt.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,w=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;_==="style"?U.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:w}):_==="script"&&U.d.X(u,{crossOrigin:a,integrity:p,fetchPriority:w,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},wt.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var _=n(d.as,d.crossOrigin);U.d.M(u,{crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&U.d.M(u)},wt.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin);U.d.L(u,_,{crossOrigin:a,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},wt.preloadModule=function(u,d){if(typeof u=="string")if(d){var _=n(d.as,d.crossOrigin);U.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else U.d.m(u)},wt.requestFormReset=function(u){U.d.r(u)},wt.unstable_batchedUpdates=function(u,d){return u(d)},wt.useFormState=function(u,d,_){return F.H.useFormState(u,d,_)},wt.useFormStatus=function(){return F.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var Gd;function Pv(){if(Gd)return Oo.exports;Gd=1;function I(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I)}catch(G){console.error(G)}}return I(),Oo.exports=Iv(),Oo.exports}/**
33
+ */var Wd;function Iv(){if(Wd)return wt;Wd=1;var P=Fo();function W(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)d+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function X(){}var I={d:{f:X,r:function(){throw Error(W(522))},D:X,C:X,L:X,m:X,X,S:X,M:X},p:0,findDOMNode:null},J=Symbol.for("react.portal");function ie(u,d,_){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:a==null?null:""+a,children:u,containerInfo:d,implementation:_}}var F=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,wt.createPortal=function(u,d){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(W(299));return ie(u,d,null,_)},wt.flushSync=function(u){var d=F.T,_=I.p;try{if(F.T=null,I.p=2,u)return u()}finally{F.T=d,I.p=_,I.d.f()}},wt.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,I.d.C(u,d))},wt.prefetchDNS=function(u){typeof u=="string"&&I.d.D(u)},wt.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,w=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;_==="style"?I.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:w}):_==="script"&&I.d.X(u,{crossOrigin:a,integrity:p,fetchPriority:w,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},wt.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var _=n(d.as,d.crossOrigin);I.d.M(u,{crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&I.d.M(u)},wt.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin);I.d.L(u,_,{crossOrigin:a,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},wt.preloadModule=function(u,d){if(typeof u=="string")if(d){var _=n(d.as,d.crossOrigin);I.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else I.d.m(u)},wt.requestFormReset=function(u){I.d.r(u)},wt.unstable_batchedUpdates=function(u,d){return u(d)},wt.useFormState=function(u,d,_){return F.H.useFormState(u,d,_)},wt.useFormStatus=function(){return F.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var Gd;function Pv(){if(Gd)return Oo.exports;Gd=1;function P(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P)}catch(W){console.error(W)}}return P(),Oo.exports=Iv(),Oo.exports}/**
34
34
  * @license React
35
35
  * react-dom-client.production.js
36
36
  *
@@ -38,23 +38,23 @@ var Bv=Object.defineProperty;var Ov=(I,G,V)=>G in I?Bv(I,G,{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 Xd;function jv(){if(Xd)return Yr;Xd=1;var I=Uv(),G=Fo(),V=Pv();function U(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 J(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function se(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 n(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 u(e){if(se(e)!==e)throw Error(U(188))}function d(e){var t=e.alternate;if(!t){if(t=se(e),t===null)throw Error(U(188));return t!==e?null:e}for(var i=e,s=t;;){var f=i.return;if(f===null)break;var g=f.alternate;if(g===null){if(s=f.return,s!==null){i=s;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===i)return u(f),e;if(g===s)return u(f),t;g=g.sibling}throw Error(U(188))}if(i.return!==s.return)i=f,s=g;else{for(var M=!1,H=f.child;H;){if(H===i){M=!0,i=f,s=g;break}if(H===s){M=!0,s=f,i=g;break}H=H.sibling}if(!M){for(H=g.child;H;){if(H===i){M=!0,i=g,s=f;break}if(H===s){M=!0,s=g,i=f;break}H=H.sibling}if(!M)throw Error(U(189))}}if(i.alternate!==s)throw Error(U(190))}if(i.tag!==3)throw Error(U(188));return i.stateNode.current===i?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var a=Object.assign,p=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),l=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),A=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=A&&e[A]||e["@@iterator"],typeof e=="function"?e:null)}var R=Symbol.for("react.client.reference");function k(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===R?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case h:return"Profiler";case r:return"StrictMode";case x:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case l:return e.displayName||"Context";case c:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case y:return t=e.displayName||null,t!==null?t:k(e.type)||"Memo";case m:t=e._payload,e=e._init;try{return k(e(t))}catch{}}return null}var $=Array.isArray,N=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=V.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},D=[],O=-1;function T(e){return{current:e}}function B(e){0>O||(e.current=D[O],D[O]=null,O--)}function q(e,t){O++,D[O]=e.current,e.current=t}var K=T(null),oe=T(null),ce=T(null),W=T(null);function z(e,t){switch(q(ce,t),q(oe,e),q(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?od(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=od(t),e=cd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(K),q(K,e)}function re(){B(K),B(oe),B(ce)}function ee(e){e.memoizedState!==null&&q(W,e);var t=K.current,i=cd(t,e.type);t!==i&&(q(oe,e),q(K,i))}function ve(e){oe.current===e&&(B(K),B(oe)),W.current===e&&(B(W),qr._currentValue=j)}var fe,Me;function _e(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",Me=-1<i.stack.indexOf(`
41
+ */var Xd;function jv(){if(Xd)return Yr;Xd=1;var P=Uv(),W=Fo(),X=Pv();function I(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 J(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ie(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 n(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 u(e){if(ie(e)!==e)throw Error(I(188))}function d(e){var t=e.alternate;if(!t){if(t=ie(e),t===null)throw Error(I(188));return t!==e?null:e}for(var i=e,s=t;;){var f=i.return;if(f===null)break;var g=f.alternate;if(g===null){if(s=f.return,s!==null){i=s;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===i)return u(f),e;if(g===s)return u(f),t;g=g.sibling}throw Error(I(188))}if(i.return!==s.return)i=f,s=g;else{for(var A=!1,H=f.child;H;){if(H===i){A=!0,i=f,s=g;break}if(H===s){A=!0,s=f,i=g;break}H=H.sibling}if(!A){for(H=g.child;H;){if(H===i){A=!0,i=g,s=f;break}if(H===s){A=!0,s=g,i=f;break}H=H.sibling}if(!A)throw Error(I(189))}}if(i.alternate!==s)throw Error(I(190))}if(i.tag!==3)throw Error(I(188));return i.stateNode.current===i?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var a=Object.assign,p=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),l=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var D=Symbol.for("react.client.reference");function O(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===D?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case h:return"Profiler";case r:return"StrictMode";case x:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case l:return e.displayName||"Context";case c:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case y:return t=e.displayName||null,t!==null?t:O(e.type)||"Memo";case m:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}var $=Array.isArray,U=W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=X.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},M=[],B=-1;function T(e){return{current:e}}function k(e){0>B||(e.current=M[B],M[B]=null,B--)}function V(e,t){B++,M[B]=e.current,e.current=t}var K=T(null),ue=T(null),le=T(null),q=T(null);function N(e,t){switch(V(le,t),V(ue,e),V(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?od(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=od(t),e=cd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(K),V(K,e)}function re(){k(K),k(ue),k(le)}function se(e){e.memoizedState!==null&&V(q,e);var t=K.current,i=cd(t,e.type);t!==i&&(V(ue,e),V(K,i))}function ve(e){ue.current===e&&(k(K),k(ue)),q.current===e&&(k(q),qr._currentValue=z)}var fe,Me;function _e(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",Me=-1<i.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+fe+e+Me}var Oe=!1;function qe(e,t){if(!e||Oe)return"";Oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var ne=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){ne=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=s.DetermineComponentFrameRoot(),M=g[0],H=g[1];if(M&&H){var X=M.split(`
44
- `),ie=H.split(`
45
- `);for(f=s=0;s<X.length&&!X[s].includes("DetermineComponentFrameRoot");)s++;for(;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;if(s===X.length||f===ie.length)for(s=X.length-1,f=ie.length-1;1<=s&&0<=f&&X[s]!==ie[f];)f--;for(;1<=s&&0<=f;s--,f--)if(X[s]!==ie[f]){if(s!==1||f!==1)do if(s--,f--,0>f||X[s]!==ie[f]){var le=`
46
- `+X[s].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=s&&0<=f);break}}}finally{Oe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?_e(i):""}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==t&&t!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return qe(e.type,!1);case 11:return qe(e.type.render,!1);case 1:return qe(e.type,!0);case 31:return _e("Activity");default:return""}}function ft(e){try{var t="",i=null;do t+=be(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
43
+ `+fe+e+Me}var Oe=!1;function qe(e,t){if(!e||Oe)return"";Oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var ne=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){ne=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=s.DetermineComponentFrameRoot(),A=g[0],H=g[1];if(A&&H){var G=A.split(`
44
+ `),te=H.split(`
45
+ `);for(f=s=0;s<G.length&&!G[s].includes("DetermineComponentFrameRoot");)s++;for(;f<te.length&&!te[f].includes("DetermineComponentFrameRoot");)f++;if(s===G.length||f===te.length)for(s=G.length-1,f=te.length-1;1<=s&&0<=f&&G[s]!==te[f];)f--;for(;1<=s&&0<=f;s--,f--)if(G[s]!==te[f]){if(s!==1||f!==1)do if(s--,f--,0>f||G[s]!==te[f]){var oe=`
46
+ `+G[s].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=s&&0<=f);break}}}finally{Oe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?_e(i):""}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==t&&t!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return qe(e.type,!1);case 11:return qe(e.type.render,!1);case 1:return qe(e.type,!0);case 31:return _e("Activity");default:return""}}function ft(e){try{var t="",i=null;do t+=be(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
47
  Error generating stack: `+s.message+`
48
- `+s.stack}}var Ot=Object.prototype.hasOwnProperty,Se=I.unstable_scheduleCallback,pe=I.unstable_cancelCallback,me=I.unstable_shouldYield,ue=I.unstable_requestPaint,ge=I.unstable_now,ze=I.unstable_getCurrentPriorityLevel,Re=I.unstable_ImmediatePriority,_t=I.unstable_UserBlockingPriority,Qe=I.unstable_NormalPriority,it=I.unstable_LowPriority,Ie=I.unstable_IdlePriority,Ae=I.log,Le=I.unstable_setDisableYieldValue,xt=null,tt=null;function vt(e){if(typeof Ae=="function"&&Le(e),tt&&typeof tt.setStrictMode=="function")try{tt.setStrictMode(xt,e)}catch{}}var ut=Math.clz32?Math.clz32:ir,Zt=Math.log,tr=Math.LN2;function ir(e){return e>>>=0,e===0?32:31-(Zt(e)/tr|0)|0}var jt=256,si=262144,ri=4194304;function Jt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Kr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var f=0,g=e.suspendedLanes,M=e.pingedLanes;e=e.warmLanes;var H=s&134217727;return H!==0?(s=H&~g,s!==0?f=Jt(s):(M&=H,M!==0?f=Jt(M):i||(i=H&~e,i!==0&&(f=Jt(i))))):(H=s&~g,H!==0?f=Jt(H):M!==0?f=Jt(M):i||(i=s&~e,i!==0&&(f=Jt(i)))),f===0?0:t!==0&&t!==f&&(t&g)===0&&(g=f&-f,i=t&-t,g>=i||g===32&&(i&4194048)!==0)?t:f}function sr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Sf(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 $o(){var e=ri;return ri<<=1,(ri&62914560)===0&&(ri=4194304),e}function va(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Cf(e,t,i,s,f,g){var M=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 H=e.entanglements,X=e.expirationTimes,ie=e.hiddenUpdates;for(i=M&~i;0<i;){var le=31-ut(i),de=1<<le;H[le]=0,X[le]=-1;var ne=ie[le];if(ne!==null)for(ie[le]=null,le=0;le<ne.length;le++){var ae=ne[le];ae!==null&&(ae.lane&=-536870913)}i&=~de}s!==0&&qo(e,s,0),g!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=g&~(M&~t))}function qo(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ut(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Wo(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-ut(i),f=1<<s;f&t|e[s]&t&&(e[s]|=t),i&=~f}}function Go(e,t){var i=t&-t;return i=(i&42)!==0?1:ga(i),(i&(e.suspendedLanes|t))!==0?0:i}function ga(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 pa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xo(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Bd(e.type))}function Vo(e,t){var i=P.p;try{return P.p=e,t()}finally{P.p=i}}var Mi=Math.random().toString(36).slice(2),mt="__reactFiber$"+Mi,Et="__reactProps$"+Mi,gs="__reactContainer$"+Mi,ma="__reactEvents$"+Mi,yf="__reactListeners$"+Mi,bf="__reactHandles$"+Mi,Yo="__reactResources$"+Mi,nr="__reactMarker$"+Mi;function Sa(e){delete e[mt],delete e[Et],delete e[ma],delete e[yf],delete e[bf]}function ps(e){var t=e[mt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[gs]||i[mt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=gd(e);e!==null;){if(i=e[mt])return i;e=gd(e)}return t}e=i,i=e.parentNode}return null}function ms(e){if(e=e[mt]||e[gs]){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(U(33))}function Ss(e){var t=e[Yo];return t||(t=e[Yo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[nr]=!0}var Ko=new Set,Qo={};function Ji(e,t){Cs(e,t),Cs(e+"Capture",t)}function Cs(e,t){for(Qo[e]=t,e=0;e<t.length;e++)Ko.add(t[e])}var wf=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]*$"),Zo={},Jo={};function xf(e){return Ot.call(Jo,e)?!0:Ot.call(Zo,e)?!1:wf.test(e)?Jo[e]=!0:(Zo[e]=!0,!1)}function Qr(e,t,i){if(xf(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Zr(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 ci(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ec(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lf(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,g=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(M){i=""+M,g.call(this,M)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(M){i=""+M},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){if(!e._valueTracker){var t=ec(e)?"checked":"value";e._valueTracker=Lf(e,t,""+e[t])}}function tc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ec(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Jr(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 Ef=/[\n"\\]/g;function $t(e){return e.replace(Ef,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ya(e,t,i,s,f,g,M,H){e.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.type=M:e.removeAttribute("type"),t!=null?M==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),t!=null?ba(e,M,Ft(t)):i!=null?ba(e,M,Ft(i)):s!=null&&e.removeAttribute("value"),f==null&&g!=null&&(e.defaultChecked=!!g),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?e.name=""+Ft(H):e.removeAttribute("name")}function ic(e,t,i,s,f,g,M,H){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||t!=null)){Ca(e);return}i=i!=null?""+Ft(i):"",t=t!=null?""+Ft(t):i,H||t===e.value||(e.value=t),e.defaultValue=t}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=H?e.checked:!!s,e.defaultChecked=!!s,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(e.name=M),Ca(e)}function ba(e,t,i){t==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ys(e,t,i,s){if(e=e.options,t){t={};for(var f=0;f<i.length;f++)t["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=t.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Ft(i),t=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function sc(e,t,i){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ft(i):""}function rc(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(U(92));if($(s)){if(1<s.length)throw Error(U(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Ft(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Ca(e)}function bs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Mf=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 nc(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Mf.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ac(e,t,i){if(t!=null&&typeof t!="object")throw Error(U(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var f in t)s=t[f],t.hasOwnProperty(f)&&i[f]!==s&&nc(e,f,s)}else for(var g in t)t.hasOwnProperty(g)&&nc(e,g,t[g])}function wa(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 Af=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"]]),Rf=/^[\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 en(e){return Rf.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hi(){}var xa=null;function La(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,xs=null;function lc(e){var t=ms(e);if(t&&(e=t.stateNode)){var i=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(ya(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="'+$t(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var f=s[Et]||null;if(!f)throw Error(U(90));ya(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&tc(s)}break e;case"textarea":sc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ys(e,!!i.multiple,t,!1)}}}var Ea=!1;function oc(e,t,i){if(Ea)return e(t,i);Ea=!0;try{var s=e(t);return s}finally{if(Ea=!1,(ws!==null||xs!==null)&&(Fn(),ws&&(t=ws,e=xs,xs=ws=null,lc(t),e)))for(t=0;t<e.length;t++)lc(e[t])}}function lr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Et]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(U(231,t,typeof i));return i}var ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ma=!1;if(ui)try{var or={};Object.defineProperty(or,"passive",{get:function(){Ma=!0}}),window.addEventListener("test",or,or),window.removeEventListener("test",or,or)}catch{Ma=!1}var Ai=null,Aa=null,tn=null;function cc(){if(tn)return tn;var e,t=Aa,i=t.length,s,f="value"in Ai?Ai.value:Ai.textContent,g=f.length;for(e=0;e<i&&t[e]===f[e];e++);var M=i-e;for(s=1;s<=M&&t[i-s]===f[g-s];s++);return tn=f.slice(e,1<s?1-s:void 0)}function sn(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 rn(){return!0}function hc(){return!1}function Mt(e){function t(i,s,f,g,M){this._reactName=i,this._targetInst=f,this.type=s,this.nativeEvent=g,this.target=M,this.currentTarget=null;for(var H in e)e.hasOwnProperty(H)&&(i=e[H],this[H]=i?i(g):g[H]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?rn:hc,this.isPropagationStopped=hc,this}return a(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=rn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nn=Mt(es),cr=a({},es,{view:0,detail:0}),Df=Mt(cr),Ra,Da,hr,an=a({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ba,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!==hr&&(hr&&e.type==="mousemove"?(Ra=e.screenX-hr.screenX,Da=e.screenY-hr.screenY):Da=Ra=0,hr=e),Ra)},movementY:function(e){return"movementY"in e?e.movementY:Da}}),uc=Mt(an),Tf=a({},an,{dataTransfer:0}),Bf=Mt(Tf),Of=a({},cr,{relatedTarget:0}),Ta=Mt(Of),kf=a({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),Hf=Mt(kf),zf=a({},es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nf=Mt(zf),Uf=a({},es,{data:0}),dc=Mt(Uf),If={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pf={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"},jf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ff(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jf[e])?!!t[e]:!1}function Ba(){return Ff}var $f=a({},cr,{key:function(e){if(e.key){var t=If[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ba,charCode:function(e){return e.type==="keypress"?sn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qf=Mt($f),Wf=a({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fc=Mt(Wf),Gf=a({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ba}),Xf=Mt(Gf),Vf=a({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yf=Mt(Vf),Kf=a({},an,{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}),Qf=Mt(Kf),Zf=a({},es,{newState:0,oldState:0}),Jf=Mt(Zf),e_=[9,13,27,32],Oa=ui&&"CompositionEvent"in window,ur=null;ui&&"documentMode"in document&&(ur=document.documentMode);var t_=ui&&"TextEvent"in window&&!ur,_c=ui&&(!Oa||ur&&8<ur&&11>=ur),vc=" ",gc=!1;function pc(e,t){switch(e){case"keyup":return e_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ls=!1;function i_(e,t){switch(e){case"compositionend":return mc(t);case"keypress":return t.which!==32?null:(gc=!0,vc);case"textInput":return e=t.data,e===vc&&gc?null:e;default:return null}}function s_(e,t){if(Ls)return e==="compositionend"||!Oa&&pc(e,t)?(e=cc(),tn=Aa=Ai=null,Ls=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _c&&t.locale!=="ko"?null:t.data;default:return null}}var r_={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 Sc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!r_[e.type]:t==="textarea"}function Cc(e,t,i,s){ws?xs?xs.push(s):xs=[s]:ws=s,t=Yn(t,"onChange"),0<t.length&&(i=new nn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var dr=null,fr=null;function n_(e){id(e,0)}function ln(e){var t=ar(e);if(tc(t))return e}function yc(e,t){if(e==="change")return t}var bc=!1;if(ui){var ka;if(ui){var Ha="oninput"in document;if(!Ha){var wc=document.createElement("div");wc.setAttribute("oninput","return;"),Ha=typeof wc.oninput=="function"}ka=Ha}else ka=!1;bc=ka&&(!document.documentMode||9<document.documentMode)}function xc(){dr&&(dr.detachEvent("onpropertychange",Lc),fr=dr=null)}function Lc(e){if(e.propertyName==="value"&&ln(fr)){var t=[];Cc(t,fr,e,La(e)),oc(n_,t)}}function a_(e,t,i){e==="focusin"?(xc(),dr=t,fr=i,dr.attachEvent("onpropertychange",Lc)):e==="focusout"&&xc()}function l_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ln(fr)}function o_(e,t){if(e==="click")return ln(t)}function c_(e,t){if(e==="input"||e==="change")return ln(t)}function h_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:h_;function _r(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var f=i[s];if(!Ot.call(t,f)||!kt(e[f],t[f]))return!1}return!0}function Ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mc(e,t){var i=Ec(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ec(i)}}function Ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(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=Jr(e.document)}return t}function za(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 u_=ui&&"documentMode"in document&&11>=document.documentMode,Es=null,Na=null,vr=null,Ua=!1;function Dc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ua||Es==null||Es!==Jr(s)||(s=Es,"selectionStart"in s&&za(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),vr&&_r(vr,s)||(vr=s,s=Yn(Na,"onSelect"),0<s.length&&(t=new nn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Es)))}function ts(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ms={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},Ia={},Tc={};ui&&(Tc=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function is(e){if(Ia[e])return Ia[e];if(!Ms[e])return e;var t=Ms[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Tc)return Ia[e]=t[i];return e}var Bc=is("animationend"),Oc=is("animationiteration"),kc=is("animationstart"),d_=is("transitionrun"),f_=is("transitionstart"),__=is("transitioncancel"),Hc=is("transitionend"),zc=new Map,Pa="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(" ");Pa.push("scrollEnd");function ei(e,t){zc.set(e,t),Ji(t,[e])}var on=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)},qt=[],As=0,ja=0;function cn(){for(var e=As,t=ja=As=0;t<e;){var i=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var f=qt[t];qt[t++]=null;var g=qt[t];if(qt[t++]=null,s!==null&&f!==null){var M=s.pending;M===null?f.next=f:(f.next=M.next,M.next=f),s.pending=f}g!==0&&Nc(i,f,g)}}function hn(e,t,i,s){qt[As++]=e,qt[As++]=t,qt[As++]=i,qt[As++]=s,ja|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Fa(e,t,i,s){return hn(e,t,i,s),un(e)}function ss(e,t){return hn(e,null,null,t),un(e)}function Nc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var f=!1,g=e.return;g!==null;)g.childLanes|=i,s=g.alternate,s!==null&&(s.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(f=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,f&&t!==null&&(f=31-ut(i),e=g.hiddenUpdates,s=e[f],s===null?e[f]=[t]:s.push(t),t.lane=i|536870912),g):null}function un(e){if(50<Nr)throw Nr=0,Ql=null,Error(U(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rs={};function v_(e,t,i,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,i,s){return new v_(e,t,i,s)}function $a(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var i=e.alternate;return i===null?(i=Ht(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 Uc(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 dn(e,t,i,s,f,g){var M=0;if(s=e,typeof e=="function")$a(e)&&(M=1);else if(typeof e=="string")M=Cv(e,i,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case C:return e=Ht(31,i,t,f),e.elementType=C,e.lanes=g,e;case o:return rs(i.children,f,g,t);case r:M=8,f|=24;break;case h:return e=Ht(12,i,t,f|2),e.elementType=h,e.lanes=g,e;case x:return e=Ht(13,i,t,f),e.elementType=x,e.lanes=g,e;case v:return e=Ht(19,i,t,f),e.elementType=v,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l:M=10;break e;case c:M=9;break e;case S:M=11;break e;case y:M=14;break e;case m:M=16,s=null;break e}M=29,i=Error(U(130,e===null?"null":typeof e,"")),s=null}return t=Ht(M,i,t,f),t.elementType=e,t.type=s,t.lanes=g,t}function rs(e,t,i,s){return e=Ht(7,e,s,t),e.lanes=i,e}function qa(e,t,i){return e=Ht(6,e,null,t),e.lanes=i,e}function Ic(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function Wa(e,t,i){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pc=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=Pc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ft(t)},Pc.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var Ds=[],Ts=0,fn=null,gr=0,Gt=[],Xt=0,Ri=null,ni=1,ai="";function fi(e,t){Ds[Ts++]=gr,Ds[Ts++]=fn,fn=e,gr=t}function jc(e,t,i){Gt[Xt++]=ni,Gt[Xt++]=ai,Gt[Xt++]=Ri,Ri=e;var s=ni;e=ai;var f=32-ut(s)-1;s&=~(1<<f),i+=1;var g=32-ut(t)+f;if(30<g){var M=f-f%5;g=(s&(1<<M)-1).toString(32),s>>=M,f-=M,ni=1<<32-ut(t)+f|i<<f|s,ai=g+e}else ni=1<<g|i<<f|s,ai=e}function Ga(e){e.return!==null&&(fi(e,1),jc(e,1,0))}function Xa(e){for(;e===fn;)fn=Ds[--Ts],Ds[Ts]=null,gr=Ds[--Ts],Ds[Ts]=null;for(;e===Ri;)Ri=Gt[--Xt],Gt[Xt]=null,ai=Gt[--Xt],Gt[Xt]=null,ni=Gt[--Xt],Gt[Xt]=null}function Fc(e,t){Gt[Xt++]=ni,Gt[Xt++]=ai,Gt[Xt++]=Ri,ni=t.id,ai=t.overflow,Ri=e}var St=null,Ze=null,Pe=!1,Di=null,Vt=!1,Va=Error(U(519));function Ti(e){var t=Error(U(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(Wt(t,e)),Va}function $c(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[mt]=e,t[Et]=s,i){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(i=0;i<Ir.length;i++)He(Ir[i],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),ic(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),rc(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||ad(t.textContent,i)?(s.popover!=null&&(He("beforetoggle",t),He("toggle",t)),s.onScroll!=null&&He("scroll",t),s.onScrollEnd!=null&&He("scrollend",t),s.onClick!=null&&(t.onclick=hi),t=!0):t=!1,t||Ti(e,!0)}function qc(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:Vt=!1;return;case 27:case 3:Vt=!0;return;default:St=St.return}}function Bs(e){if(e!==St)return!1;if(!Pe)return qc(e),Pe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||fo(e.type,e.memoizedProps)),i=!i),i&&Ze&&Ti(e),qc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));Ze=vd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));Ze=vd(e)}else t===27?(t=Ze,Wi(e.type)?(e=mo,mo=null,Ze=e):Ze=t):Ze=St?Kt(e.stateNode.nextSibling):null;return!0}function ns(){Ze=St=null,Pe=!1}function Ya(){var e=Di;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Di=null),e}function pr(e){Di===null?Di=[e]:Di.push(e)}var Ka=T(null),as=null,_i=null;function Bi(e,t,i){q(Ka,t._currentValue),t._currentValue=i}function vi(e){e._currentValue=Ka.current,B(Ka)}function Qa(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Za(e,t,i,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var g=f.dependencies;if(g!==null){var M=f.child;g=g.firstContext;e:for(;g!==null;){var H=g;g=f;for(var X=0;X<t.length;X++)if(H.context===t[X]){g.lanes|=i,H=g.alternate,H!==null&&(H.lanes|=i),Qa(g.return,i,e),s||(M=null);break e}g=H.next}}else if(f.tag===18){if(M=f.return,M===null)throw Error(U(341));M.lanes|=i,g=M.alternate,g!==null&&(g.lanes|=i),Qa(M,i,e),M=null}else M=f.child;if(M!==null)M.return=f;else for(M=f;M!==null;){if(M===e){M=null;break}if(f=M.sibling,f!==null){f.return=M.return,M=f;break}M=M.return}f=M}}function Os(e,t,i,s){e=null;for(var f=t,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var M=f.alternate;if(M===null)throw Error(U(387));if(M=M.memoizedProps,M!==null){var H=f.type;kt(f.pendingProps.value,M.value)||(e!==null?e.push(H):e=[H])}}else if(f===W.current){if(M=f.alternate,M===null)throw Error(U(387));M.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(qr):e=[qr])}f=f.return}e!==null&&Za(t,e,i,s),t.flags|=262144}function _n(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ls(e){as=e,_i=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Wc(as,e)}function vn(e,t){return as===null&&ls(e),Wc(e,t)}function Wc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},_i===null){if(e===null)throw Error(U(308));_i=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _i=_i.next=t;return i}var g_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},p_=I.unstable_scheduleCallback,m_=I.unstable_NormalPriority,lt={$$typeof:l,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ja(){return{controller:new g_,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&p_(m_,function(){e.controller.abort()})}var Sr=null,el=0,ks=0,Hs=null;function S_(e,t){if(Sr===null){var i=Sr=[];el=0,ks=so(),Hs={status:"pending",value:void 0,then:function(s){i.push(s)}}}return el++,t.then(Gc,Gc),t}function Gc(){if(--el===0&&Sr!==null){Hs!==null&&(Hs.status="fulfilled");var e=Sr;Sr=null,ks=0,Hs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function C_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var f=0;f<i.length;f++)(0,i[f])(t)},function(f){for(s.status="rejected",s.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),s}var Xc=N.S;N.S=function(e,t){Du=ge(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&S_(e,t),Xc!==null&&Xc(e,t)};var os=T(null);function tl(){var e=os.current;return e!==null?e:Ke.pooledCache}function gn(e,t){t===null?q(os,os.current):q(os,t.pool)}function Vc(){var e=tl();return e===null?null:{parent:lt._currentValue,pool:e}}var zs=Error(U(460)),il=Error(U(474)),pn=Error(U(542)),mn={then:function(){}};function Yc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(hi,hi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zc(e),e;default:if(typeof t.status=="string")t.then(hi,hi);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(U(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=s}},function(s){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zc(e),e}throw hs=t,zs}}function cs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(hs=i,zs):i}}var hs=null;function Qc(){if(hs===null)throw Error(U(459));var e=hs;return hs=null,e}function Zc(e){if(e===zs||e===pn)throw Error(U(483))}var Ns=null,Cr=0;function Sn(e){var t=Cr;return Cr+=1,Ns===null&&(Ns=[]),Kc(Ns,e,t)}function yr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cn(e,t){throw t.$$typeof===p?Error(U(525)):(e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jc(e){function t(Z,Y){if(e){var te=Z.deletions;te===null?(Z.deletions=[Y],Z.flags|=16):te.push(Y)}}function i(Z,Y){if(!e)return null;for(;Y!==null;)t(Z,Y),Y=Y.sibling;return null}function s(Z){for(var Y=new Map;Z!==null;)Z.key!==null?Y.set(Z.key,Z):Y.set(Z.index,Z),Z=Z.sibling;return Y}function f(Z,Y){return Z=di(Z,Y),Z.index=0,Z.sibling=null,Z}function g(Z,Y,te){return Z.index=te,e?(te=Z.alternate,te!==null?(te=te.index,te<Y?(Z.flags|=67108866,Y):te):(Z.flags|=67108866,Y)):(Z.flags|=1048576,Y)}function M(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function H(Z,Y,te,he){return Y===null||Y.tag!==6?(Y=qa(te,Z.mode,he),Y.return=Z,Y):(Y=f(Y,te),Y.return=Z,Y)}function X(Z,Y,te,he){var xe=te.type;return xe===o?le(Z,Y,te.props.children,he,te.key):Y!==null&&(Y.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===Y.type)?(Y=f(Y,te.props),yr(Y,te),Y.return=Z,Y):(Y=dn(te.type,te.key,te.props,null,Z.mode,he),yr(Y,te),Y.return=Z,Y)}function ie(Z,Y,te,he){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=Wa(te,Z.mode,he),Y.return=Z,Y):(Y=f(Y,te.children||[]),Y.return=Z,Y)}function le(Z,Y,te,he,xe){return Y===null||Y.tag!==7?(Y=rs(te,Z.mode,he,xe),Y.return=Z,Y):(Y=f(Y,te),Y.return=Z,Y)}function de(Z,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=qa(""+Y,Z.mode,te),Y.return=Z,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return te=dn(Y.type,Y.key,Y.props,null,Z.mode,te),yr(te,Y),te.return=Z,te;case b:return Y=Wa(Y,Z.mode,te),Y.return=Z,Y;case m:return Y=cs(Y),de(Z,Y,te)}if($(Y)||E(Y))return Y=rs(Y,Z.mode,te,null),Y.return=Z,Y;if(typeof Y.then=="function")return de(Z,Sn(Y),te);if(Y.$$typeof===l)return de(Z,vn(Z,Y),te);Cn(Z,Y)}return null}function ne(Z,Y,te,he){var xe=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return xe!==null?null:H(Z,Y,""+te,he);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case w:return te.key===xe?X(Z,Y,te,he):null;case b:return te.key===xe?ie(Z,Y,te,he):null;case m:return te=cs(te),ne(Z,Y,te,he)}if($(te)||E(te))return xe!==null?null:le(Z,Y,te,he,null);if(typeof te.then=="function")return ne(Z,Y,Sn(te),he);if(te.$$typeof===l)return ne(Z,Y,vn(Z,te),he);Cn(Z,te)}return null}function ae(Z,Y,te,he,xe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Z=Z.get(te)||null,H(Y,Z,""+he,xe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case w:return Z=Z.get(he.key===null?te:he.key)||null,X(Y,Z,he,xe);case b:return Z=Z.get(he.key===null?te:he.key)||null,ie(Y,Z,he,xe);case m:return he=cs(he),ae(Z,Y,te,he,xe)}if($(he)||E(he))return Z=Z.get(te)||null,le(Y,Z,he,xe,null);if(typeof he.then=="function")return ae(Z,Y,te,Sn(he),xe);if(he.$$typeof===l)return ae(Z,Y,te,vn(Y,he),xe);Cn(Y,he)}return null}function Ce(Z,Y,te,he){for(var xe=null,je=null,ye=Y,Be=Y=0,Ue=null;ye!==null&&Be<te.length;Be++){ye.index>Be?(Ue=ye,ye=null):Ue=ye.sibling;var Fe=ne(Z,ye,te[Be],he);if(Fe===null){ye===null&&(ye=Ue);break}e&&ye&&Fe.alternate===null&&t(Z,ye),Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe,ye=Ue}if(Be===te.length)return i(Z,ye),Pe&&fi(Z,Be),xe;if(ye===null){for(;Be<te.length;Be++)ye=de(Z,te[Be],he),ye!==null&&(Y=g(ye,Y,Be),je===null?xe=ye:je.sibling=ye,je=ye);return Pe&&fi(Z,Be),xe}for(ye=s(ye);Be<te.length;Be++)Ue=ae(ye,Z,Be,te[Be],he),Ue!==null&&(e&&Ue.alternate!==null&&ye.delete(Ue.key===null?Be:Ue.key),Y=g(Ue,Y,Be),je===null?xe=Ue:je.sibling=Ue,je=Ue);return e&&ye.forEach(function(Ki){return t(Z,Ki)}),Pe&&fi(Z,Be),xe}function Ee(Z,Y,te,he){if(te==null)throw Error(U(151));for(var xe=null,je=null,ye=Y,Be=Y=0,Ue=null,Fe=te.next();ye!==null&&!Fe.done;Be++,Fe=te.next()){ye.index>Be?(Ue=ye,ye=null):Ue=ye.sibling;var Ki=ne(Z,ye,Fe.value,he);if(Ki===null){ye===null&&(ye=Ue);break}e&&ye&&Ki.alternate===null&&t(Z,ye),Y=g(Ki,Y,Be),je===null?xe=Ki:je.sibling=Ki,je=Ki,ye=Ue}if(Fe.done)return i(Z,ye),Pe&&fi(Z,Be),xe;if(ye===null){for(;!Fe.done;Be++,Fe=te.next())Fe=de(Z,Fe.value,he),Fe!==null&&(Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe);return Pe&&fi(Z,Be),xe}for(ye=s(ye);!Fe.done;Be++,Fe=te.next())Fe=ae(ye,Z,Be,Fe.value,he),Fe!==null&&(e&&Fe.alternate!==null&&ye.delete(Fe.key===null?Be:Fe.key),Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe);return e&&ye.forEach(function(Tv){return t(Z,Tv)}),Pe&&fi(Z,Be),xe}function Ye(Z,Y,te,he){if(typeof te=="object"&&te!==null&&te.type===o&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case w:e:{for(var xe=te.key;Y!==null;){if(Y.key===xe){if(xe=te.type,xe===o){if(Y.tag===7){i(Z,Y.sibling),he=f(Y,te.props.children),he.return=Z,Z=he;break e}}else if(Y.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===Y.type){i(Z,Y.sibling),he=f(Y,te.props),yr(he,te),he.return=Z,Z=he;break e}i(Z,Y);break}else t(Z,Y);Y=Y.sibling}te.type===o?(he=rs(te.props.children,Z.mode,he,te.key),he.return=Z,Z=he):(he=dn(te.type,te.key,te.props,null,Z.mode,he),yr(he,te),he.return=Z,Z=he)}return M(Z);case b:e:{for(xe=te.key;Y!==null;){if(Y.key===xe)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){i(Z,Y.sibling),he=f(Y,te.children||[]),he.return=Z,Z=he;break e}else{i(Z,Y);break}else t(Z,Y);Y=Y.sibling}he=Wa(te,Z.mode,he),he.return=Z,Z=he}return M(Z);case m:return te=cs(te),Ye(Z,Y,te,he)}if($(te))return Ce(Z,Y,te,he);if(E(te)){if(xe=E(te),typeof xe!="function")throw Error(U(150));return te=xe.call(te),Ee(Z,Y,te,he)}if(typeof te.then=="function")return Ye(Z,Y,Sn(te),he);if(te.$$typeof===l)return Ye(Z,Y,vn(Z,te),he);Cn(Z,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(i(Z,Y.sibling),he=f(Y,te),he.return=Z,Z=he):(i(Z,Y),he=qa(te,Z.mode,he),he.return=Z,Z=he),M(Z)):i(Z,Y)}return function(Z,Y,te,he){try{Cr=0;var xe=Ye(Z,Y,te,he);return Ns=null,xe}catch(ye){if(ye===zs||ye===pn)throw ye;var je=Ht(29,ye,null,Z.mode);return je.lanes=he,je.return=Z,je}finally{}}}var us=Jc(!0),eh=Jc(!1),Oi=!1;function sl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rl(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ki(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,($e&2)!==0){var f=s.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),s.pending=t,t=un(e),Nc(e,null,i),t}return hn(e,s,t,i),un(e)}function br(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Wo(e,i)}}function nl(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var f=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var M={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?f=g=M:g=g.next=M,i=i.next}while(i!==null);g===null?f=g=t:g=g.next=t}else f=g=t;i={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var al=!1;function wr(){if(al){var e=Hs;if(e!==null)throw e}}function xr(e,t,i,s){al=!1;var f=e.updateQueue;Oi=!1;var g=f.firstBaseUpdate,M=f.lastBaseUpdate,H=f.shared.pending;if(H!==null){f.shared.pending=null;var X=H,ie=X.next;X.next=null,M===null?g=ie:M.next=ie,M=X;var le=e.alternate;le!==null&&(le=le.updateQueue,H=le.lastBaseUpdate,H!==M&&(H===null?le.firstBaseUpdate=ie:H.next=ie,le.lastBaseUpdate=X))}if(g!==null){var de=f.baseState;M=0,le=ie=X=null,H=g;do{var ne=H.lane&-536870913,ae=ne!==H.lane;if(ae?(Ne&ne)===ne:(s&ne)===ne){ne!==0&&ne===ks&&(al=!0),le!==null&&(le=le.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ce=e,Ee=H;ne=t;var Ye=i;switch(Ee.tag){case 1:if(Ce=Ee.payload,typeof Ce=="function"){de=Ce.call(Ye,de,ne);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ee.payload,ne=typeof Ce=="function"?Ce.call(Ye,de,ne):Ce,ne==null)break e;de=a({},de,ne);break e;case 2:Oi=!0}}ne=H.callback,ne!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:H.tag,payload:H.payload,callback:H.callback,next:null},le===null?(ie=le=ae,X=de):le=le.next=ae,M|=ne;if(H=H.next,H===null){if(H=f.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);le===null&&(X=de),f.baseState=X,f.firstBaseUpdate=ie,f.lastBaseUpdate=le,g===null&&(f.shared.lanes=0),Pi|=M,e.lanes=M,e.memoizedState=de}}function th(e,t){if(typeof e!="function")throw Error(U(191,e));e.call(t)}function ih(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)th(i[e],t)}var Us=T(null),yn=T(0);function sh(e,t){e=xi,q(yn,e),q(Us,t),xi=e|t.baseLanes}function ll(){q(yn,xi),q(Us,Us.current)}function ol(){xi=yn.current,B(Us),B(yn)}var zt=T(null),Yt=null;function zi(e){var t=e.alternate;q(nt,nt.current&1),q(zt,e),Yt===null&&(t===null||Us.current!==null||t.memoizedState!==null)&&(Yt=e)}function cl(e){q(nt,nt.current),q(zt,e),Yt===null&&(Yt=e)}function rh(e){e.tag===22?(q(nt,nt.current),q(zt,e),Yt===null&&(Yt=e)):Ni()}function Ni(){q(nt,nt.current),q(zt,zt.current)}function Nt(e){B(zt),Yt===e&&(Yt=null),B(nt)}var nt=T(0);function bn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||go(i)||po(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 gi=0,Te=null,Xe=null,ot=null,wn=!1,Is=!1,ds=!1,xn=0,Lr=0,Ps=null,y_=0;function st(){throw Error(U(321))}function hl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!kt(e[i],t[i]))return!1;return!0}function ul(e,t,i,s,f,g){return gi=g,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?jh:El,ds=!1,g=i(s,f),ds=!1,Is&&(g=ah(t,i,s,f)),nh(e),g}function nh(e){N.H=Ar;var t=Xe!==null&&Xe.next!==null;if(gi=0,ot=Xe=Te=null,wn=!1,Lr=0,Ps=null,t)throw Error(U(300));e===null||ct||(e=e.dependencies,e!==null&&_n(e)&&(ct=!0))}function ah(e,t,i,s){Te=e;var f=0;do{if(Is&&(Ps=null),Lr=0,Is=!1,25<=f)throw Error(U(301));if(f+=1,ot=Xe=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}N.H=Fh,g=t(i,s)}while(Is);return g}function b_(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?Er(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),t}function dl(){var e=xn!==0;return xn=0,e}function fl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function _l(e){if(wn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wn=!1}gi=0,ot=Xe=Te=null,Is=!1,Lr=xn=0,Ps=null}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Te.memoizedState=ot=e:ot=ot.next=e,ot}function at(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=ot===null?Te.memoizedState:ot.next;if(t!==null)ot=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(U(467)):Error(U(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ot===null?Te.memoizedState=ot=e:ot=ot.next=e}return ot}function Ln(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Er(e){var t=Lr;return Lr+=1,Ps===null&&(Ps=[]),e=Kc(Ps,e,t),t=Te,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?jh:El),e}function En(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Er(e);if(e.$$typeof===l)return Ct(e)}throw Error(U(438,String(e)))}function vl(e){var t=null,i=Te.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Ln(),Te.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=L;return t.index++,i}function pi(e,t){return typeof t=="function"?t(e):t}function Mn(e){var t=at();return gl(t,Xe,e)}function gl(e,t,i){var s=e.queue;if(s===null)throw Error(U(311));s.lastRenderedReducer=i;var f=e.baseQueue,g=s.pending;if(g!==null){if(f!==null){var M=f.next;f.next=g.next,g.next=M}t.baseQueue=f=g,s.pending=null}if(g=e.baseState,f===null)e.memoizedState=g;else{t=f.next;var H=M=null,X=null,ie=t,le=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Ne&de)===de:(gi&de)===de){var ne=ie.revertLane;if(ne===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===ks&&(le=!0);else if((gi&ne)===ne){ie=ie.next,ne===ks&&(le=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(H=X=de,M=g):X=X.next=de,Te.lanes|=ne,Pi|=ne;de=ie.action,ds&&i(g,de),g=ie.hasEagerState?ie.eagerState:i(g,de)}else ne={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(H=X=ne,M=g):X=X.next=ne,Te.lanes|=de,Pi|=de;ie=ie.next}while(ie!==null&&ie!==t);if(X===null?M=g:X.next=H,!kt(g,e.memoizedState)&&(ct=!0,le&&(i=Hs,i!==null)))throw i;e.memoizedState=g,e.baseState=M,e.baseQueue=X,s.lastRenderedState=g}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function pl(e){var t=at(),i=t.queue;if(i===null)throw Error(U(311));i.lastRenderedReducer=e;var s=i.dispatch,f=i.pending,g=t.memoizedState;if(f!==null){i.pending=null;var M=f=f.next;do g=e(g,M.action),M=M.next;while(M!==f);kt(g,t.memoizedState)||(ct=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),i.lastRenderedState=g}return[g,s]}function lh(e,t,i){var s=Te,f=at(),g=Pe;if(g){if(i===void 0)throw Error(U(407));i=i()}else i=t();var M=!kt((Xe||f).memoizedState,i);if(M&&(f.memoizedState=i,ct=!0),f=f.queue,Cl(hh.bind(null,s,f,e),[e]),f.getSnapshot!==t||M||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,js(9,{destroy:void 0},ch.bind(null,s,f,i,t),null),Ke===null)throw Error(U(349));g||(gi&127)!==0||oh(s,t,i)}return i}function oh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Te.updateQueue,t===null?(t=Ln(),Te.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ch(e,t,i,s){t.value=i,t.getSnapshot=s,uh(t)&&dh(e)}function hh(e,t,i){return i(function(){uh(t)&&dh(e)})}function uh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function dh(e){var t=ss(e,2);t!==null&&Bt(t,e,2)}function ml(e){var t=Lt();if(typeof e=="function"){var i=e;if(e=i(),ds){vt(!0);try{i()}finally{vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},t}function fh(e,t,i,s){return e.baseState=i,gl(e,Xe,typeof s=="function"?s:pi)}function w_(e,t,i,s,f){if(Dn(e))throw Error(U(485));if(e=t.action,e!==null){var g={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){g.listeners.push(M)}};N.T!==null?i(!0):g.isTransition=!1,s(g),i=t.pending,i===null?(g.next=t.pending=g,_h(t,g)):(g.next=i.next,t.pending=i.next=g)}}function _h(e,t){var i=t.action,s=t.payload,f=e.state;if(t.isTransition){var g=N.T,M={};N.T=M;try{var H=i(f,s),X=N.S;X!==null&&X(M,H),vh(e,t,H)}catch(ie){Sl(e,t,ie)}finally{g!==null&&M.types!==null&&(g.types=M.types),N.T=g}}else try{g=i(f,s),vh(e,t,g)}catch(ie){Sl(e,t,ie)}}function vh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){gh(e,t,s)},function(s){return Sl(e,t,s)}):gh(e,t,i)}function gh(e,t,i){t.status="fulfilled",t.value=i,ph(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,_h(e,i)))}function Sl(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,ph(t),t=t.next;while(t!==s)}e.action=null}function ph(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mh(e,t){return t}function Sh(e,t){if(Pe){var i=Ke.formState;if(i!==null){e:{var s=Te;if(Pe){if(Ze){t:{for(var f=Ze,g=Vt;f.nodeType!==8;){if(!g){f=null;break t}if(f=Kt(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Ze=Kt(f.nextSibling),s=f.data==="F!";break e}}Ti(s)}s=!1}s&&(t=i[0])}}return i=Lt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mh,lastRenderedState:t},i.queue=s,i=Uh.bind(null,Te,s),s.dispatch=i,s=ml(!1),g=Ll.bind(null,Te,!1,s.queue),s=Lt(),f={state:t,dispatch:null,action:e,pending:null},s.queue=f,i=w_.bind(null,Te,f,g,i),f.dispatch=i,s.memoizedState=e,[t,i,!1]}function Ch(e){var t=at();return yh(t,Xe,e)}function yh(e,t,i){if(t=gl(e,t,mh)[0],e=Mn(pi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Er(t)}catch(M){throw M===zs?pn:M}else s=t;t=at();var f=t.queue,g=f.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,js(9,{destroy:void 0},x_.bind(null,f,i),null)),[s,g,e]}function x_(e,t){e.action=t}function bh(e){var t=at(),i=Xe;if(i!==null)return yh(t,i,e);at(),t=t.memoizedState,i=at();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function js(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Ln(),Te.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function wh(){return at().memoizedState}function An(e,t,i,s){var f=Lt();Te.flags|=e,f.memoizedState=js(1|t,{destroy:void 0},i,s===void 0?null:s)}function Rn(e,t,i,s){var f=at();s=s===void 0?null:s;var g=f.memoizedState.inst;Xe!==null&&s!==null&&hl(s,Xe.memoizedState.deps)?f.memoizedState=js(t,g,i,s):(Te.flags|=e,f.memoizedState=js(1|t,g,i,s))}function xh(e,t){An(8390656,8,e,t)}function Cl(e,t){Rn(2048,8,e,t)}function L_(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Ln(),Te.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Lh(e){var t=at().memoizedState;return L_({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(U(440));return t.impl.apply(void 0,arguments)}}function Eh(e,t){return Rn(4,2,e,t)}function Mh(e,t){return Rn(4,4,e,t)}function Ah(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 Rh(e,t,i){i=i!=null?i.concat([e]):null,Rn(4,4,Ah.bind(null,t,e),i)}function yl(){}function Dh(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&hl(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Th(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&hl(t,s[1]))return s[0];if(s=e(),ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s}function bl(e,t,i){return i===void 0||(gi&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Bu(),Te.lanes|=e,Pi|=e,i)}function Bh(e,t,i,s){return kt(i,t)?i:Us.current!==null?(e=bl(e,i,s),kt(e,t)||(ct=!0),e):(gi&42)===0||(gi&1073741824)!==0&&(Ne&261930)===0?(ct=!0,e.memoizedState=i):(e=Bu(),Te.lanes|=e,Pi|=e,t)}function Oh(e,t,i,s,f){var g=P.p;P.p=g!==0&&8>g?g:8;var M=N.T,H={};N.T=H,Ll(e,!1,t,i);try{var X=f(),ie=N.S;if(ie!==null&&ie(H,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var le=C_(X,s);Mr(e,t,le,Pt(e))}else Mr(e,t,s,Pt(e))}catch(de){Mr(e,t,{then:function(){},status:"rejected",reason:de},Pt())}finally{P.p=g,M!==null&&H.types!==null&&(M.types=H.types),N.T=M}}function E_(){}function wl(e,t,i,s){if(e.tag!==5)throw Error(U(476));var f=kh(e).queue;Oh(e,f,t,j,i===null?E_:function(){return Hh(e),i(s)})}function kh(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:pi,lastRenderedState:j},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hh(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Mr(e,t.next.queue,{},Pt())}function xl(){return Ct(qr)}function zh(){return at().memoizedState}function Nh(){return at().memoizedState}function M_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Pt();e=ki(i);var s=Hi(t,e,i);s!==null&&(Bt(s,t,i),br(s,t,i)),t={cache:Ja()},e.payload=t;return}t=t.return}}function A_(e,t,i){var s=Pt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dn(e)?Ih(t,i):(i=Fa(e,t,i,s),i!==null&&(Bt(i,e,s),Ph(i,t,s)))}function Uh(e,t,i){var s=Pt();Mr(e,t,i,s)}function Mr(e,t,i,s){var f={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Dn(e))Ih(t,f);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var M=t.lastRenderedState,H=g(M,i);if(f.hasEagerState=!0,f.eagerState=H,kt(H,M))return hn(e,t,f,0),Ke===null&&cn(),!1}catch{}finally{}if(i=Fa(e,t,f,s),i!==null)return Bt(i,e,s),Ph(i,t,s),!0}return!1}function Ll(e,t,i,s){if(s={lane:2,revertLane:so(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dn(e)){if(t)throw Error(U(479))}else t=Fa(e,i,s,2),t!==null&&Bt(t,e,2)}function Dn(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Ih(e,t){Is=wn=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ph(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Wo(e,i)}}var Ar={readContext:Ct,use:En,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};Ar.useEffectEvent=st;var jh={readContext:Ct,use:En,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:xh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,An(4194308,4,Ah.bind(null,t,e),i)},useLayoutEffect:function(e,t){return An(4194308,4,e,t)},useInsertionEffect:function(e,t){An(4,2,e,t)},useMemo:function(e,t){var i=Lt();t=t===void 0?null:t;var s=e();if(ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Lt();if(i!==void 0){var f=i(t);if(ds){vt(!0);try{i(t)}finally{vt(!1)}}}else f=t;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=A_.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=ml(e);var t=e.queue,i=Uh.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:yl,useDeferredValue:function(e,t){var i=Lt();return bl(i,e,t)},useTransition:function(){var e=ml(!1);return e=Oh.bind(null,Te,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Te,f=Lt();if(Pe){if(i===void 0)throw Error(U(407));i=i()}else{if(i=t(),Ke===null)throw Error(U(349));(Ne&127)!==0||oh(s,t,i)}f.memoizedState=i;var g={value:i,getSnapshot:t};return f.queue=g,xh(hh.bind(null,s,g,e),[e]),s.flags|=2048,js(9,{destroy:void 0},ch.bind(null,s,g,i,t),null),i},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Pe){var i=ai,s=ni;i=(s&~(1<<32-ut(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=xn++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=y_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xl,useFormState:Sh,useActionState:Sh,useOptimistic:function(e){var t=Lt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ll.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:vl,useCacheRefresh:function(){return Lt().memoizedState=M_.bind(null,Te)},useEffectEvent:function(e){var t=Lt(),i={impl:e};return t.memoizedState=i,function(){if(($e&2)!==0)throw Error(U(440));return i.impl.apply(void 0,arguments)}}},El={readContext:Ct,use:En,useCallback:Dh,useContext:Ct,useEffect:Cl,useImperativeHandle:Rh,useInsertionEffect:Eh,useLayoutEffect:Mh,useMemo:Th,useReducer:Mn,useRef:wh,useState:function(){return Mn(pi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=at();return Bh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Mn(pi)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:lh,useId:zh,useHostTransitionStatus:xl,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var i=at();return fh(i,Xe,e,t)},useMemoCache:vl,useCacheRefresh:Nh};El.useEffectEvent=Lh;var Fh={readContext:Ct,use:En,useCallback:Dh,useContext:Ct,useEffect:Cl,useImperativeHandle:Rh,useInsertionEffect:Eh,useLayoutEffect:Mh,useMemo:Th,useReducer:pl,useRef:wh,useState:function(){return pl(pi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=at();return Xe===null?bl(i,e,t):Bh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=pl(pi)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:lh,useId:zh,useHostTransitionStatus:xl,useFormState:bh,useActionState:bh,useOptimistic:function(e,t){var i=at();return Xe!==null?fh(i,Xe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:vl,useCacheRefresh:Nh};Fh.useEffectEvent=Lh;function Ml(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:a({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Al={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=ki(s);f.payload=t,i!=null&&(f.callback=i),t=Hi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=ki(s);f.tag=1,f.payload=t,i!=null&&(f.callback=i),t=Hi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Pt(),s=ki(i);s.tag=2,t!=null&&(s.callback=t),t=Hi(e,s,i),t!==null&&(Bt(t,e,i),br(t,e,i))}};function $h(e,t,i,s,f,g,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,g,M):t.prototype&&t.prototype.isPureReactComponent?!_r(i,s)||!_r(f,g):!0}function qh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Al.enqueueReplaceState(t,t.state,null)}function fs(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=a({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function Wh(e){on(e)}function Gh(e){console.error(e)}function Xh(e){on(e)}function Tn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Vh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Rl(e,t,i){return i=ki(i),i.tag=3,i.payload={element:null},i.callback=function(){Tn(e,t)},i}function Yh(e){return e=ki(e),e.tag=3,e}function Kh(e,t,i,s){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=s.value;e.payload=function(){return f(g)},e.callback=function(){Vh(t,i,s)}}var M=i.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){Vh(t,i,s),typeof f!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var H=s.stack;this.componentDidCatch(s.value,{componentStack:H!==null?H:""})})}function R_(e,t,i,s,f){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,f,!0),i=zt.current,i!==null){switch(i.tag){case 31:case 13:return Yt===null?$n():i.alternate===null&&rt===0&&(rt=3),i.flags&=-257,i.flags|=65536,i.lanes=f,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),eo(e,s,f)),!1;case 22:return i.flags|=65536,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),eo(e,s,f)),!1}throw Error(U(435,i.tag))}return eo(e,s,f),$n(),!1}if(Pe)return t=zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,s!==Va&&(e=Error(U(422),{cause:s}),pr(Wt(e,i)))):(s!==Va&&(t=Error(U(423),{cause:s}),pr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Wt(s,i),f=Rl(e.stateNode,s,f),nl(e,f),rt!==4&&(rt=2)),!1;var g=Error(U(520),{cause:s});if(g=Wt(g,i),zr===null?zr=[g]:zr.push(g),rt!==4&&(rt=2),t===null)return!0;s=Wt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Rl(i.stateNode,s,e),nl(i,e),!1;case 1:if(t=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ji===null||!ji.has(g))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Yh(f),Kh(f,e,i,s),nl(i,f),!1}i=i.return}while(i!==null);return!1}var Dl=Error(U(461)),ct=!1;function yt(e,t,i,s){t.child=e===null?eh(t,null,i,s):us(t,e.child,i,s)}function Qh(e,t,i,s,f){i=i.render;var g=t.ref;if("ref"in s){var M={};for(var H in s)H!=="ref"&&(M[H]=s[H])}else M=s;return ls(t),s=ul(e,t,i,M,g,f),H=dl(),e!==null&&!ct?(fl(e,t,f),mi(e,t,f)):(Pe&&H&&Ga(t),t.flags|=1,yt(e,t,s,f),t.child)}function Zh(e,t,i,s,f){if(e===null){var g=i.type;return typeof g=="function"&&!$a(g)&&g.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=g,Jh(e,t,g,s,f)):(e=dn(i.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Ul(e,f)){var M=g.memoizedProps;if(i=i.compare,i=i!==null?i:_r,i(M,s)&&e.ref===t.ref)return mi(e,t,f)}return t.flags|=1,e=di(g,s),e.ref=t.ref,e.return=t,t.child=e}function Jh(e,t,i,s,f){if(e!==null){var g=e.memoizedProps;if(_r(g,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=g,Ul(e,f))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,mi(e,t,f)}return Tl(e,t,i,s,f)}function eu(e,t,i,s){var f=s.children,g=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(g=g!==null?g.baseLanes|i:i,e!==null){for(s=t.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~g}else s=0,t.child=null;return tu(e,t,g,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gn(t,g!==null?g.cachePool:null),g!==null?sh(t,g):ll(),rh(t);else return s=t.lanes=536870912,tu(e,t,g!==null?g.baseLanes|i:i,i,s)}else g!==null?(gn(t,g.cachePool),sh(t,g),Ni(),t.memoizedState=null):(e!==null&&gn(t,null),ll(),Ni());return yt(e,t,f,i),t.child}function Rr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function tu(e,t,i,s,f){var g=tl();return g=g===null?null:{parent:lt._currentValue,pool:g},t.memoizedState={baseLanes:i,cachePool:g},e!==null&&gn(t,null),ll(),rh(t),e!==null&&Os(e,t,s,!0),t.childLanes=f,null}function Bn(e,t){return t=kn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function iu(e,t,i){return us(t,e.child,null,i),e=Bn(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function D_(e,t,i){var s=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Pe){if(s.mode==="hidden")return e=Bn(t,s),t.lanes=536870912,Rr(null,e);if(cl(t),(e=Ze)?(e=_d(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Ti(t);return t.lanes=536870912,null}return Bn(t,s)}var g=e.memoizedState;if(g!==null){var M=g.dehydrated;if(cl(t),f)if(t.flags&256)t.flags&=-257,t=iu(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(U(558));else if(ct||Os(e,t,i,!1),f=(i&e.childLanes)!==0,ct||f){if(s=Ke,s!==null&&(M=Go(s,i),M!==0&&M!==g.retryLane))throw g.retryLane=M,ss(e,M),Bt(s,e,M),Dl;$n(),t=iu(e,t,i)}else e=g.treeContext,Ze=Kt(M.nextSibling),St=t,Pe=!0,Di=null,Vt=!1,e!==null&&Fc(t,e),t=Bn(t,s),t.flags|=4096;return t}return e=di(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function On(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(U(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Tl(e,t,i,s,f){return ls(t),i=ul(e,t,i,s,void 0,f),s=dl(),e!==null&&!ct?(fl(e,t,f),mi(e,t,f)):(Pe&&s&&Ga(t),t.flags|=1,yt(e,t,i,f),t.child)}function su(e,t,i,s,f,g){return ls(t),t.updateQueue=null,i=ah(t,s,i,f),nh(e),s=dl(),e!==null&&!ct?(fl(e,t,g),mi(e,t,g)):(Pe&&s&&Ga(t),t.flags|=1,yt(e,t,i,g),t.child)}function ru(e,t,i,s,f){if(ls(t),t.stateNode===null){var g=Rs,M=i.contextType;typeof M=="object"&&M!==null&&(g=Ct(M)),g=new i(s,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Al,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=s,g.state=t.memoizedState,g.refs={},sl(t),M=i.contextType,g.context=typeof M=="object"&&M!==null?Ct(M):Rs,g.state=t.memoizedState,M=i.getDerivedStateFromProps,typeof M=="function"&&(Ml(t,i,M,s),g.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(M=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),M!==g.state&&Al.enqueueReplaceState(g,g.state,null),xr(t,s,g,f),wr(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){g=t.stateNode;var H=t.memoizedProps,X=fs(i,H);g.props=X;var ie=g.context,le=i.contextType;M=Rs,typeof le=="object"&&le!==null&&(M=Ct(le));var de=i.getDerivedStateFromProps;le=typeof de=="function"||typeof g.getSnapshotBeforeUpdate=="function",H=t.pendingProps!==H,le||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(H||ie!==M)&&qh(t,g,s,M),Oi=!1;var ne=t.memoizedState;g.state=ne,xr(t,s,g,f),wr(),ie=t.memoizedState,H||ne!==ie||Oi?(typeof de=="function"&&(Ml(t,i,de,s),ie=t.memoizedState),(X=Oi||$h(t,i,X,s,ne,ie,M))?(le||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=ie),g.props=s,g.state=ie,g.context=M,s=X):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{g=t.stateNode,rl(e,t),M=t.memoizedProps,le=fs(i,M),g.props=le,de=t.pendingProps,ne=g.context,ie=i.contextType,X=Rs,typeof ie=="object"&&ie!==null&&(X=Ct(ie)),H=i.getDerivedStateFromProps,(ie=typeof H=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(M!==de||ne!==X)&&qh(t,g,s,X),Oi=!1,ne=t.memoizedState,g.state=ne,xr(t,s,g,f),wr();var ae=t.memoizedState;M!==de||ne!==ae||Oi||e!==null&&e.dependencies!==null&&_n(e.dependencies)?(typeof H=="function"&&(Ml(t,i,H,s),ae=t.memoizedState),(le=Oi||$h(t,i,le,s,ne,ae,X)||e!==null&&e.dependencies!==null&&_n(e.dependencies))?(ie||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,ae,X),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,ae,X)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||M===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ae),g.props=s,g.state=ae,g.context=X,s=le):(typeof g.componentDidUpdate!="function"||M===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),s=!1)}return g=s,On(e,t),s=(t.flags&128)!==0,g||s?(g=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&s?(t.child=us(t,e.child,null,f),t.child=us(t,null,i,f)):yt(e,t,i,f),t.memoizedState=g.state,e=t.child):e=mi(e,t,f),e}function nu(e,t,i,s){return ns(),t.flags|=256,yt(e,t,i,s),t.child}var Bl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ol(e){return{baseLanes:e,cachePool:Vc()}}function kl(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=It),e}function au(e,t,i){var s=t.pendingProps,f=!1,g=(t.flags&128)!==0,M;if((M=g)||(M=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),M&&(f=!0,t.flags&=-129),M=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(f?zi(t):Ni(),(e=Ze)?(e=_d(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Ti(t);return po(e)?t.lanes=32:t.lanes=536870912,null}var H=s.children;return s=s.fallback,f?(Ni(),f=t.mode,H=kn({mode:"hidden",children:H},f),s=rs(s,f,i,null),H.return=t,s.return=t,H.sibling=s,t.child=H,s=t.child,s.memoizedState=Ol(i),s.childLanes=kl(e,M,i),t.memoizedState=Bl,Rr(null,s)):(zi(t),Hl(t,H))}var X=e.memoizedState;if(X!==null&&(H=X.dehydrated,H!==null)){if(g)t.flags&256?(zi(t),t.flags&=-257,t=zl(e,t,i)):t.memoizedState!==null?(Ni(),t.child=e.child,t.flags|=128,t=null):(Ni(),H=s.fallback,f=t.mode,s=kn({mode:"visible",children:s.children},f),H=rs(H,f,i,null),H.flags|=2,s.return=t,H.return=t,s.sibling=H,t.child=s,us(t,e.child,null,i),s=t.child,s.memoizedState=Ol(i),s.childLanes=kl(e,M,i),t.memoizedState=Bl,t=Rr(null,s));else if(zi(t),po(H)){if(M=H.nextSibling&&H.nextSibling.dataset,M)var ie=M.dgst;M=ie,s=Error(U(419)),s.stack="",s.digest=M,pr({value:s,source:null,stack:null}),t=zl(e,t,i)}else if(ct||Os(e,t,i,!1),M=(i&e.childLanes)!==0,ct||M){if(M=Ke,M!==null&&(s=Go(M,i),s!==0&&s!==X.retryLane))throw X.retryLane=s,ss(e,s),Bt(M,e,s),Dl;go(H)||$n(),t=zl(e,t,i)}else go(H)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,Ze=Kt(H.nextSibling),St=t,Pe=!0,Di=null,Vt=!1,e!==null&&Fc(t,e),t=Hl(t,s.children),t.flags|=4096);return t}return f?(Ni(),H=s.fallback,f=t.mode,X=e.child,ie=X.sibling,s=di(X,{mode:"hidden",children:s.children}),s.subtreeFlags=X.subtreeFlags&65011712,ie!==null?H=di(ie,H):(H=rs(H,f,i,null),H.flags|=2),H.return=t,s.return=t,s.sibling=H,t.child=s,Rr(null,s),s=t.child,H=e.child.memoizedState,H===null?H=Ol(i):(f=H.cachePool,f!==null?(X=lt._currentValue,f=f.parent!==X?{parent:X,pool:X}:f):f=Vc(),H={baseLanes:H.baseLanes|i,cachePool:f}),s.memoizedState=H,s.childLanes=kl(e,M,i),t.memoizedState=Bl,Rr(e.child,s)):(zi(t),i=e.child,e=i.sibling,i=di(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(M=t.deletions,M===null?(t.deletions=[e],t.flags|=16):M.push(e)),t.child=i,t.memoizedState=null,i)}function Hl(e,t){return t=kn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kn(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function zl(e,t,i){return us(t,e.child,null,i),e=Hl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lu(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Qa(e.return,t,i)}function Nl(e,t,i,s,f,g){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:f,treeForkCount:g}:(M.isBackwards=t,M.rendering=null,M.renderingStartTime=0,M.last=s,M.tail=i,M.tailMode=f,M.treeForkCount=g)}function ou(e,t,i){var s=t.pendingProps,f=s.revealOrder,g=s.tail;s=s.children;var M=nt.current,H=(M&2)!==0;if(H?(M=M&1|2,t.flags|=128):M&=1,q(nt,M),yt(e,t,s,i),s=Pe?gr:0,!H&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lu(e,i,t);else if(e.tag===19)lu(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(f){case"forwards":for(i=t.child,f=null;i!==null;)e=i.alternate,e!==null&&bn(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=t.child,t.child=null):(f=i.sibling,i.sibling=null),Nl(t,!1,f,i,g,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&bn(e)===null){t.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Nl(t,!0,i,null,g,s);break;case"together":Nl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function mi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Pi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,i=di(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=di(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ul(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_n(e)))}function T_(e,t,i){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),Bi(t,lt,e.memoizedState.cache),ns();break;case 27:case 5:ee(t);break;case 4:z(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,cl(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(zi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?au(e,t,i):(zi(t),e=mi(e,t,i),e!==null?e.sibling:null);zi(t);break;case 19:var f=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),f){if(s)return ou(e,t,i);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),q(nt,nt.current),s)break;return null;case 22:return t.lanes=0,eu(e,t,i,t.pendingProps);case 24:Bi(t,lt,e.memoizedState.cache)}return mi(e,t,i)}function cu(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Ul(e,i)&&(t.flags&128)===0)return ct=!1,T_(e,t,i);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&jc(t,gr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=cs(t.elementType),t.type=e,typeof e=="function")$a(e)?(s=fs(e,s),t.tag=1,t=ru(null,t,e,s,i)):(t.tag=0,t=Tl(null,t,e,s,i));else{if(e!=null){var f=e.$$typeof;if(f===S){t.tag=11,t=Qh(null,t,e,s,i);break e}else if(f===y){t.tag=14,t=Zh(null,t,e,s,i);break e}}throw t=k(e)||e,Error(U(306,t,""))}}return t;case 0:return Tl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,f=fs(s,t.pendingProps),ru(e,t,s,f,i);case 3:e:{if(z(t,t.stateNode.containerInfo),e===null)throw Error(U(387));s=t.pendingProps;var g=t.memoizedState;f=g.element,rl(e,t),xr(t,s,null,i);var M=t.memoizedState;if(s=M.cache,Bi(t,lt,s),s!==g.cache&&Za(t,[lt],i,!0),wr(),s=M.element,g.isDehydrated)if(g={element:s,isDehydrated:!1,cache:M.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=nu(e,t,s,i);break e}else if(s!==f){f=Wt(Error(U(424)),t),pr(f),t=nu(e,t,s,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(Ze=Kt(e.firstChild),St=t,Pe=!0,Di=null,Vt=!0,i=eh(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ns(),s===f){t=mi(e,t,i);break e}yt(e,t,s,i)}t=t.child}return t;case 26:return On(e,t),e===null?(i=Cd(t.type,null,t.pendingProps,null))?t.memoizedState=i:Pe||(i=t.type,e=t.pendingProps,s=Kn(ce.current).createElement(i),s[mt]=t,s[Et]=e,bt(s,i,e),gt(s),t.stateNode=s):t.memoizedState=Cd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Pe&&(s=t.stateNode=pd(t.type,t.pendingProps,ce.current),St=t,Vt=!0,f=Ze,Wi(t.type)?(mo=f,Ze=Kt(s.firstChild)):Ze=f),yt(e,t,t.pendingProps.children,i),On(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((f=s=Ze)&&(s=lv(s,t.type,t.pendingProps,Vt),s!==null?(t.stateNode=s,St=t,Ze=Kt(s.firstChild),Vt=!1,f=!0):f=!1),f||Ti(t)),ee(t),f=t.type,g=t.pendingProps,M=e!==null?e.memoizedProps:null,s=g.children,fo(f,g)?s=null:M!==null&&fo(f,M)&&(t.flags|=32),t.memoizedState!==null&&(f=ul(e,t,b_,null,null,i),qr._currentValue=f),On(e,t),yt(e,t,s,i),t.child;case 6:return e===null&&Pe&&((e=i=Ze)&&(i=ov(i,t.pendingProps,Vt),i!==null?(t.stateNode=i,St=t,Ze=null,e=!0):e=!1),e||Ti(t)),null;case 13:return au(e,t,i);case 4:return z(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=us(t,null,s,i):yt(e,t,s,i),t.child;case 11:return Qh(e,t,t.type,t.pendingProps,i);case 7:return yt(e,t,t.pendingProps,i),t.child;case 8:return yt(e,t,t.pendingProps.children,i),t.child;case 12:return yt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Bi(t,t.type,s.value),yt(e,t,s.children,i),t.child;case 9:return f=t.type._context,s=t.pendingProps.children,ls(t),f=Ct(f),s=s(f),t.flags|=1,yt(e,t,s,i),t.child;case 14:return Zh(e,t,t.type,t.pendingProps,i);case 15:return Jh(e,t,t.type,t.pendingProps,i);case 19:return ou(e,t,i);case 31:return D_(e,t,i);case 22:return eu(e,t,i,t.pendingProps);case 24:return ls(t),s=Ct(lt),e===null?(f=tl(),f===null&&(f=Ke,g=Ja(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=i),f=g),t.memoizedState={parent:s,cache:f},sl(t),Bi(t,lt,f)):((e.lanes&i)!==0&&(rl(e,t),xr(t,null,null,i),wr()),f=e.memoizedState,g=t.memoizedState,f.parent!==s?(f={parent:s,cache:s},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Bi(t,lt,s)):(s=g.cache,Bi(t,lt,s),s!==f.cache&&Za(t,[lt],i,!0))),yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(U(156,t.tag))}function Si(e){e.flags|=4}function Il(e,t,i,s,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(zu())e.flags|=8192;else throw hs=mn,il}else e.flags&=-16777217}function hu(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ld(t))if(zu())e.flags|=8192;else throw hs=mn,il}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$o():536870912,e.lanes|=t,Ws|=t)}function Dr(e,t){if(!Pe)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 s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function B_(e,t,i){var s=t.pendingProps;switch(Xa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),vi(lt),re(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?Si(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ya())),Je(t),null;case 26:var f=t.type,g=t.memoizedState;return e===null?(Si(t),g!==null?(Je(t),hu(t,g)):(Je(t),Il(t,f,null,s,i))):g?g!==e.memoizedState?(Si(t),Je(t),hu(t,g)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Si(t),Je(t),Il(t,f,e,s,i)),null;case 27:if(ve(t),i=ce.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(U(166));return Je(t),null}e=K.current,Bs(t)?$c(t):(e=pd(f,s,i),t.stateNode=e,Si(t))}return Je(t),null;case 5:if(ve(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(U(166));return Je(t),null}if(g=K.current,Bs(t))$c(t);else{var M=Kn(ce.current);switch(g){case 1:g=M.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=M.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=M.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=M.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=M.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof s.is=="string"?M.createElement("select",{is:s.is}):M.createElement("select"),s.multiple?g.multiple=!0:s.size&&(g.size=s.size);break;default:g=typeof s.is=="string"?M.createElement(f,{is:s.is}):M.createElement(f)}}g[mt]=t,g[Et]=s;e:for(M=t.child;M!==null;){if(M.tag===5||M.tag===6)g.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===t)break e;for(;M.sibling===null;){if(M.return===null||M.return===t)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}t.stateNode=g;e:switch(bt(g,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Si(t)}}return Je(t),Il(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(U(166));if(e=ce.current,Bs(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,f=St,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[mt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||ad(e.nodeValue,i)),e||Ti(t,!0)}else e=Kn(e).createTextNode(s),e[mt]=t,t.stateNode=e}return Je(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Bs(t),i!==null){if(e===null){if(!s)throw Error(U(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(557));e[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else i=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(U(558))}return Je(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Bs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(U(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(U(317));f[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),f=!1}else f=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==f&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),Je(t),null);case 4:return re(),e===null&&lo(t.stateNode.containerInfo),Je(t),null;case 10:return vi(t.type),Je(t),null;case 19:if(B(nt),s=t.memoizedState,s===null)return Je(t),null;if(f=(t.flags&128)!==0,g=s.rendering,g===null)if(f)Dr(s,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=bn(e),g!==null){for(t.flags|=128,Dr(s,!1),e=g.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Uc(i,e),i=i.sibling;return q(nt,nt.current&1|2),Pe&&fi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ge()>Pn&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304)}else{if(!f)if(e=bn(g),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!g.alternate&&!Pe)return Je(t),null}else 2*ge()-s.renderingStartTime>Pn&&i!==536870912&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(g.sibling=t.child,t.child=g):(e=s.last,e!==null?e.sibling=g:t.child=g,s.last=g)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ge(),e.sibling=null,i=nt.current,q(nt,f?i&1|2:i&1),Pe&&fi(t,s.treeForkCount),e):(Je(t),null);case 22:case 23:return Nt(t),ol(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),i=t.updateQueue,i!==null&&Hn(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&B(os),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),vi(lt),Je(t),null;case 25:return null;case 30:return null}throw Error(U(156,t.tag))}function O_(e,t){switch(Xa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vi(lt),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(U(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(nt),null;case 4:return re(),null;case 10:return vi(t.type),null;case 22:case 23:return Nt(t),ol(),e!==null&&B(os),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vi(lt),null;case 25:return null;default:return null}}function uu(e,t){switch(Xa(t),t.tag){case 3:vi(lt),re();break;case 26:case 27:case 5:ve(t);break;case 4:re();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:B(nt);break;case 10:vi(t.type);break;case 22:case 23:Nt(t),ol(),e!==null&&B(os);break;case 24:vi(lt)}}function Tr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var f=s.next;i=f;do{if((i.tag&e)===e){s=void 0;var g=i.create,M=i.inst;s=g(),M.destroy=s}i=i.next}while(i!==f)}}catch(H){Ge(t,t.return,H)}}function Ui(e,t,i){try{var s=t.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var g=f.next;s=g;do{if((s.tag&e)===e){var M=s.inst,H=M.destroy;if(H!==void 0){M.destroy=void 0,f=t;var X=i,ie=H;try{ie()}catch(le){Ge(f,X,le)}}}s=s.next}while(s!==g)}}catch(le){Ge(t,t.return,le)}}function du(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ih(t,i)}catch(s){Ge(e,e.return,s)}}}function fu(e,t,i){i.props=fs(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ge(e,t,s)}}function Br(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(f){Ge(e,t,f)}}function li(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(f){Ge(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Ge(e,t,f)}else i.current=null}function _u(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(f){Ge(e,e.return,f)}}function Pl(e,t,i){try{var s=e.stateNode;tv(s,e.type,i,t),s[Et]=t}catch(f){Ge(e,e.return,f)}}function vu(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wi(e.type)||e.tag===4}function jl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vu(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&&Wi(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 Fl(e,t,i){var s=e.tag;if(s===5||s===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=hi));else if(s!==4&&(s===27&&Wi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Fl(e,t,i),e=e.sibling;e!==null;)Fl(e,t,i),e=e.sibling}function zn(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Wi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(zn(e,t,i),e=e.sibling;e!==null;)zn(e,t,i),e=e.sibling}function gu(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);bt(t,s,i),t[mt]=e,t[Et]=i}catch(g){Ge(e,e.return,g)}}var Ci=!1,ht=!1,$l=!1,pu=typeof WeakSet=="function"?WeakSet:Set,pt=null;function k_(e,t){if(e=e.containerInfo,ho=sa,e=Rc(e),za(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var f=s.anchorOffset,g=s.focusNode;s=s.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var M=0,H=-1,X=-1,ie=0,le=0,de=e,ne=null;t:for(;;){for(var ae;de!==i||f!==0&&de.nodeType!==3||(H=M+f),de!==g||s!==0&&de.nodeType!==3||(X=M+s),de.nodeType===3&&(M+=de.nodeValue.length),(ae=de.firstChild)!==null;)ne=de,de=ae;for(;;){if(de===e)break t;if(ne===i&&++ie===f&&(H=M),ne===g&&++le===s&&(X=M),(ae=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=ae}i=H===-1||X===-1?null:{start:H,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(uo={focusedElem:e,selectionRange:i},sa=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,g=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++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=t,f=g.memoizedProps,g=g.memoizedState,s=i.stateNode;try{var Ce=fs(i.type,f);e=s.getSnapshotBeforeUpdate(Ce,g),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Ge(i,i.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)vo(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vo(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(U(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function mu(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:bi(e,i),s&4&&Tr(5,i);break;case 1:if(bi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(M){Ge(i,i.return,M)}else{var f=fs(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(M){Ge(i,i.return,M)}}s&64&&du(i),s&512&&Br(i,i.return);break;case 3:if(bi(e,i),s&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{ih(e,t)}catch(M){Ge(i,i.return,M)}}break;case 27:t===null&&s&4&&gu(i);case 26:case 5:bi(e,i),t===null&&s&4&&_u(i),s&512&&Br(i,i.return);break;case 12:bi(e,i);break;case 31:bi(e,i),s&4&&yu(e,i);break;case 13:bi(e,i),s&4&&bu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$_.bind(null,i),cv(e,i))));break;case 22:if(s=i.memoizedState!==null||Ci,!s){t=t!==null&&t.memoizedState!==null||ht,f=Ci;var g=ht;Ci=s,(ht=t)&&!g?wi(e,i,(i.subtreeFlags&8772)!==0):bi(e,i),Ci=f,ht=g}break;case 30:break;default:bi(e,i)}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Sa(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 et=null,At=!1;function yi(e,t,i){for(i=i.child;i!==null;)Cu(e,t,i),i=i.sibling}function Cu(e,t,i){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(xt,i)}catch{}switch(i.tag){case 26:ht||li(i,t),yi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||li(i,t);var s=et,f=At;Wi(i.type)&&(et=i.stateNode,At=!1),yi(e,t,i),jr(i.stateNode),et=s,At=f;break;case 5:ht||li(i,t);case 6:if(s=et,f=At,et=null,yi(e,t,i),et=s,At=f,et!==null)if(At)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(g){Ge(i,t,g)}else try{et.removeChild(i.stateNode)}catch(g){Ge(i,t,g)}break;case 18:et!==null&&(At?(e=et,dd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):dd(et,i.stateNode));break;case 4:s=et,f=At,et=i.stateNode.containerInfo,At=!0,yi(e,t,i),et=s,At=f;break;case 0:case 11:case 14:case 15:Ui(2,i,t),ht||Ui(4,i,t),yi(e,t,i);break;case 1:ht||(li(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&fu(i,t,s)),yi(e,t,i);break;case 21:yi(e,t,i);break;case 22:ht=(s=ht)||i.memoizedState!==null,yi(e,t,i),ht=s;break;default:yi(e,t,i)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Js(e)}catch(i){Ge(t,t.return,i)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Js(e)}catch(i){Ge(t,t.return,i)}}function H_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(U(435,e.tag))}}function Nn(e,t){var i=H_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var f=q_.bind(null,e,s);s.then(f,f)}})}function Rt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var f=i[s],g=e,M=t,H=M;e:for(;H!==null;){switch(H.tag){case 27:if(Wi(H.type)){et=H.stateNode,At=!1;break e}break;case 5:et=H.stateNode,At=!1;break e;case 3:case 4:et=H.stateNode.containerInfo,At=!0;break e}H=H.return}if(et===null)throw Error(U(160));Cu(g,M,f),et=null,At=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e),t=t.sibling}var ti=null;function wu(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Dt(e),s&4&&(Ui(3,e,e.return),Tr(3,e),Ui(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&64&&Ci&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var f=ti;if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&4){var g=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":g=f.getElementsByTagName("title")[0],(!g||g[nr]||g[mt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(s),f.head.insertBefore(g,f.querySelector("head > title"))),bt(g,s,i),g[mt]=e,gt(g),s=g;break e;case"link":var M=wd("link","href",f).get(s+(i.href||""));if(M){for(var H=0;H<M.length;H++)if(g=M[H],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){M.splice(H,1);break t}}g=f.createElement(s),bt(g,s,i),f.head.appendChild(g);break;case"meta":if(M=wd("meta","content",f).get(s+(i.content||""))){for(H=0;H<M.length;H++)if(g=M[H],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){M.splice(H,1);break t}}g=f.createElement(s),bt(g,s,i),f.head.appendChild(g);break;default:throw Error(U(468,s))}g[mt]=e,gt(g),s=g}e.stateNode=s}else xd(f,e.type,e.stateNode);else e.stateNode=bd(f,s,e.memoizedProps);else g!==s?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,s===null?xd(f,e.type,e.stateNode):bd(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,i.memoizedProps)}break;case 27:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),i!==null&&s&4&&Pl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),e.flags&32){f=e.stateNode;try{bs(f,"")}catch(Ce){Ge(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,Pl(e,f,i!==null?i.memoizedProps:f)),s&1024&&($l=!0);break;case 6:if(Rt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(U(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Ce){Ge(e,e.return,Ce)}}break;case 3:if(Jn=null,f=ti,ti=Qn(t.containerInfo),Rt(t,e),ti=f,Dt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(Ce){Ge(e,e.return,Ce)}$l&&($l=!1,xu(e));break;case 4:s=ti,ti=Qn(e.stateNode.containerInfo),Rt(t,e),Dt(e),ti=s;break;case 12:Rt(t,e),Dt(e);break;case 31:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 13:Rt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(In=ge()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 22:f=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,ie=Ci,le=ht;if(Ci=ie||f,ht=le||X,Rt(t,e),ht=le,Ci=ie,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(i===null||X||Ci||ht||_s(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(g=X.stateNode,f)M=g.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{H=X.stateNode;var de=X.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;H.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=f?"":X.memoizedProps}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===18){if(i===null){X=t;try{var ae=X.stateNode;f?fd(ae,!0):fd(X.stateNode,!1)}catch(Ce){Ge(X,X.return,Ce)}}}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}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,Nn(e,i))));break;case 19:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 30:break;case 21:break;default:Rt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(vu(s)){i=s;break}s=s.return}if(i==null)throw Error(U(160));switch(i.tag){case 27:var f=i.stateNode,g=jl(e);zn(e,g,f);break;case 5:var M=i.stateNode;i.flags&32&&(bs(M,""),i.flags&=-33);var H=jl(e);zn(e,H,M);break;case 3:case 4:var X=i.stateNode.containerInfo,ie=jl(e);Fl(e,ie,X);break;default:throw Error(U(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xu(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function _s(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ui(4,t,t.return),_s(t);break;case 1:li(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&fu(t,t.return,i),_s(t);break;case 27:jr(t.stateNode);case 26:case 5:li(t,t.return),_s(t);break;case 22:t.memoizedState===null&&_s(t);break;case 30:_s(t);break;default:_s(t)}e=e.sibling}}function wi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,f=e,g=t,M=g.flags;switch(g.tag){case 0:case 11:case 15:wi(f,g,i),Tr(4,g);break;case 1:if(wi(f,g,i),s=g,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ie){Ge(s,s.return,ie)}if(s=g,f=s.updateQueue,f!==null){var H=s.stateNode;try{var X=f.shared.hiddenCallbacks;if(X!==null)for(f.shared.hiddenCallbacks=null,f=0;f<X.length;f++)th(X[f],H)}catch(ie){Ge(s,s.return,ie)}}i&&M&64&&du(g),Br(g,g.return);break;case 27:gu(g);case 26:case 5:wi(f,g,i),i&&s===null&&M&4&&_u(g),Br(g,g.return);break;case 12:wi(f,g,i);break;case 31:wi(f,g,i),i&&M&4&&yu(f,g);break;case 13:wi(f,g,i),i&&M&4&&bu(f,g);break;case 22:g.memoizedState===null&&wi(f,g,i),Br(g,g.return);break;case 30:break;default:wi(f,g,i)}t=t.sibling}}function ql(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&&mr(i))}function Wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function ii(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lu(e,t,i,s),t=t.sibling}function Lu(e,t,i,s){var f=t.flags;switch(t.tag){case 0:case 11:case 15:ii(e,t,i,s),f&2048&&Tr(9,t);break;case 1:ii(e,t,i,s);break;case 3:ii(e,t,i,s),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e)));break;case 12:if(f&2048){ii(e,t,i,s),e=t.stateNode;try{var g=t.memoizedProps,M=g.id,H=g.onPostCommit;typeof H=="function"&&H(M,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){Ge(t,t.return,X)}}else ii(e,t,i,s);break;case 31:ii(e,t,i,s);break;case 13:ii(e,t,i,s);break;case 23:break;case 22:g=t.stateNode,M=t.alternate,t.memoizedState!==null?g._visibility&2?ii(e,t,i,s):Or(e,t):g._visibility&2?ii(e,t,i,s):(g._visibility|=2,Fs(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),f&2048&&ql(M,t);break;case 24:ii(e,t,i,s),f&2048&&Wl(t.alternate,t);break;default:ii(e,t,i,s)}}function Fs(e,t,i,s,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var g=e,M=t,H=i,X=s,ie=M.flags;switch(M.tag){case 0:case 11:case 15:Fs(g,M,H,X,f),Tr(8,M);break;case 23:break;case 22:var le=M.stateNode;M.memoizedState!==null?le._visibility&2?Fs(g,M,H,X,f):Or(g,M):(le._visibility|=2,Fs(g,M,H,X,f)),f&&ie&2048&&ql(M.alternate,M);break;case 24:Fs(g,M,H,X,f),f&&ie&2048&&Wl(M.alternate,M);break;default:Fs(g,M,H,X,f)}t=t.sibling}}function Or(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,f=s.flags;switch(s.tag){case 22:Or(i,s),f&2048&&ql(s.alternate,s);break;case 24:Or(i,s),f&2048&&Wl(s.alternate,s);break;default:Or(i,s)}t=t.sibling}}var kr=8192;function $s(e,t,i){if(e.subtreeFlags&kr)for(e=e.child;e!==null;)Eu(e,t,i),e=e.sibling}function Eu(e,t,i){switch(e.tag){case 26:$s(e,t,i),e.flags&kr&&e.memoizedState!==null&&yv(i,ti,e.memoizedState,e.memoizedProps);break;case 5:$s(e,t,i);break;case 3:case 4:var s=ti;ti=Qn(e.stateNode.containerInfo),$s(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=kr,kr=16777216,$s(e,t,i),kr=s):$s(e,t,i));break;default:$s(e,t,i)}}function Mu(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 Hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Ru(s,e)}Mu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Au(e),e=e.sibling}function Au(e){switch(e.tag){case 0:case 11:case 15:Hr(e),e.flags&2048&&Ui(9,e,e.return);break;case 3:Hr(e);break;case 12:Hr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Un(e)):Hr(e);break;default:Hr(e)}}function Un(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Ru(s,e)}Mu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ui(8,t,t.return),Un(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Un(t));break;default:Un(t)}e=e.sibling}}function Ru(e,t){for(;pt!==null;){var i=pt;switch(i.tag){case 0:case 11:case 15:Ui(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:mr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,pt=s;else e:for(i=e;pt!==null;){s=pt;var f=s.sibling,g=s.return;if(Su(s),s===i){pt=null;break e}if(f!==null){f.return=g,pt=f;break e}pt=g}}}var z_={getCacheForType:function(e){var t=Ct(lt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ct(lt).controller.signal}},N_=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ke=null,ke=null,Ne=0,We=0,Ut=null,Ii=!1,qs=!1,Gl=!1,xi=0,rt=0,Pi=0,vs=0,Xl=0,It=0,Ws=0,zr=null,Tt=null,Vl=!1,In=0,Du=0,Pn=1/0,jn=null,ji=null,dt=0,Fi=null,Gs=null,Li=0,Yl=0,Kl=null,Tu=null,Nr=0,Ql=null;function Pt(){return($e&2)!==0&&Ne!==0?Ne&-Ne:N.T!==null?so():Xo()}function Bu(){if(It===0)if((Ne&536870912)===0||Pe){var e=si;si<<=1,(si&3932160)===0&&(si=262144),It=e}else It=536870912;return e=zt.current,e!==null&&(e.flags|=32),It}function Bt(e,t,i){(e===Ke&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Xs(e,0),$i(e,Ne,It,!1)),rr(e,i),(($e&2)===0||e!==Ke)&&(e===Ke&&(($e&2)===0&&(vs|=i),rt===4&&$i(e,Ne,It,!1)),oi(e))}function Ou(e,t,i){if(($e&6)!==0)throw Error(U(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||sr(e,t),f=s?P_(e,t):Jl(e,t,!0),g=s;do{if(f===0){qs&&!s&&$i(e,t,0,!1);break}else{if(i=e.current.alternate,g&&!U_(i)){f=Jl(e,t,!1),g=!1;continue}if(f===2){if(g=t,e.errorRecoveryDisabledLanes&g)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){t=M;e:{var H=e;f=zr;var X=H.current.memoizedState.isDehydrated;if(X&&(Xs(H,M).flags|=256),M=Jl(H,M,!1),M!==2){if(Gl&&!X){H.errorRecoveryDisabledLanes|=g,vs|=g,f=4;break e}g=Tt,Tt=f,g!==null&&(Tt===null?Tt=g:Tt.push.apply(Tt,g))}f=M}if(g=!1,f!==2)continue}}if(f===1){Xs(e,0),$i(e,t,0,!0);break}e:{switch(s=e,g=f,g){case 0:case 1:throw Error(U(345));case 4:if((t&4194048)!==t)break;case 6:$i(s,t,It,!Ii);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(U(329))}if((t&62914560)===t&&(f=In+300-ge(),10<f)){if($i(s,t,It,!Ii),Kr(s,0,!0)!==0)break e;Li=t,s.timeoutHandle=hd(ku.bind(null,s,i,Tt,jn,Vl,t,It,vs,Ws,Ii,g,"Throttled",-0,0),f);break e}ku(s,i,Tt,jn,Vl,t,It,vs,Ws,Ii,g,null,-0,0)}}break}while(!0);oi(e)}function ku(e,t,i,s,f,g,M,H,X,ie,le,de,ne,ae){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},Eu(t,g,de);var Ce=(g&62914560)===g?In-ge():(g&4194048)===g?Du-ge():0;if(Ce=bv(de,Ce),Ce!==null){Li=g,e.cancelPendingCommit=Ce(Fu.bind(null,e,t,g,i,s,f,M,H,X,le,de,null,ne,ae)),$i(e,g,M,!ie);return}}Fu(e,t,g,i,s,f,M,H,X)}function U_(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 s=0;s<i.length;s++){var f=i[s],g=f.getSnapshot;f=f.value;try{if(!kt(g(),f))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 $i(e,t,i,s){t&=~Xl,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var f=t;0<f;){var g=31-ut(f),M=1<<g;s[g]=-1,f&=~M}i!==0&&qo(e,i,t)}function Fn(){return($e&6)===0?(Ur(0),!1):!0}function Zl(){if(ke!==null){if(We===0)var e=ke.return;else e=ke,_i=as=null,_l(e),Ns=null,Cr=0,e=ke;for(;e!==null;)uu(e.alternate,e),e=e.return;ke=null}}function Xs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,rv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Li=0,Zl(),Ke=e,ke=i=di(e.current,null),Ne=t,We=0,Ut=null,Ii=!1,qs=sr(e,t),Gl=!1,Ws=It=Xl=vs=Pi=rt=0,Tt=zr=null,Vl=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var f=31-ut(s),g=1<<f;t|=e[f],s&=~g}return xi=t,cn(),i}function Hu(e,t){Te=null,N.H=Ar,t===zs||t===pn?(t=Qc(),We=3):t===il?(t=Qc(),We=4):We=t===Dl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,ke===null&&(rt=1,Tn(e,Wt(t,e.current)))}function zu(){var e=zt.current;return e===null?!0:(Ne&4194048)===Ne?Yt===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===Yt:!1}function Nu(){var e=N.H;return N.H=Ar,e===null?Ar:e}function Uu(){var e=N.A;return N.A=z_,e}function $n(){rt=4,Ii||(Ne&4194048)!==Ne&&zt.current!==null||(qs=!0),(Pi&134217727)===0&&(vs&134217727)===0||Ke===null||$i(Ke,Ne,It,!1)}function Jl(e,t,i){var s=$e;$e|=2;var f=Nu(),g=Uu();(Ke!==e||Ne!==t)&&(jn=null,Xs(e,t)),t=!1;var M=rt;e:do try{if(We!==0&&ke!==null){var H=ke,X=Ut;switch(We){case 8:Zl(),M=6;break e;case 3:case 2:case 9:case 6:zt.current===null&&(t=!0);var ie=We;if(We=0,Ut=null,Vs(e,H,X,ie),i&&qs){M=0;break e}break;default:ie=We,We=0,Ut=null,Vs(e,H,X,ie)}}I_(),M=rt;break}catch(le){Hu(e,le)}while(!0);return t&&e.shellSuspendCounter++,_i=as=null,$e=s,N.H=f,N.A=g,ke===null&&(Ke=null,Ne=0,cn()),M}function I_(){for(;ke!==null;)Iu(ke)}function P_(e,t){var i=$e;$e|=2;var s=Nu(),f=Uu();Ke!==e||Ne!==t?(jn=null,Pn=ge()+500,Xs(e,t)):qs=sr(e,t);e:do try{if(We!==0&&ke!==null){t=ke;var g=Ut;t:switch(We){case 1:We=0,Ut=null,Vs(e,t,g,1);break;case 2:case 9:if(Yc(g)){We=0,Ut=null,Pu(t);break}t=function(){We!==2&&We!==9||Ke!==e||(We=7),oi(e)},g.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Yc(g)?(We=0,Ut=null,Pu(t)):(We=0,Ut=null,Vs(e,t,g,7));break;case 5:var M=null;switch(ke.tag){case 26:M=ke.memoizedState;case 5:case 27:var H=ke;if(M?Ld(M):H.stateNode.complete){We=0,Ut=null;var X=H.sibling;if(X!==null)ke=X;else{var ie=H.return;ie!==null?(ke=ie,qn(ie)):ke=null}break t}}We=0,Ut=null,Vs(e,t,g,5);break;case 6:We=0,Ut=null,Vs(e,t,g,6);break;case 8:Zl(),rt=6;break e;default:throw Error(U(462))}}j_();break}catch(le){Hu(e,le)}while(!0);return _i=as=null,N.H=s,N.A=f,$e=i,ke!==null?0:(Ke=null,Ne=0,cn(),rt)}function j_(){for(;ke!==null&&!me();)Iu(ke)}function Iu(e){var t=cu(e.alternate,e,xi);e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Pu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=su(i,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=su(i,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:_l(t);default:uu(i,t),t=ke=Uc(t,xi),t=cu(i,t,xi)}e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Vs(e,t,i,s){_i=as=null,_l(t),Ns=null,Cr=0;var f=t.return;try{if(R_(e,f,t,i,Ne)){rt=1,Tn(e,Wt(i,e.current)),ke=null;return}}catch(g){if(f!==null)throw ke=f,g;rt=1,Tn(e,Wt(i,e.current)),ke=null;return}t.flags&32768?(Pe||s===1?e=!0:qs||(Ne&536870912)!==0?e=!1:(Ii=e=!0,(s===2||s===9||s===3||s===6)&&(s=zt.current,s!==null&&s.tag===13&&(s.flags|=16384))),ju(t,e)):qn(t)}function qn(e){var t=e;do{if((t.flags&32768)!==0){ju(t,Ii);return}e=t.return;var i=B_(t.alternate,t,xi);if(i!==null){ke=i;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);rt===0&&(rt=5)}function ju(e,t){do{var i=O_(e.alternate,e);if(i!==null){i.flags&=32767,ke=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=i}while(e!==null);rt=6,ke=null}function Fu(e,t,i,s,f,g,M,H,X){e.cancelPendingCommit=null;do Wn();while(dt!==0);if(($e&6)!==0)throw Error(U(327));if(t!==null){if(t===e.current)throw Error(U(177));if(g=t.lanes|t.childLanes,g|=ja,Cf(e,i,g,M,H,X),e===Ke&&(ke=Ke=null,Ne=0),Gs=t,Fi=e,Li=i,Yl=g,Kl=f,Tu=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,W_(Qe,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=N.T,N.T=null,f=P.p,P.p=2,M=$e,$e|=4;try{k_(e,t,i)}finally{$e=M,P.p=f,N.T=s}}dt=1,$u(),qu(),Wu()}}function $u(){if(dt===1){dt=0;var e=Fi,t=Gs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=N.T,N.T=null;var s=P.p;P.p=2;var f=$e;$e|=4;try{wu(t,e);var g=uo,M=Rc(e.containerInfo),H=g.focusedElem,X=g.selectionRange;if(M!==H&&H&&H.ownerDocument&&Ac(H.ownerDocument.documentElement,H)){if(X!==null&&za(H)){var ie=X.start,le=X.end;if(le===void 0&&(le=ie),"selectionStart"in H)H.selectionStart=ie,H.selectionEnd=Math.min(le,H.value.length);else{var de=H.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),Ce=H.textContent.length,Ee=Math.min(X.start,Ce),Ye=X.end===void 0?Ee:Math.min(X.end,Ce);!ae.extend&&Ee>Ye&&(M=Ye,Ye=Ee,Ee=M);var Z=Mc(H,Ee),Y=Mc(H,Ye);if(Z&&Y&&(ae.rangeCount!==1||ae.anchorNode!==Z.node||ae.anchorOffset!==Z.offset||ae.focusNode!==Y.node||ae.focusOffset!==Y.offset)){var te=de.createRange();te.setStart(Z.node,Z.offset),ae.removeAllRanges(),Ee>Ye?(ae.addRange(te),ae.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),ae.addRange(te))}}}}for(de=[],ae=H;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<de.length;H++){var he=de[H];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}sa=!!ho,uo=ho=null}finally{$e=f,P.p=s,N.T=i}}e.current=t,dt=2}}function qu(){if(dt===2){dt=0;var e=Fi,t=Gs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=N.T,N.T=null;var s=P.p;P.p=2;var f=$e;$e|=4;try{mu(e,t.alternate,t)}finally{$e=f,P.p=s,N.T=i}}dt=3}}function Wu(){if(dt===4||dt===3){dt=0,ue();var e=Fi,t=Gs,i=Li,s=Tu;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Gs=Fi=null,Gu(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ji=null),pa(i),t=t.stateNode,tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(xt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=N.T,f=P.p,P.p=2,N.T=null;try{for(var g=e.onRecoverableError,M=0;M<s.length;M++){var H=s[M];g(H.value,{componentStack:H.stack})}}finally{N.T=t,P.p=f}}(Li&3)!==0&&Wn(),oi(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===Ql?Nr++:(Nr=0,Ql=e):Nr=0,Ur(0)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function Wn(){return $u(),qu(),Wu(),Xu()}function Xu(){if(dt!==5)return!1;var e=Fi,t=Yl;Yl=0;var i=pa(Li),s=N.T,f=P.p;try{P.p=32>i?32:i,N.T=null,i=Kl,Kl=null;var g=Fi,M=Li;if(dt=0,Gs=Fi=null,Li=0,($e&6)!==0)throw Error(U(331));var H=$e;if($e|=4,Au(g.current),Lu(g,g.current,M,i),$e=H,Ur(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(xt,g)}catch{}return!0}finally{P.p=f,N.T=s,Gu(e,t)}}function Vu(e,t,i){t=Wt(i,t),t=Rl(e.stateNode,t,2),e=Hi(e,t,2),e!==null&&(rr(e,2),oi(e))}function Ge(e,t,i){if(e.tag===3)Vu(e,e,i);else for(;t!==null;){if(t.tag===3){Vu(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ji===null||!ji.has(s))){e=Wt(i,e),i=Yh(2),s=Hi(t,i,2),s!==null&&(Kh(i,s,t,e),rr(s,2),oi(s));break}}t=t.return}}function eo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new N_;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(i)||(Gl=!0,f.add(i),e=F_.bind(null,e,t,i),t.then(e,e))}function F_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ke===e&&(Ne&i)===i&&(rt===4||rt===3&&(Ne&62914560)===Ne&&300>ge()-In?($e&2)===0&&Xs(e,0):Xl|=i,Ws===Ne&&(Ws=0)),oi(e)}function Yu(e,t){t===0&&(t=$o()),e=ss(e,t),e!==null&&(rr(e,t),oi(e))}function $_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Yu(e,i)}function q_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(U(314))}s!==null&&s.delete(t),Yu(e,i)}function W_(e,t){return Se(e,t)}var Gn=null,Ys=null,to=!1,Xn=!1,io=!1,qi=0;function oi(e){e!==Ys&&e.next===null&&(Ys===null?Gn=Ys=e:Ys=Ys.next=e),Xn=!0,to||(to=!0,X_())}function Ur(e,t){if(!io&&Xn){io=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var g=0;else{var M=s.suspendedLanes,H=s.pingedLanes;g=(1<<31-ut(42|e)+1)-1,g&=f&~(M&~H),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,Ju(s,g))}else g=Ne,g=Kr(s,s===Ke?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(g&3)===0||sr(s,g)||(i=!0,Ju(s,g));s=s.next}while(i);io=!1}}function G_(){Ku()}function Ku(){Xn=to=!1;var e=0;qi!==0&&sv()&&(e=qi);for(var t=ge(),i=null,s=Gn;s!==null;){var f=s.next,g=Qu(s,t);g===0?(s.next=null,i===null?Gn=f:i.next=f,f===null&&(Ys=i)):(i=s,(e!==0||(g&3)!==0)&&(Xn=!0)),s=f}dt!==0&&dt!==5||Ur(e),qi!==0&&(qi=0)}function Qu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var M=31-ut(g),H=1<<M,X=f[M];X===-1?((H&i)===0||(H&s)!==0)&&(f[M]=Sf(H,t)):X<=t&&(e.expiredLanes|=H),g&=~H}if(t=Ke,i=Ne,i=Kr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&pe(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||sr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&pe(s),pa(i)){case 2:case 8:i=_t;break;case 32:i=Qe;break;case 268435456:i=Ie;break;default:i=Qe}return s=Zu.bind(null,e),i=Se(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&pe(s),e.callbackPriority=2,e.callbackNode=null,2}function Zu(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Wn()&&e.callbackNode!==i)return null;var s=Ne;return s=Kr(e,e===Ke?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ou(e,s,t),Qu(e,ge()),e.callbackNode!=null&&e.callbackNode===i?Zu.bind(null,e):null)}function Ju(e,t){if(Wn())return null;Ou(e,t,!0)}function X_(){nv(function(){($e&6)!==0?Se(Re,G_):Ku()})}function so(){if(qi===0){var e=ks;e===0&&(e=jt,jt<<=1,(jt&261888)===0&&(jt=256)),qi=e}return qi}function ed(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function td(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 V_(e,t,i,s,f){if(t==="submit"&&i&&i.stateNode===f){var g=ed((f[Et]||null).action),M=s.submitter;M&&(t=(t=M[Et]||null)?ed(t.formAction):M.getAttribute("formAction"),t!==null&&(g=t,M=null));var H=new nn("action","action",null,s,f);e.push({event:H,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(qi!==0){var X=M?td(f,M):new FormData(f);wl(i,{pending:!0,data:X,method:f.method,action:g},null,X)}}else typeof g=="function"&&(H.preventDefault(),X=M?td(f,M):new FormData(f),wl(i,{pending:!0,data:X,method:f.method,action:g},g,X))},currentTarget:f}]})}}for(var ro=0;ro<Pa.length;ro++){var no=Pa[ro],Y_=no.toLowerCase(),K_=no[0].toUpperCase()+no.slice(1);ei(Y_,"on"+K_)}ei(Bc,"onAnimationEnd"),ei(Oc,"onAnimationIteration"),ei(kc,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(d_,"onTransitionRun"),ei(f_,"onTransitionStart"),ei(__,"onTransitionCancel"),ei(Hc,"onTransitionEnd"),Cs("onMouseEnter",["mouseout","mouseover"]),Cs("onMouseLeave",["mouseout","mouseover"]),Cs("onPointerEnter",["pointerout","pointerover"]),Cs("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(" "),Q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ir));function id(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],f=s.event;s=s.listeners;e:{var g=void 0;if(t)for(var M=s.length-1;0<=M;M--){var H=s[M],X=H.instance,ie=H.currentTarget;if(H=H.listener,X!==g&&f.isPropagationStopped())break e;g=H,f.currentTarget=ie;try{g(f)}catch(le){on(le)}f.currentTarget=null,g=X}else for(M=0;M<s.length;M++){if(H=s[M],X=H.instance,ie=H.currentTarget,H=H.listener,X!==g&&f.isPropagationStopped())break e;g=H,f.currentTarget=ie;try{g(f)}catch(le){on(le)}f.currentTarget=null,g=X}}}}function He(e,t){var i=t[ma];i===void 0&&(i=t[ma]=new Set);var s=e+"__bubble";i.has(s)||(sd(t,e,2,!1),i.add(s))}function ao(e,t,i){var s=0;t&&(s|=4),sd(i,e,s,t)}var Vn="_reactListening"+Math.random().toString(36).slice(2);function lo(e){if(!e[Vn]){e[Vn]=!0,Ko.forEach(function(i){i!=="selectionchange"&&(Q_.has(i)||ao(i,!1,e),ao(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vn]||(t[Vn]=!0,ao("selectionchange",!1,t))}}function sd(e,t,i,s){switch(Bd(t)){case 2:var f=Lv;break;case 8:f=Ev;break;default:f=wo}i=f.bind(null,t,i,e),f=void 0,!Ma||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(t,i,{capture:!0,passive:f}):e.addEventListener(t,i,!0):f!==void 0?e.addEventListener(t,i,{passive:f}):e.addEventListener(t,i,!1)}function oo(e,t,i,s,f){var g=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var M=s.tag;if(M===3||M===4){var H=s.stateNode.containerInfo;if(H===f)break;if(M===4)for(M=s.return;M!==null;){var X=M.tag;if((X===3||X===4)&&M.stateNode.containerInfo===f)return;M=M.return}for(;H!==null;){if(M=ps(H),M===null)return;if(X=M.tag,X===5||X===6||X===26||X===27){s=g=M;continue e}H=H.parentNode}}s=s.return}oc(function(){var ie=g,le=La(i),de=[];e:{var ne=zc.get(e);if(ne!==void 0){var ae=nn,Ce=e;switch(e){case"keypress":if(sn(i)===0)break e;case"keydown":case"keyup":ae=qf;break;case"focusin":Ce="focus",ae=Ta;break;case"focusout":Ce="blur",ae=Ta;break;case"beforeblur":case"afterblur":ae=Ta;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":ae=uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Bf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Xf;break;case Bc:case Oc:case kc:ae=Hf;break;case Hc:ae=Yf;break;case"scroll":case"scrollend":ae=Df;break;case"wheel":ae=Qf;break;case"copy":case"cut":case"paste":ae=Nf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=fc;break;case"toggle":case"beforetoggle":ae=Jf}var Ee=(t&4)!==0,Ye=!Ee&&(e==="scroll"||e==="scrollend"),Z=Ee?ne!==null?ne+"Capture":null:ne;Ee=[];for(var Y=ie,te;Y!==null;){var he=Y;if(te=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||te===null||Z===null||(he=lr(Y,Z),he!=null&&Ee.push(Pr(Y,he,te))),Ye)break;Y=Y.return}0<Ee.length&&(ne=new ae(ne,Ce,null,i,le),de.push({event:ne,listeners:Ee}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",ne&&i!==xa&&(Ce=i.relatedTarget||i.fromElement)&&(ps(Ce)||Ce[gs]))break e;if((ae||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(Ce=i.relatedTarget||i.toElement,ae=ie,Ce=Ce?ps(Ce):null,Ce!==null&&(Ye=se(Ce),Ee=Ce.tag,Ce!==Ye||Ee!==5&&Ee!==27&&Ee!==6)&&(Ce=null)):(ae=null,Ce=ie),ae!==Ce)){if(Ee=uc,he="onMouseLeave",Z="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=fc,he="onPointerLeave",Z="onPointerEnter",Y="pointer"),Ye=ae==null?ne:ar(ae),te=Ce==null?ne:ar(Ce),ne=new Ee(he,Y+"leave",ae,i,le),ne.target=Ye,ne.relatedTarget=te,he=null,ps(le)===ie&&(Ee=new Ee(Z,Y+"enter",Ce,i,le),Ee.target=te,Ee.relatedTarget=Ye,he=Ee),Ye=he,ae&&Ce)t:{for(Ee=Z_,Z=ae,Y=Ce,te=0,he=Z;he;he=Ee(he))te++;he=0;for(var xe=Y;xe;xe=Ee(xe))he++;for(;0<te-he;)Z=Ee(Z),te--;for(;0<he-te;)Y=Ee(Y),he--;for(;te--;){if(Z===Y||Y!==null&&Z===Y.alternate){Ee=Z;break t}Z=Ee(Z),Y=Ee(Y)}Ee=null}else Ee=null;ae!==null&&rd(de,ne,ae,Ee,!1),Ce!==null&&Ye!==null&&rd(de,Ye,Ce,Ee,!0)}}e:{if(ne=ie?ar(ie):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var je=yc;else if(Sc(ne))if(bc)je=c_;else{je=l_;var ye=a_}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ie&&wa(ie.elementType)&&(je=yc):je=o_;if(je&&(je=je(e,ie))){Cc(de,je,i,le);break e}ye&&ye(e,ne,ie),e==="focusout"&&ie&&ne.type==="number"&&ie.memoizedProps.value!=null&&ba(ne,"number",ne.value)}switch(ye=ie?ar(ie):window,e){case"focusin":(Sc(ye)||ye.contentEditable==="true")&&(Es=ye,Na=ie,vr=null);break;case"focusout":vr=Na=Es=null;break;case"mousedown":Ua=!0;break;case"contextmenu":case"mouseup":case"dragend":Ua=!1,Dc(de,i,le);break;case"selectionchange":if(u_)break;case"keydown":case"keyup":Dc(de,i,le)}var Be;if(Oa)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ls?pc(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(_c&&i.locale!=="ko"&&(Ls||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ls&&(Be=cc()):(Ai=le,Aa="value"in Ai?Ai.value:Ai.textContent,Ls=!0)),ye=Yn(ie,Ue),0<ye.length&&(Ue=new dc(Ue,e,null,i,le),de.push({event:Ue,listeners:ye}),Be?Ue.data=Be:(Be=mc(i),Be!==null&&(Ue.data=Be)))),(Be=t_?i_(e,i):s_(e,i))&&(Ue=Yn(ie,"onBeforeInput"),0<Ue.length&&(ye=new dc("onBeforeInput","beforeinput",null,i,le),de.push({event:ye,listeners:Ue}),ye.data=Be)),V_(de,e,ie,i,le)}id(de,t)})}function Pr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Yn(e,t){for(var i=t+"Capture",s=[];e!==null;){var f=e,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=lr(e,i),f!=null&&s.unshift(Pr(e,f,g)),f=lr(e,t),f!=null&&s.push(Pr(e,f,g))),e.tag===3)return s;e=e.return}return[]}function Z_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rd(e,t,i,s,f){for(var g=t._reactName,M=[];i!==null&&i!==s;){var H=i,X=H.alternate,ie=H.stateNode;if(H=H.tag,X!==null&&X===s)break;H!==5&&H!==26&&H!==27||ie===null||(X=ie,f?(ie=lr(i,g),ie!=null&&M.unshift(Pr(i,ie,X))):f||(ie=lr(i,g),ie!=null&&M.push(Pr(i,ie,X)))),i=i.return}M.length!==0&&e.push({event:t,listeners:M})}var J_=/\r\n?/g,ev=/\u0000|\uFFFD/g;function nd(e){return(typeof e=="string"?e:""+e).replace(J_,`
49
- `).replace(ev,"")}function ad(e,t){return t=nd(t),nd(e)===t}function Ve(e,t,i,s,f,g){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||bs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&bs(e,""+s);break;case"className":Zr(e,"class",s);break;case"tabIndex":Zr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zr(e,i,s);break;case"style":ac(e,s,g);break;case"data":if(t!=="object"){Zr(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="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 g=="function"&&(i==="formAction"?(t!=="input"&&Ve(e,t,"name",f.name,f,null),Ve(e,t,"formEncType",f.formEncType,f,null),Ve(e,t,"formMethod",f.formMethod,f,null),Ve(e,t,"formTarget",f.formTarget,f,null)):(Ve(e,t,"encType",f.encType,f,null),Ve(e,t,"method",f.method,f,null),Ve(e,t,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=hi);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(U(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(U(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=en(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":He("beforetoggle",e),He("toggle",e),Qr(e,"popover",s);break;case"xlinkActuate":ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ci(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ci(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ci(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ci(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ci(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Af.get(i)||i,Qr(e,i,s))}}function co(e,t,i,s,f,g){switch(i){case"style":ac(e,s,g);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(U(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(U(60));e.innerHTML=i}}break;case"children":typeof s=="string"?bs(e,s):(typeof s=="number"||typeof s=="bigint")&&bs(e,""+s);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"onClick":s!=null&&(e.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qo.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),t=i.slice(2,f?i.length-7:void 0),g=e[Et]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(t,g,f),typeof s=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,f);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Qr(e,i,s)}}}function bt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var s=!1,f=!1,g;for(g in i)if(i.hasOwnProperty(g)){var M=i[g];if(M!=null)switch(g){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(U(137,t));default:Ve(e,t,g,M,i,null)}}f&&Ve(e,t,"srcSet",i.srcSet,i,null),s&&Ve(e,t,"src",i.src,i,null);return;case"input":He("invalid",e);var H=g=M=f=null,X=null,ie=null;for(s in i)if(i.hasOwnProperty(s)){var le=i[s];if(le!=null)switch(s){case"name":f=le;break;case"type":M=le;break;case"checked":X=le;break;case"defaultChecked":ie=le;break;case"value":g=le;break;case"defaultValue":H=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(U(137,t));break;default:Ve(e,t,s,le,i,null)}}ic(e,g,H,X,ie,M,f,!1);return;case"select":He("invalid",e),s=M=g=null;for(f in i)if(i.hasOwnProperty(f)&&(H=i[f],H!=null))switch(f){case"value":g=H;break;case"defaultValue":M=H;break;case"multiple":s=H;default:Ve(e,t,f,H,i,null)}t=g,i=M,e.multiple=!!s,t!=null?ys(e,!!s,t,!1):i!=null&&ys(e,!!s,i,!0);return;case"textarea":He("invalid",e),g=f=s=null;for(M in i)if(i.hasOwnProperty(M)&&(H=i[M],H!=null))switch(M){case"value":s=H;break;case"defaultValue":f=H;break;case"children":g=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(U(91));break;default:Ve(e,t,M,H,i,null)}rc(e,s,f,g);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(s=i[X],s!=null))switch(X){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ve(e,t,X,s,i,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(s=0;s<Ir.length;s++)He(Ir[s],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(ie in i)if(i.hasOwnProperty(ie)&&(s=i[ie],s!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(U(137,t));default:Ve(e,t,ie,s,i,null)}return;default:if(wa(t)){for(le in i)i.hasOwnProperty(le)&&(s=i[le],s!==void 0&&co(e,t,le,s,i,void 0));return}}for(H in i)i.hasOwnProperty(H)&&(s=i[H],s!=null&&Ve(e,t,H,s,i,null))}function tv(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,M=null,H=null,X=null,ie=null,le=null;for(ae in i){var de=i[ae];if(i.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":X=de;default:s.hasOwnProperty(ae)||Ve(e,t,ae,null,s,de)}}for(var ne in s){var ae=s[ne];if(de=i[ne],s.hasOwnProperty(ne)&&(ae!=null||de!=null))switch(ne){case"type":g=ae;break;case"name":f=ae;break;case"checked":ie=ae;break;case"defaultChecked":le=ae;break;case"value":M=ae;break;case"defaultValue":H=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(U(137,t));break;default:ae!==de&&Ve(e,t,ne,ae,s,de)}}ya(e,M,H,X,ie,le,g,f);return;case"select":ae=M=H=ne=null;for(g in i)if(X=i[g],i.hasOwnProperty(g)&&X!=null)switch(g){case"value":break;case"multiple":ae=X;default:s.hasOwnProperty(g)||Ve(e,t,g,null,s,X)}for(f in s)if(g=s[f],X=i[f],s.hasOwnProperty(f)&&(g!=null||X!=null))switch(f){case"value":ne=g;break;case"defaultValue":H=g;break;case"multiple":M=g;default:g!==X&&Ve(e,t,f,g,s,X)}t=H,i=M,s=ae,ne!=null?ys(e,!!i,ne,!1):!!s!=!!i&&(t!=null?ys(e,!!i,t,!0):ys(e,!!i,i?[]:"",!1));return;case"textarea":ae=ne=null;for(H in i)if(f=i[H],i.hasOwnProperty(H)&&f!=null&&!s.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Ve(e,t,H,null,s,f)}for(M in s)if(f=s[M],g=i[M],s.hasOwnProperty(M)&&(f!=null||g!=null))switch(M){case"value":ne=f;break;case"defaultValue":ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(U(91));break;default:f!==g&&Ve(e,t,M,f,s,g)}sc(e,ne,ae);return;case"option":for(var Ce in i)if(ne=i[Ce],i.hasOwnProperty(Ce)&&ne!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ve(e,t,Ce,null,s,ne)}for(X in s)if(ne=s[X],ae=i[X],s.hasOwnProperty(X)&&ne!==ae&&(ne!=null||ae!=null))switch(X){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Ve(e,t,X,ne,s,ae)}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 Ee in i)ne=i[Ee],i.hasOwnProperty(Ee)&&ne!=null&&!s.hasOwnProperty(Ee)&&Ve(e,t,Ee,null,s,ne);for(ie in s)if(ne=s[ie],ae=i[ie],s.hasOwnProperty(ie)&&ne!==ae&&(ne!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(U(137,t));break;default:Ve(e,t,ie,ne,s,ae)}return;default:if(wa(t)){for(var Ye in i)ne=i[Ye],i.hasOwnProperty(Ye)&&ne!==void 0&&!s.hasOwnProperty(Ye)&&co(e,t,Ye,void 0,s,ne);for(le in s)ne=s[le],ae=i[le],!s.hasOwnProperty(le)||ne===ae||ne===void 0&&ae===void 0||co(e,t,le,ne,s,ae);return}}for(var Z in i)ne=i[Z],i.hasOwnProperty(Z)&&ne!=null&&!s.hasOwnProperty(Z)&&Ve(e,t,Z,null,s,ne);for(de in s)ne=s[de],ae=i[de],!s.hasOwnProperty(de)||ne===ae||ne==null&&ae==null||Ve(e,t,de,ne,s,ae)}function ld(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var f=i[s],g=f.transferSize,M=f.initiatorType,H=f.duration;if(g&&H&&ld(M)){for(M=0,H=f.responseEnd,s+=1;s<i.length;s++){var X=i[s],ie=X.startTime;if(ie>H)break;var le=X.transferSize,de=X.initiatorType;le&&ld(de)&&(X=X.responseEnd,M+=le*(X<H?1:(H-ie)/(X-ie)))}if(--s,t+=8*(g+M)/(f.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 ho=null,uo=null;function Kn(e){return e.nodeType===9?e:e.ownerDocument}function od(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 cd(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 fo(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 _o=null;function sv(){var e=window.event;return e&&e.type==="popstate"?e===_o?!1:(_o=e,!0):(_o=null,!1)}var hd=typeof setTimeout=="function"?setTimeout:void 0,rv=typeof clearTimeout=="function"?clearTimeout:void 0,ud=typeof Promise=="function"?Promise:void 0,nv=typeof queueMicrotask=="function"?queueMicrotask:typeof ud<"u"?function(e){return ud.resolve(null).then(e).catch(av)}:hd;function av(e){setTimeout(function(){throw e})}function Wi(e){return e==="head"}function dd(e,t){var i=t,s=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(f),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")jr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,jr(i);for(var g=i.firstChild;g;){var M=g.nextSibling,H=g.nodeName;g[nr]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&g.rel.toLowerCase()==="stylesheet"||i.removeChild(g),g=M}}else i==="body"&&jr(e.ownerDocument.body);i=f}while(i);Js(t)}function fd(e,t){var i=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function vo(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":vo(i),Sa(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function lv(e,t,i,s){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=Kt(e.nextSibling),e===null)break}return null}function ov(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Kt(e.nextSibling),e===null))return null;return e}function _d(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Kt(e.nextSibling),e===null))return null;return e}function go(e){return e.data==="$?"||e.data==="$~"}function po(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cv(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Kt(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 mo=null;function vd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Kt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function gd(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 pd(e,t,i){switch(t=Kn(i),e){case"html":if(e=t.documentElement,!e)throw Error(U(452));return e;case"head":if(e=t.head,!e)throw Error(U(453));return e;case"body":if(e=t.body,!e)throw Error(U(454));return e;default:throw Error(U(451))}}function jr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Sa(e)}var Qt=new Map,md=new Set;function Qn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ei=P.d;P.d={f:hv,r:uv,D:dv,C:fv,L:_v,m:vv,X:pv,S:gv,M:mv};function hv(){var e=Ei.f(),t=Fn();return e||t}function uv(e){var t=ms(e);t!==null&&t.tag===5&&t.type==="form"?Hh(t):Ei.r(e)}var Ks=typeof document>"u"?null:document;function Sd(e,t,i){var s=Ks;if(s&&typeof t=="string"&&t){var f=$t(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),md.has(f)||(md.add(f),e={rel:e,crossOrigin:i,href:t},s.querySelector(f)===null&&(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function dv(e){Ei.D(e),Sd("dns-prefetch",e,null)}function fv(e,t){Ei.C(e,t),Sd("preconnect",e,t)}function _v(e,t,i){Ei.L(e,t,i);var s=Ks;if(s&&e&&t){var f='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+$t(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+$t(i.imageSizes)+'"]')):f+='[href="'+$t(e)+'"]';var g=f;switch(t){case"style":g=Qs(e);break;case"script":g=Zs(e)}Qt.has(g)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qt.set(g,e),s.querySelector(f)!==null||t==="style"&&s.querySelector(Fr(g))||t==="script"&&s.querySelector($r(g))||(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function vv(e,t){Ei.m(e,t);var i=Ks;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+$t(s)+'"][href="'+$t(e)+'"]',g=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Zs(e)}if(!Qt.has(g)&&(e=a({rel:"modulepreload",href:e},t),Qt.set(g,e),i.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector($r(g)))return}s=i.createElement("link"),bt(s,"link",e),gt(s),i.head.appendChild(s)}}}function gv(e,t,i){Ei.S(e,t,i);var s=Ks;if(s&&e){var f=Ss(s).hoistableStyles,g=Qs(e);t=t||"default";var M=f.get(g);if(!M){var H={loading:0,preload:null};if(M=s.querySelector(Fr(g)))H.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qt.get(g))&&So(e,i);var X=M=s.createElement("link");gt(X),bt(X,"link",e),X._p=new Promise(function(ie,le){X.onload=ie,X.onerror=le}),X.addEventListener("load",function(){H.loading|=1}),X.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Zn(M,t,s)}M={type:"stylesheet",instance:M,count:1,state:H},f.set(g,M)}}}function pv(e,t){Ei.X(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),g=s.get(f);g||(g=i.querySelector($r(f)),g||(e=a({src:e,async:!0},t),(t=Qt.get(f))&&Co(e,t),g=i.createElement("script"),gt(g),bt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(f,g))}}function mv(e,t){Ei.M(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),g=s.get(f);g||(g=i.querySelector($r(f)),g||(e=a({src:e,async:!0,type:"module"},t),(t=Qt.get(f))&&Co(e,t),g=i.createElement("script"),gt(g),bt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(f,g))}}function Cd(e,t,i,s){var f=(f=ce.current)?Qn(f):null;if(!f)throw Error(U(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Qs(i.href),i=Ss(f).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Qs(i.href);var g=Ss(f).hoistableStyles,M=g.get(e);if(M||(f=f.ownerDocument||f,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,M),(g=f.querySelector(Fr(e)))&&!g._p&&(M.instance=g,M.state.loading=5),Qt.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},Qt.set(e,i),g||Sv(f,e,i,M.state))),t&&s===null)throw Error(U(528,""));return M}if(t&&s!==null)throw Error(U(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zs(i),i=Ss(f).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(U(444,e))}}function Qs(e){return'href="'+$t(e)+'"'}function Fr(e){return'link[rel="stylesheet"]['+e+"]"}function yd(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function Sv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),bt(t,"link",i),gt(t),e.head.appendChild(t))}function Zs(e){return'[src="'+$t(e)+'"]'}function $r(e){return"script[async]"+e}function bd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+$t(i.href)+'"]');if(s)return t.instance=s,gt(s),s;var f=a({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),gt(s),bt(s,"style",f),Zn(s,i.precedence,e),t.instance=s;case"stylesheet":f=Qs(i.href);var g=e.querySelector(Fr(f));if(g)return t.state.loading|=4,t.instance=g,gt(g),g;s=yd(i),(f=Qt.get(f))&&So(s,f),g=(e.ownerDocument||e).createElement("link"),gt(g);var M=g;return M._p=new Promise(function(H,X){M.onload=H,M.onerror=X}),bt(g,"link",s),t.state.loading|=4,Zn(g,i.precedence,e),t.instance=g;case"script":return g=Zs(i.src),(f=e.querySelector($r(g)))?(t.instance=f,gt(f),f):(s=i,(f=Qt.get(g))&&(s=a({},i),Co(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),gt(f),bt(f,"link",s),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(U(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Zn(s,i.precedence,e));return t.instance}function Zn(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,g=f,M=0;M<s.length;M++){var H=s[M];if(H.dataset.precedence===t)g=H;else if(g!==f)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function So(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Co(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jn=null;function wd(e,t,i){if(Jn===null){var s=new Map,f=Jn=new Map;f.set(i,s)}else f=Jn,s=f.get(i),s||(s=new Map,f.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var g=i[f];if(!(g[nr]||g[mt]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var M=g.getAttribute(t)||"";M=e+M;var H=s.get(M);H?H.push(g):s.set(M,[g])}}return s}function xd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Cv(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 Ld(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Qs(s.href),g=t.querySelector(Fr(f));if(g){t=g._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ea.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=g,gt(g);return}g=t.ownerDocument||t,s=yd(s),(f=Qt.get(f))&&So(s,f),g=g.createElement("link"),gt(g);var M=g;M._p=new Promise(function(H,X){M.onload=H,M.onerror=X}),bt(g,"link",s),i.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ea.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var yo=0;function bv(e,t){return e.stylesheets&&e.count===0&&ia(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+t);0<e.imgBytes&&yo===0&&(yo=62500*iv());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>yo?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function ea(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ia(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ta=null;function ia(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ta=new Map,t.forEach(wv,e),ta=null,ea.call(e))}function wv(e,t){if(!(t.state.loading&4)){var i=ta.get(e);if(i)var s=i.get(null);else{i=new Map,ta.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var M=f[g];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(i.set(M.dataset.precedence,M),s=M)}s&&i.set(null,s)}f=t.instance,M=f.getAttribute("data-precedence"),g=i.get(M)||s,g===s&&i.set(null,f),i.set(M,f),this.count++,s=ea.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),g?g.parentNode.insertBefore(f,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var qr={$$typeof:l,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function xv(e,t,i,s,f,g,M,H,X){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.hiddenUpdates=va(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function Ed(e,t,i,s,f,g,M,H,X,ie,le,de){return e=new xv(e,t,i,M,X,ie,le,de,H),t=1,g===!0&&(t|=24),g=Ht(3,null,null,t),e.current=g,g.stateNode=e,t=Ja(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:s,isDehydrated:i,cache:t},sl(g),e}function Md(e){return e?(e=Rs,e):Rs}function Ad(e,t,i,s,f,g){f=Md(f),s.context===null?s.context=f:s.pendingContext=f,s=ki(t),s.payload={element:i},g=g===void 0?null:g,g!==null&&(s.callback=g),i=Hi(e,s,t),i!==null&&(Bt(i,e,t),br(i,e,t))}function Rd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function bo(e,t){Rd(e,t),(e=e.alternate)&&Rd(e,t)}function Dd(e){if(e.tag===13||e.tag===31){var t=ss(e,67108864);t!==null&&Bt(t,e,67108864),bo(e,67108864)}}function Td(e){if(e.tag===13||e.tag===31){var t=Pt();t=ga(t);var i=ss(e,t);i!==null&&Bt(i,e,t),bo(e,t)}}var sa=!0;function Lv(e,t,i,s){var f=N.T;N.T=null;var g=P.p;try{P.p=2,wo(e,t,i,s)}finally{P.p=g,N.T=f}}function Ev(e,t,i,s){var f=N.T;N.T=null;var g=P.p;try{P.p=8,wo(e,t,i,s)}finally{P.p=g,N.T=f}}function wo(e,t,i,s){if(sa){var f=xo(s);if(f===null)oo(e,t,s,ra,i),Od(e,s);else if(Av(f,e,t,i,s))s.stopPropagation();else if(Od(e,s),t&4&&-1<Mv.indexOf(e)){for(;f!==null;){var g=ms(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var M=Jt(g.pendingLanes);if(M!==0){var H=g;for(H.pendingLanes|=2,H.entangledLanes|=2;M;){var X=1<<31-ut(M);H.entanglements[1]|=X,M&=~X}oi(g),($e&6)===0&&(Pn=ge()+500,Ur(0))}}break;case 31:case 13:H=ss(g,2),H!==null&&Bt(H,g,2),Fn(),bo(g,2)}if(g=xo(s),g===null&&oo(e,t,s,ra,i),g===f)break;f=g}f!==null&&s.stopPropagation()}else oo(e,t,s,null,i)}}function xo(e){return e=La(e),Lo(e)}var ra=null;function Lo(e){if(ra=null,e=ps(e),e!==null){var t=se(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=n(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 ra=e,null}function Bd(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(ze()){case Re:return 2;case _t:return 8;case Qe:case it:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Eo=!1,Gi=null,Xi=null,Vi=null,Wr=new Map,Gr=new Map,Yi=[],Mv="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 Od(e,t){switch(e){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":Wr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gr.delete(t.pointerId)}}function Xr(e,t,i,s,f,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:g,targetContainers:[f]},t!==null&&(t=ms(t),t!==null&&Dd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function Av(e,t,i,s,f){switch(t){case"focusin":return Gi=Xr(Gi,e,t,i,s,f),!0;case"dragenter":return Xi=Xr(Xi,e,t,i,s,f),!0;case"mouseover":return Vi=Xr(Vi,e,t,i,s,f),!0;case"pointerover":var g=f.pointerId;return Wr.set(g,Xr(Wr.get(g)||null,e,t,i,s,f)),!0;case"gotpointercapture":return g=f.pointerId,Gr.set(g,Xr(Gr.get(g)||null,e,t,i,s,f)),!0}return!1}function kd(e){var t=ps(e.target);if(t!==null){var i=se(t);if(i!==null){if(t=i.tag,t===13){if(t=F(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Td(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Td(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 na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=xo(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);xa=s,i.target.dispatchEvent(s),xa=null}else return t=ms(i),t!==null&&Dd(t),e.blockedOn=i,!1;t.shift()}return!0}function Hd(e,t,i){na(e)&&i.delete(t)}function Rv(){Eo=!1,Gi!==null&&na(Gi)&&(Gi=null),Xi!==null&&na(Xi)&&(Xi=null),Vi!==null&&na(Vi)&&(Vi=null),Wr.forEach(Hd),Gr.forEach(Hd)}function aa(e,t){e.blockedOn===t&&(e.blockedOn=null,Eo||(Eo=!0,I.unstable_scheduleCallback(I.unstable_NormalPriority,Rv)))}var la=null;function zd(e){la!==e&&(la=e,I.unstable_scheduleCallback(I.unstable_NormalPriority,function(){la===e&&(la=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],f=e[t+2];if(typeof s!="function"){if(Lo(s||i)===null)continue;break}var g=ms(i);g!==null&&(e.splice(t,3),t-=3,wl(g,{pending:!0,data:f,method:i.method,action:s},s,f))}}))}function Js(e){function t(X){return aa(X,e)}Gi!==null&&aa(Gi,e),Xi!==null&&aa(Xi,e),Vi!==null&&aa(Vi,e),Wr.forEach(t),Gr.forEach(t);for(var i=0;i<Yi.length;i++){var s=Yi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Yi.length&&(i=Yi[0],i.blockedOn===null);)kd(i),i.blockedOn===null&&Yi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var f=i[s],g=i[s+1],M=f[Et]||null;if(typeof g=="function")M||zd(i);else if(M){var H=null;if(g&&g.hasAttribute("formAction")){if(f=g,M=g[Et]||null)H=M.formAction;else if(Lo(f)!==null)continue}else H=M.action;typeof H=="function"?i[s+1]=H:(i.splice(s,3),s-=3),zd(i)}}}function Nd(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(M){return f=M})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function Mo(e){this._internalRoot=e}oa.prototype.render=Mo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));var i=t.current,s=Pt();Ad(i,s,e,t,null,null)},oa.prototype.unmount=Mo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ad(e.current,2,null,e,null,null),Fn(),t[gs]=null}};function oa(e){this._internalRoot=e}oa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Yi.length&&t!==0&&t<Yi[i].priority;i++);Yi.splice(i,0,e),i===0&&kd(e)}};var Ud=G.version;if(Ud!=="19.2.4")throw Error(U(527,Ud,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=d(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var Dv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{xt=ca.inject(Dv),tt=ca}catch{}}return Yr.createRoot=function(e,t){if(!J(e))throw Error(U(299));var i=!1,s="",f=Wh,g=Gh,M=Xh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(M=t.onRecoverableError)),t=Ed(e,1,!1,null,null,i,s,null,f,g,M,Nd),e[gs]=t.current,lo(e),new Mo(t)},Yr.hydrateRoot=function(e,t,i){if(!J(e))throw Error(U(299));var s=!1,f="",g=Wh,M=Gh,H=Xh,X=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(M=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=Ed(e,1,!0,t,i??null,s,f,X,g,M,H,Nd),t.context=Md(null),i=t.current,s=Pt(),s=ga(s),f=ki(s),f.callback=null,Hi(i,f,s),i=s,t.current.lanes=i,rr(t,i),oi(t),e[gs]=t.current,lo(e),new oa(t)},Yr.version="19.2.4",Yr}var Vd;function Fv(){if(Vd)return Do.exports;Vd=1;function I(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I)}catch(G){console.error(G)}}return I(),Do.exports=jv(),Do.exports}var $v=Fv();const af=768,qv=1e3;function _a(){return"./"}function Qi(I){const G=_a(),V=I.startsWith("/")?I.slice(1):I;return G+V}function Zi(){const I=localStorage.getItem("codev-web-key");return I?{Authorization:`Bearer ${I}`}:{}}async function Wv(){const I=await fetch(Qi("api/state"),{headers:Zi()});if(!I.ok)throw new Error(`Failed to fetch state: ${I.status}`);return I.json()}async function Gv(){const I=await fetch(Qi("api/tabs/shell"),{method:"POST",headers:{"Content-Type":"application/json",...Zi()}});if(!I.ok)throw new Error(await I.text());return I.json()}async function lf(I,G,V){const U=await fetch(Qi("api/tabs/file"),{method:"POST",headers:{"Content-Type":"application/json",...Zi()},body:JSON.stringify({path:I,line:G,terminalId:V})});if(!U.ok)throw new Error(await U.text());return U.json()}async function Xv(I){const G=await fetch(Qi(`api/tabs/${I}`),{method:"DELETE",headers:Zi()});if(!G.ok)throw new Error(await G.text())}async function Vv(){const I=await fetch(Qi("api/files"),{headers:Zi()});if(!I.ok)throw new Error(`Failed to fetch files: ${I.status}`);return I.json()}async function of(I){const G=await fetch(Qi("api/paste-image"),{method:"POST",headers:{"Content-Type":I.type||"image/png",...Zi()},body:I});if(!G.ok)throw new Error(`Image upload failed: ${G.status}`);return G.json()}function Yd(I){if(I.terminalId){const G=window.location.pathname;return`${G.endsWith("/")?G:G+"/"}ws/terminal/${I.terminalId}`}return null}async function Yv(){const I=await fetch(Qi("api/git/status"),{headers:Zi()});if(!I.ok)throw new Error(`Failed to fetch git status: ${I.status}`);return I.json()}async function Kv(){const I=await fetch(Qi("api/files/recent"),{headers:Zi()});if(!I.ok)throw new Error(`Failed to fetch recent files: ${I.status}`);return I.json()}function Qv(){const[I,G]=we.useState(null),[V,U]=we.useState(null),J=we.useCallback(async()=>{try{const se=await Wv();G(se),U(null)}catch(se){U(se.message)}},[]);return we.useEffect(()=>{J();const se=setInterval(J,qv);return()=>clearInterval(se)},[J]),{state:I,error:V,refresh:J}}function Zv(I){const G=[{id:"dashboard",type:"dashboard",label:"Dashboard",closable:!1}];I!=null&&I.architect&&G.push({id:"architect",type:"architect",label:"Architect",closable:!1,terminalId:I.architect.terminalId,persistent:I.architect.persistent});for(const V of(I==null?void 0:I.builders)??[])G.push({id:V.id,type:"builder",label:V.name||`Builder ${V.id}`,closable:!0,projectId:V.id,terminalId:V.terminalId,persistent:V.persistent});for(const V of(I==null?void 0:I.utils)??[])!V.terminalId&&(!V.pid||V.pid===0)||G.push({id:V.id,type:"shell",label:V.name||`Shell ${V.id}`,closable:!0,utilId:V.id,terminalId:V.terminalId,persistent:V.persistent});for(const V of(I==null?void 0:I.annotations)??[]){const U=V.file.split("/").pop()??V.file;G.push({id:V.id,type:"file",label:U,closable:!0,annotationId:V.id,filePath:V.file})}return G}function Jv(I){const[G,V]=we.useState("dashboard"),U=we.useRef(null),J=we.useRef(!1),se=Zv(I);we.useEffect(()=>{if(J.current||I===null)return;const d=new URLSearchParams(window.location.search).get("tab");if(d){const _=se.find(a=>a.id===d||a.type===d);if(_){V(_.id),J.current=!0;const a=new URL(window.location.href);a.searchParams.delete("tab"),window.history.replaceState({},"",a.toString())}}else J.current=!0},[se,I]),we.useEffect(()=>{const u=new Set(se.map(d=>d.id));if(U.current===null){I!==null&&(U.current=u);return}for(const d of se)!U.current.has(d.id)&&d.type!=="architect"&&V(d.id);U.current=u},[se.map(u=>u.id).join(","),I!==null]);const F=we.useCallback(u=>{V(u)},[]),n=se.find(u=>u.id===G)??se[0];return{tabs:se,activeTab:n,activeTabId:G,selectTab:F}}function cf(I){const[G,V]=we.useState(()=>typeof window<"u"?window.matchMedia(I).matches:!1);return we.useEffect(()=>{const U=window.matchMedia(I),J=se=>V(se.matches);return U.addEventListener("change",J),V(U.matches),()=>U.removeEventListener("change",J)},[I]),G}function eg({left:I,right:G,defaultSplit:V=50}){const[U,J]=we.useState(V),se=we.useRef(null),F=we.useRef(!1),n=we.useCallback(u=>{u.preventDefault(),F.current=!0;const d=a=>{if(!F.current||!se.current)return;const p=se.current.getBoundingClientRect(),w=(a.clientX-p.left)/p.width*100;J(Math.max(20,Math.min(80,w)))},_=()=>{F.current=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",_)},[]);return Q.jsxs("div",{ref:se,className:"split-pane",children:[Q.jsx("div",{className:"split-left",style:{width:`${U}%`},children:I}),Q.jsx("div",{className:"split-handle",onMouseDown:n,role:"separator","aria-label":"Resize panels"}),Q.jsx("div",{className:"split-right",style:{width:`${100-U}%`},children:G})]})}function hf({tabs:I,activeTabId:G,onSelectTab:V,onRefresh:U}){const J=async(se,F)=>{se.stopPropagation();try{await Xv(F.id),U()}catch(n){console.error("Failed to close tab:",n)}};return Q.jsx("div",{className:"tab-bar",role:"tablist","aria-label":"Content tabs",children:I.map(se=>Q.jsxs("button",{role:"tab","aria-selected":se.id===G,className:`tab ${se.id===G?"tab-active":""}`,onClick:()=>V(se.id),title:se.label,children:[Q.jsx("span",{className:"tab-label",children:se.label}),se.closable&&Q.jsx("span",{className:"tab-close",onClick:F=>J(F,se),role:"button","aria-label":`Close ${se.label}`,tabIndex:0,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),J(F,se))},children:"×"})]},se.id))})}var ko={exports:{}},Kd;function tg(){return Kd||(Kd=1,(function(I,G){(function(V,U){I.exports=U()})(globalThis,(()=>(()=>{var V={4567:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const a=u(9042),p=u(9924),w=u(844),b=u(4725),o=u(2585),r=u(3656);let h=n.AccessibilityManager=class extends w.Disposable{constructor(c,l,S,x){super(),this._terminal=c,this._coreBrowserService=S,this._renderService=x,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 v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,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 p.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((v=>this._handleResize(v.rows)))),this.register(this._terminal.onRender((v=>this._refreshRows(v.start,v.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((v=>this._handleChar(v)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
48
+ `+s.stack}}var Ot=Object.prototype.hasOwnProperty,Se=P.unstable_scheduleCallback,pe=P.unstable_cancelCallback,me=P.unstable_shouldYield,he=P.unstable_requestPaint,ge=P.unstable_now,ze=P.unstable_getCurrentPriorityLevel,Re=P.unstable_ImmediatePriority,_t=P.unstable_UserBlockingPriority,Qe=P.unstable_NormalPriority,it=P.unstable_LowPriority,Ie=P.unstable_IdlePriority,Ae=P.log,Le=P.unstable_setDisableYieldValue,xt=null,tt=null;function vt(e){if(typeof Ae=="function"&&Le(e),tt&&typeof tt.setStrictMode=="function")try{tt.setStrictMode(xt,e)}catch{}}var ut=Math.clz32?Math.clz32:ir,Zt=Math.log,tr=Math.LN2;function ir(e){return e>>>=0,e===0?32:31-(Zt(e)/tr|0)|0}var jt=256,si=262144,ri=4194304;function Jt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Kr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var f=0,g=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var H=s&134217727;return H!==0?(s=H&~g,s!==0?f=Jt(s):(A&=H,A!==0?f=Jt(A):i||(i=H&~e,i!==0&&(f=Jt(i))))):(H=s&~g,H!==0?f=Jt(H):A!==0?f=Jt(A):i||(i=s&~e,i!==0&&(f=Jt(i)))),f===0?0:t!==0&&t!==f&&(t&g)===0&&(g=f&-f,i=t&-t,g>=i||g===32&&(i&4194048)!==0)?t:f}function sr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Sf(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 $o(){var e=ri;return ri<<=1,(ri&62914560)===0&&(ri=4194304),e}function va(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Cf(e,t,i,s,f,g){var A=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 H=e.entanglements,G=e.expirationTimes,te=e.hiddenUpdates;for(i=A&~i;0<i;){var oe=31-ut(i),de=1<<oe;H[oe]=0,G[oe]=-1;var ne=te[oe];if(ne!==null)for(te[oe]=null,oe=0;oe<ne.length;oe++){var ae=ne[oe];ae!==null&&(ae.lane&=-536870913)}i&=~de}s!==0&&qo(e,s,0),g!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=g&~(A&~t))}function qo(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ut(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Wo(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-ut(i),f=1<<s;f&t|e[s]&t&&(e[s]|=t),i&=~f}}function Go(e,t){var i=t&-t;return i=(i&42)!==0?1:ga(i),(i&(e.suspendedLanes|t))!==0?0:i}function ga(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 pa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xo(){var e=j.p;return e!==0?e:(e=window.event,e===void 0?32:Bd(e.type))}function Vo(e,t){var i=j.p;try{return j.p=e,t()}finally{j.p=i}}var Mi=Math.random().toString(36).slice(2),mt="__reactFiber$"+Mi,Et="__reactProps$"+Mi,gs="__reactContainer$"+Mi,ma="__reactEvents$"+Mi,yf="__reactListeners$"+Mi,bf="__reactHandles$"+Mi,Yo="__reactResources$"+Mi,nr="__reactMarker$"+Mi;function Sa(e){delete e[mt],delete e[Et],delete e[ma],delete e[yf],delete e[bf]}function ps(e){var t=e[mt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[gs]||i[mt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=gd(e);e!==null;){if(i=e[mt])return i;e=gd(e)}return t}e=i,i=e.parentNode}return null}function ms(e){if(e=e[mt]||e[gs]){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(I(33))}function Ss(e){var t=e[Yo];return t||(t=e[Yo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[nr]=!0}var Ko=new Set,Qo={};function Ji(e,t){Cs(e,t),Cs(e+"Capture",t)}function Cs(e,t){for(Qo[e]=t,e=0;e<t.length;e++)Ko.add(t[e])}var wf=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]*$"),Zo={},Jo={};function xf(e){return Ot.call(Jo,e)?!0:Ot.call(Zo,e)?!1:wf.test(e)?Jo[e]=!0:(Zo[e]=!0,!1)}function Qr(e,t,i){if(xf(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Zr(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 ci(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ec(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lf(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,g=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(A){i=""+A,g.call(this,A)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(A){i=""+A},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ca(e){if(!e._valueTracker){var t=ec(e)?"checked":"value";e._valueTracker=Lf(e,t,""+e[t])}}function tc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ec(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Jr(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 Ef=/[\n"\\]/g;function $t(e){return e.replace(Ef,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ya(e,t,i,s,f,g,A,H){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),t!=null?A==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),t!=null?ba(e,A,Ft(t)):i!=null?ba(e,A,Ft(i)):s!=null&&e.removeAttribute("value"),f==null&&g!=null&&(e.defaultChecked=!!g),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?e.name=""+Ft(H):e.removeAttribute("name")}function ic(e,t,i,s,f,g,A,H){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||t!=null)){Ca(e);return}i=i!=null?""+Ft(i):"",t=t!=null?""+Ft(t):i,H||t===e.value||(e.value=t),e.defaultValue=t}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=H?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A),Ca(e)}function ba(e,t,i){t==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ys(e,t,i,s){if(e=e.options,t){t={};for(var f=0;f<i.length;f++)t["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=t.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Ft(i),t=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function sc(e,t,i){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ft(i):""}function rc(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(I(92));if($(s)){if(1<s.length)throw Error(I(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Ft(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Ca(e)}function bs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Mf=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 nc(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Mf.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ac(e,t,i){if(t!=null&&typeof t!="object")throw Error(I(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var f in t)s=t[f],t.hasOwnProperty(f)&&i[f]!==s&&nc(e,f,s)}else for(var g in t)t.hasOwnProperty(g)&&nc(e,g,t[g])}function wa(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 Af=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"]]),Rf=/^[\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 en(e){return Rf.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hi(){}var xa=null;function La(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,xs=null;function lc(e){var t=ms(e);if(t&&(e=t.stateNode)){var i=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(ya(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="'+$t(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var f=s[Et]||null;if(!f)throw Error(I(90));ya(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&tc(s)}break e;case"textarea":sc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ys(e,!!i.multiple,t,!1)}}}var Ea=!1;function oc(e,t,i){if(Ea)return e(t,i);Ea=!0;try{var s=e(t);return s}finally{if(Ea=!1,(ws!==null||xs!==null)&&(Fn(),ws&&(t=ws,e=xs,xs=ws=null,lc(t),e)))for(t=0;t<e.length;t++)lc(e[t])}}function lr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Et]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(I(231,t,typeof i));return i}var ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ma=!1;if(ui)try{var or={};Object.defineProperty(or,"passive",{get:function(){Ma=!0}}),window.addEventListener("test",or,or),window.removeEventListener("test",or,or)}catch{Ma=!1}var Ai=null,Aa=null,tn=null;function cc(){if(tn)return tn;var e,t=Aa,i=t.length,s,f="value"in Ai?Ai.value:Ai.textContent,g=f.length;for(e=0;e<i&&t[e]===f[e];e++);var A=i-e;for(s=1;s<=A&&t[i-s]===f[g-s];s++);return tn=f.slice(e,1<s?1-s:void 0)}function sn(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 rn(){return!0}function hc(){return!1}function Mt(e){function t(i,s,f,g,A){this._reactName=i,this._targetInst=f,this.type=s,this.nativeEvent=g,this.target=A,this.currentTarget=null;for(var H in e)e.hasOwnProperty(H)&&(i=e[H],this[H]=i?i(g):g[H]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?rn:hc,this.isPropagationStopped=hc,this}return a(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=rn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nn=Mt(es),cr=a({},es,{view:0,detail:0}),Df=Mt(cr),Ra,Da,hr,an=a({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ba,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!==hr&&(hr&&e.type==="mousemove"?(Ra=e.screenX-hr.screenX,Da=e.screenY-hr.screenY):Da=Ra=0,hr=e),Ra)},movementY:function(e){return"movementY"in e?e.movementY:Da}}),uc=Mt(an),Tf=a({},an,{dataTransfer:0}),Bf=Mt(Tf),Of=a({},cr,{relatedTarget:0}),Ta=Mt(Of),kf=a({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),Hf=Mt(kf),zf=a({},es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nf=Mt(zf),Uf=a({},es,{data:0}),dc=Mt(Uf),If={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pf={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"},jf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ff(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jf[e])?!!t[e]:!1}function Ba(){return Ff}var $f=a({},cr,{key:function(e){if(e.key){var t=If[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ba,charCode:function(e){return e.type==="keypress"?sn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qf=Mt($f),Wf=a({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fc=Mt(Wf),Gf=a({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ba}),Xf=Mt(Gf),Vf=a({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yf=Mt(Vf),Kf=a({},an,{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}),Qf=Mt(Kf),Zf=a({},es,{newState:0,oldState:0}),Jf=Mt(Zf),e_=[9,13,27,32],Oa=ui&&"CompositionEvent"in window,ur=null;ui&&"documentMode"in document&&(ur=document.documentMode);var t_=ui&&"TextEvent"in window&&!ur,_c=ui&&(!Oa||ur&&8<ur&&11>=ur),vc=" ",gc=!1;function pc(e,t){switch(e){case"keyup":return e_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ls=!1;function i_(e,t){switch(e){case"compositionend":return mc(t);case"keypress":return t.which!==32?null:(gc=!0,vc);case"textInput":return e=t.data,e===vc&&gc?null:e;default:return null}}function s_(e,t){if(Ls)return e==="compositionend"||!Oa&&pc(e,t)?(e=cc(),tn=Aa=Ai=null,Ls=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _c&&t.locale!=="ko"?null:t.data;default:return null}}var r_={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 Sc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!r_[e.type]:t==="textarea"}function Cc(e,t,i,s){ws?xs?xs.push(s):xs=[s]:ws=s,t=Yn(t,"onChange"),0<t.length&&(i=new nn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var dr=null,fr=null;function n_(e){id(e,0)}function ln(e){var t=ar(e);if(tc(t))return e}function yc(e,t){if(e==="change")return t}var bc=!1;if(ui){var ka;if(ui){var Ha="oninput"in document;if(!Ha){var wc=document.createElement("div");wc.setAttribute("oninput","return;"),Ha=typeof wc.oninput=="function"}ka=Ha}else ka=!1;bc=ka&&(!document.documentMode||9<document.documentMode)}function xc(){dr&&(dr.detachEvent("onpropertychange",Lc),fr=dr=null)}function Lc(e){if(e.propertyName==="value"&&ln(fr)){var t=[];Cc(t,fr,e,La(e)),oc(n_,t)}}function a_(e,t,i){e==="focusin"?(xc(),dr=t,fr=i,dr.attachEvent("onpropertychange",Lc)):e==="focusout"&&xc()}function l_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ln(fr)}function o_(e,t){if(e==="click")return ln(t)}function c_(e,t){if(e==="input"||e==="change")return ln(t)}function h_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:h_;function _r(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var f=i[s];if(!Ot.call(t,f)||!kt(e[f],t[f]))return!1}return!0}function Ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mc(e,t){var i=Ec(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ec(i)}}function Ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(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=Jr(e.document)}return t}function za(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 u_=ui&&"documentMode"in document&&11>=document.documentMode,Es=null,Na=null,vr=null,Ua=!1;function Dc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ua||Es==null||Es!==Jr(s)||(s=Es,"selectionStart"in s&&za(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),vr&&_r(vr,s)||(vr=s,s=Yn(Na,"onSelect"),0<s.length&&(t=new nn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Es)))}function ts(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ms={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},Ia={},Tc={};ui&&(Tc=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function is(e){if(Ia[e])return Ia[e];if(!Ms[e])return e;var t=Ms[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Tc)return Ia[e]=t[i];return e}var Bc=is("animationend"),Oc=is("animationiteration"),kc=is("animationstart"),d_=is("transitionrun"),f_=is("transitionstart"),__=is("transitioncancel"),Hc=is("transitionend"),zc=new Map,Pa="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(" ");Pa.push("scrollEnd");function ei(e,t){zc.set(e,t),Ji(t,[e])}var on=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)},qt=[],As=0,ja=0;function cn(){for(var e=As,t=ja=As=0;t<e;){var i=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var f=qt[t];qt[t++]=null;var g=qt[t];if(qt[t++]=null,s!==null&&f!==null){var A=s.pending;A===null?f.next=f:(f.next=A.next,A.next=f),s.pending=f}g!==0&&Nc(i,f,g)}}function hn(e,t,i,s){qt[As++]=e,qt[As++]=t,qt[As++]=i,qt[As++]=s,ja|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Fa(e,t,i,s){return hn(e,t,i,s),un(e)}function ss(e,t){return hn(e,null,null,t),un(e)}function Nc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var f=!1,g=e.return;g!==null;)g.childLanes|=i,s=g.alternate,s!==null&&(s.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(f=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,f&&t!==null&&(f=31-ut(i),e=g.hiddenUpdates,s=e[f],s===null?e[f]=[t]:s.push(t),t.lane=i|536870912),g):null}function un(e){if(50<Nr)throw Nr=0,Ql=null,Error(I(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rs={};function v_(e,t,i,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,i,s){return new v_(e,t,i,s)}function $a(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var i=e.alternate;return i===null?(i=Ht(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 Uc(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 dn(e,t,i,s,f,g){var A=0;if(s=e,typeof e=="function")$a(e)&&(A=1);else if(typeof e=="string")A=Cv(e,i,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case C:return e=Ht(31,i,t,f),e.elementType=C,e.lanes=g,e;case o:return rs(i.children,f,g,t);case r:A=8,f|=24;break;case h:return e=Ht(12,i,t,f|2),e.elementType=h,e.lanes=g,e;case x:return e=Ht(13,i,t,f),e.elementType=x,e.lanes=g,e;case v:return e=Ht(19,i,t,f),e.elementType=v,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l:A=10;break e;case c:A=9;break e;case S:A=11;break e;case y:A=14;break e;case m:A=16,s=null;break e}A=29,i=Error(I(130,e===null?"null":typeof e,"")),s=null}return t=Ht(A,i,t,f),t.elementType=e,t.type=s,t.lanes=g,t}function rs(e,t,i,s){return e=Ht(7,e,s,t),e.lanes=i,e}function qa(e,t,i){return e=Ht(6,e,null,t),e.lanes=i,e}function Ic(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function Wa(e,t,i){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pc=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=Pc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ft(t)},Pc.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var Ds=[],Ts=0,fn=null,gr=0,Gt=[],Xt=0,Ri=null,ni=1,ai="";function fi(e,t){Ds[Ts++]=gr,Ds[Ts++]=fn,fn=e,gr=t}function jc(e,t,i){Gt[Xt++]=ni,Gt[Xt++]=ai,Gt[Xt++]=Ri,Ri=e;var s=ni;e=ai;var f=32-ut(s)-1;s&=~(1<<f),i+=1;var g=32-ut(t)+f;if(30<g){var A=f-f%5;g=(s&(1<<A)-1).toString(32),s>>=A,f-=A,ni=1<<32-ut(t)+f|i<<f|s,ai=g+e}else ni=1<<g|i<<f|s,ai=e}function Ga(e){e.return!==null&&(fi(e,1),jc(e,1,0))}function Xa(e){for(;e===fn;)fn=Ds[--Ts],Ds[Ts]=null,gr=Ds[--Ts],Ds[Ts]=null;for(;e===Ri;)Ri=Gt[--Xt],Gt[Xt]=null,ai=Gt[--Xt],Gt[Xt]=null,ni=Gt[--Xt],Gt[Xt]=null}function Fc(e,t){Gt[Xt++]=ni,Gt[Xt++]=ai,Gt[Xt++]=Ri,ni=t.id,ai=t.overflow,Ri=e}var St=null,Ze=null,Pe=!1,Di=null,Vt=!1,Va=Error(I(519));function Ti(e){var t=Error(I(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(Wt(t,e)),Va}function $c(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[mt]=e,t[Et]=s,i){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(i=0;i<Ir.length;i++)He(Ir[i],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),ic(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),rc(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||ad(t.textContent,i)?(s.popover!=null&&(He("beforetoggle",t),He("toggle",t)),s.onScroll!=null&&He("scroll",t),s.onScrollEnd!=null&&He("scrollend",t),s.onClick!=null&&(t.onclick=hi),t=!0):t=!1,t||Ti(e,!0)}function qc(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:Vt=!1;return;case 27:case 3:Vt=!0;return;default:St=St.return}}function Bs(e){if(e!==St)return!1;if(!Pe)return qc(e),Pe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||fo(e.type,e.memoizedProps)),i=!i),i&&Ze&&Ti(e),qc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));Ze=vd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));Ze=vd(e)}else t===27?(t=Ze,Wi(e.type)?(e=mo,mo=null,Ze=e):Ze=t):Ze=St?Kt(e.stateNode.nextSibling):null;return!0}function ns(){Ze=St=null,Pe=!1}function Ya(){var e=Di;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Di=null),e}function pr(e){Di===null?Di=[e]:Di.push(e)}var Ka=T(null),as=null,_i=null;function Bi(e,t,i){V(Ka,t._currentValue),t._currentValue=i}function vi(e){e._currentValue=Ka.current,k(Ka)}function Qa(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Za(e,t,i,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var g=f.dependencies;if(g!==null){var A=f.child;g=g.firstContext;e:for(;g!==null;){var H=g;g=f;for(var G=0;G<t.length;G++)if(H.context===t[G]){g.lanes|=i,H=g.alternate,H!==null&&(H.lanes|=i),Qa(g.return,i,e),s||(A=null);break e}g=H.next}}else if(f.tag===18){if(A=f.return,A===null)throw Error(I(341));A.lanes|=i,g=A.alternate,g!==null&&(g.lanes|=i),Qa(A,i,e),A=null}else A=f.child;if(A!==null)A.return=f;else for(A=f;A!==null;){if(A===e){A=null;break}if(f=A.sibling,f!==null){f.return=A.return,A=f;break}A=A.return}f=A}}function Os(e,t,i,s){e=null;for(var f=t,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var A=f.alternate;if(A===null)throw Error(I(387));if(A=A.memoizedProps,A!==null){var H=f.type;kt(f.pendingProps.value,A.value)||(e!==null?e.push(H):e=[H])}}else if(f===q.current){if(A=f.alternate,A===null)throw Error(I(387));A.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(qr):e=[qr])}f=f.return}e!==null&&Za(t,e,i,s),t.flags|=262144}function _n(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ls(e){as=e,_i=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Wc(as,e)}function vn(e,t){return as===null&&ls(e),Wc(e,t)}function Wc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},_i===null){if(e===null)throw Error(I(308));_i=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _i=_i.next=t;return i}var g_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},p_=P.unstable_scheduleCallback,m_=P.unstable_NormalPriority,lt={$$typeof:l,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ja(){return{controller:new g_,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&p_(m_,function(){e.controller.abort()})}var Sr=null,el=0,ks=0,Hs=null;function S_(e,t){if(Sr===null){var i=Sr=[];el=0,ks=so(),Hs={status:"pending",value:void 0,then:function(s){i.push(s)}}}return el++,t.then(Gc,Gc),t}function Gc(){if(--el===0&&Sr!==null){Hs!==null&&(Hs.status="fulfilled");var e=Sr;Sr=null,ks=0,Hs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function C_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var f=0;f<i.length;f++)(0,i[f])(t)},function(f){for(s.status="rejected",s.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),s}var Xc=U.S;U.S=function(e,t){Du=ge(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&S_(e,t),Xc!==null&&Xc(e,t)};var os=T(null);function tl(){var e=os.current;return e!==null?e:Ke.pooledCache}function gn(e,t){t===null?V(os,os.current):V(os,t.pool)}function Vc(){var e=tl();return e===null?null:{parent:lt._currentValue,pool:e}}var zs=Error(I(460)),il=Error(I(474)),pn=Error(I(542)),mn={then:function(){}};function Yc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(hi,hi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zc(e),e;default:if(typeof t.status=="string")t.then(hi,hi);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(I(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=s}},function(s){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zc(e),e}throw hs=t,zs}}function cs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(hs=i,zs):i}}var hs=null;function Qc(){if(hs===null)throw Error(I(459));var e=hs;return hs=null,e}function Zc(e){if(e===zs||e===pn)throw Error(I(483))}var Ns=null,Cr=0;function Sn(e){var t=Cr;return Cr+=1,Ns===null&&(Ns=[]),Kc(Ns,e,t)}function yr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cn(e,t){throw t.$$typeof===p?Error(I(525)):(e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jc(e){function t(Z,Y){if(e){var ee=Z.deletions;ee===null?(Z.deletions=[Y],Z.flags|=16):ee.push(Y)}}function i(Z,Y){if(!e)return null;for(;Y!==null;)t(Z,Y),Y=Y.sibling;return null}function s(Z){for(var Y=new Map;Z!==null;)Z.key!==null?Y.set(Z.key,Z):Y.set(Z.index,Z),Z=Z.sibling;return Y}function f(Z,Y){return Z=di(Z,Y),Z.index=0,Z.sibling=null,Z}function g(Z,Y,ee){return Z.index=ee,e?(ee=Z.alternate,ee!==null?(ee=ee.index,ee<Y?(Z.flags|=67108866,Y):ee):(Z.flags|=67108866,Y)):(Z.flags|=1048576,Y)}function A(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function H(Z,Y,ee,ce){return Y===null||Y.tag!==6?(Y=qa(ee,Z.mode,ce),Y.return=Z,Y):(Y=f(Y,ee),Y.return=Z,Y)}function G(Z,Y,ee,ce){var xe=ee.type;return xe===o?oe(Z,Y,ee.props.children,ce,ee.key):Y!==null&&(Y.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===Y.type)?(Y=f(Y,ee.props),yr(Y,ee),Y.return=Z,Y):(Y=dn(ee.type,ee.key,ee.props,null,Z.mode,ce),yr(Y,ee),Y.return=Z,Y)}function te(Z,Y,ee,ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=Wa(ee,Z.mode,ce),Y.return=Z,Y):(Y=f(Y,ee.children||[]),Y.return=Z,Y)}function oe(Z,Y,ee,ce,xe){return Y===null||Y.tag!==7?(Y=rs(ee,Z.mode,ce,xe),Y.return=Z,Y):(Y=f(Y,ee),Y.return=Z,Y)}function de(Z,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=qa(""+Y,Z.mode,ee),Y.return=Z,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return ee=dn(Y.type,Y.key,Y.props,null,Z.mode,ee),yr(ee,Y),ee.return=Z,ee;case b:return Y=Wa(Y,Z.mode,ee),Y.return=Z,Y;case m:return Y=cs(Y),de(Z,Y,ee)}if($(Y)||E(Y))return Y=rs(Y,Z.mode,ee,null),Y.return=Z,Y;if(typeof Y.then=="function")return de(Z,Sn(Y),ee);if(Y.$$typeof===l)return de(Z,vn(Z,Y),ee);Cn(Z,Y)}return null}function ne(Z,Y,ee,ce){var xe=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return xe!==null?null:H(Z,Y,""+ee,ce);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return ee.key===xe?G(Z,Y,ee,ce):null;case b:return ee.key===xe?te(Z,Y,ee,ce):null;case m:return ee=cs(ee),ne(Z,Y,ee,ce)}if($(ee)||E(ee))return xe!==null?null:oe(Z,Y,ee,ce,null);if(typeof ee.then=="function")return ne(Z,Y,Sn(ee),ce);if(ee.$$typeof===l)return ne(Z,Y,vn(Z,ee),ce);Cn(Z,ee)}return null}function ae(Z,Y,ee,ce,xe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(ee)||null,H(Y,Z,""+ce,xe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case w:return Z=Z.get(ce.key===null?ee:ce.key)||null,G(Y,Z,ce,xe);case b:return Z=Z.get(ce.key===null?ee:ce.key)||null,te(Y,Z,ce,xe);case m:return ce=cs(ce),ae(Z,Y,ee,ce,xe)}if($(ce)||E(ce))return Z=Z.get(ee)||null,oe(Y,Z,ce,xe,null);if(typeof ce.then=="function")return ae(Z,Y,ee,Sn(ce),xe);if(ce.$$typeof===l)return ae(Z,Y,ee,vn(Y,ce),xe);Cn(Y,ce)}return null}function Ce(Z,Y,ee,ce){for(var xe=null,je=null,ye=Y,Be=Y=0,Ue=null;ye!==null&&Be<ee.length;Be++){ye.index>Be?(Ue=ye,ye=null):Ue=ye.sibling;var Fe=ne(Z,ye,ee[Be],ce);if(Fe===null){ye===null&&(ye=Ue);break}e&&ye&&Fe.alternate===null&&t(Z,ye),Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe,ye=Ue}if(Be===ee.length)return i(Z,ye),Pe&&fi(Z,Be),xe;if(ye===null){for(;Be<ee.length;Be++)ye=de(Z,ee[Be],ce),ye!==null&&(Y=g(ye,Y,Be),je===null?xe=ye:je.sibling=ye,je=ye);return Pe&&fi(Z,Be),xe}for(ye=s(ye);Be<ee.length;Be++)Ue=ae(ye,Z,Be,ee[Be],ce),Ue!==null&&(e&&Ue.alternate!==null&&ye.delete(Ue.key===null?Be:Ue.key),Y=g(Ue,Y,Be),je===null?xe=Ue:je.sibling=Ue,je=Ue);return e&&ye.forEach(function(Ki){return t(Z,Ki)}),Pe&&fi(Z,Be),xe}function Ee(Z,Y,ee,ce){if(ee==null)throw Error(I(151));for(var xe=null,je=null,ye=Y,Be=Y=0,Ue=null,Fe=ee.next();ye!==null&&!Fe.done;Be++,Fe=ee.next()){ye.index>Be?(Ue=ye,ye=null):Ue=ye.sibling;var Ki=ne(Z,ye,Fe.value,ce);if(Ki===null){ye===null&&(ye=Ue);break}e&&ye&&Ki.alternate===null&&t(Z,ye),Y=g(Ki,Y,Be),je===null?xe=Ki:je.sibling=Ki,je=Ki,ye=Ue}if(Fe.done)return i(Z,ye),Pe&&fi(Z,Be),xe;if(ye===null){for(;!Fe.done;Be++,Fe=ee.next())Fe=de(Z,Fe.value,ce),Fe!==null&&(Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe);return Pe&&fi(Z,Be),xe}for(ye=s(ye);!Fe.done;Be++,Fe=ee.next())Fe=ae(ye,Z,Be,Fe.value,ce),Fe!==null&&(e&&Fe.alternate!==null&&ye.delete(Fe.key===null?Be:Fe.key),Y=g(Fe,Y,Be),je===null?xe=Fe:je.sibling=Fe,je=Fe);return e&&ye.forEach(function(Tv){return t(Z,Tv)}),Pe&&fi(Z,Be),xe}function Ye(Z,Y,ee,ce){if(typeof ee=="object"&&ee!==null&&ee.type===o&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:e:{for(var xe=ee.key;Y!==null;){if(Y.key===xe){if(xe=ee.type,xe===o){if(Y.tag===7){i(Z,Y.sibling),ce=f(Y,ee.props.children),ce.return=Z,Z=ce;break e}}else if(Y.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===Y.type){i(Z,Y.sibling),ce=f(Y,ee.props),yr(ce,ee),ce.return=Z,Z=ce;break e}i(Z,Y);break}else t(Z,Y);Y=Y.sibling}ee.type===o?(ce=rs(ee.props.children,Z.mode,ce,ee.key),ce.return=Z,Z=ce):(ce=dn(ee.type,ee.key,ee.props,null,Z.mode,ce),yr(ce,ee),ce.return=Z,Z=ce)}return A(Z);case b:e:{for(xe=ee.key;Y!==null;){if(Y.key===xe)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){i(Z,Y.sibling),ce=f(Y,ee.children||[]),ce.return=Z,Z=ce;break e}else{i(Z,Y);break}else t(Z,Y);Y=Y.sibling}ce=Wa(ee,Z.mode,ce),ce.return=Z,Z=ce}return A(Z);case m:return ee=cs(ee),Ye(Z,Y,ee,ce)}if($(ee))return Ce(Z,Y,ee,ce);if(E(ee)){if(xe=E(ee),typeof xe!="function")throw Error(I(150));return ee=xe.call(ee),Ee(Z,Y,ee,ce)}if(typeof ee.then=="function")return Ye(Z,Y,Sn(ee),ce);if(ee.$$typeof===l)return Ye(Z,Y,vn(Z,ee),ce);Cn(Z,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(i(Z,Y.sibling),ce=f(Y,ee),ce.return=Z,Z=ce):(i(Z,Y),ce=qa(ee,Z.mode,ce),ce.return=Z,Z=ce),A(Z)):i(Z,Y)}return function(Z,Y,ee,ce){try{Cr=0;var xe=Ye(Z,Y,ee,ce);return Ns=null,xe}catch(ye){if(ye===zs||ye===pn)throw ye;var je=Ht(29,ye,null,Z.mode);return je.lanes=ce,je.return=Z,je}finally{}}}var us=Jc(!0),eh=Jc(!1),Oi=!1;function sl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rl(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ki(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,($e&2)!==0){var f=s.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),s.pending=t,t=un(e),Nc(e,null,i),t}return hn(e,s,t,i),un(e)}function br(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Wo(e,i)}}function nl(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var f=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var A={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?f=g=A:g=g.next=A,i=i.next}while(i!==null);g===null?f=g=t:g=g.next=t}else f=g=t;i={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var al=!1;function wr(){if(al){var e=Hs;if(e!==null)throw e}}function xr(e,t,i,s){al=!1;var f=e.updateQueue;Oi=!1;var g=f.firstBaseUpdate,A=f.lastBaseUpdate,H=f.shared.pending;if(H!==null){f.shared.pending=null;var G=H,te=G.next;G.next=null,A===null?g=te:A.next=te,A=G;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,H=oe.lastBaseUpdate,H!==A&&(H===null?oe.firstBaseUpdate=te:H.next=te,oe.lastBaseUpdate=G))}if(g!==null){var de=f.baseState;A=0,oe=te=G=null,H=g;do{var ne=H.lane&-536870913,ae=ne!==H.lane;if(ae?(Ne&ne)===ne:(s&ne)===ne){ne!==0&&ne===ks&&(al=!0),oe!==null&&(oe=oe.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ce=e,Ee=H;ne=t;var Ye=i;switch(Ee.tag){case 1:if(Ce=Ee.payload,typeof Ce=="function"){de=Ce.call(Ye,de,ne);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ee.payload,ne=typeof Ce=="function"?Ce.call(Ye,de,ne):Ce,ne==null)break e;de=a({},de,ne);break e;case 2:Oi=!0}}ne=H.callback,ne!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:H.tag,payload:H.payload,callback:H.callback,next:null},oe===null?(te=oe=ae,G=de):oe=oe.next=ae,A|=ne;if(H=H.next,H===null){if(H=f.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);oe===null&&(G=de),f.baseState=G,f.firstBaseUpdate=te,f.lastBaseUpdate=oe,g===null&&(f.shared.lanes=0),Pi|=A,e.lanes=A,e.memoizedState=de}}function th(e,t){if(typeof e!="function")throw Error(I(191,e));e.call(t)}function ih(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)th(i[e],t)}var Us=T(null),yn=T(0);function sh(e,t){e=xi,V(yn,e),V(Us,t),xi=e|t.baseLanes}function ll(){V(yn,xi),V(Us,Us.current)}function ol(){xi=yn.current,k(Us),k(yn)}var zt=T(null),Yt=null;function zi(e){var t=e.alternate;V(nt,nt.current&1),V(zt,e),Yt===null&&(t===null||Us.current!==null||t.memoizedState!==null)&&(Yt=e)}function cl(e){V(nt,nt.current),V(zt,e),Yt===null&&(Yt=e)}function rh(e){e.tag===22?(V(nt,nt.current),V(zt,e),Yt===null&&(Yt=e)):Ni()}function Ni(){V(nt,nt.current),V(zt,zt.current)}function Nt(e){k(zt),Yt===e&&(Yt=null),k(nt)}var nt=T(0);function bn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||go(i)||po(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 gi=0,Te=null,Xe=null,ot=null,wn=!1,Is=!1,ds=!1,xn=0,Lr=0,Ps=null,y_=0;function st(){throw Error(I(321))}function hl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!kt(e[i],t[i]))return!1;return!0}function ul(e,t,i,s,f,g){return gi=g,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?jh:El,ds=!1,g=i(s,f),ds=!1,Is&&(g=ah(t,i,s,f)),nh(e),g}function nh(e){U.H=Ar;var t=Xe!==null&&Xe.next!==null;if(gi=0,ot=Xe=Te=null,wn=!1,Lr=0,Ps=null,t)throw Error(I(300));e===null||ct||(e=e.dependencies,e!==null&&_n(e)&&(ct=!0))}function ah(e,t,i,s){Te=e;var f=0;do{if(Is&&(Ps=null),Lr=0,Is=!1,25<=f)throw Error(I(301));if(f+=1,ot=Xe=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}U.H=Fh,g=t(i,s)}while(Is);return g}function b_(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Er(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),t}function dl(){var e=xn!==0;return xn=0,e}function fl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function _l(e){if(wn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wn=!1}gi=0,ot=Xe=Te=null,Is=!1,Lr=xn=0,Ps=null}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Te.memoizedState=ot=e:ot=ot.next=e,ot}function at(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=ot===null?Te.memoizedState:ot.next;if(t!==null)ot=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(I(467)):Error(I(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ot===null?Te.memoizedState=ot=e:ot=ot.next=e}return ot}function Ln(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Er(e){var t=Lr;return Lr+=1,Ps===null&&(Ps=[]),e=Kc(Ps,e,t),t=Te,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?jh:El),e}function En(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Er(e);if(e.$$typeof===l)return Ct(e)}throw Error(I(438,String(e)))}function vl(e){var t=null,i=Te.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Ln(),Te.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=L;return t.index++,i}function pi(e,t){return typeof t=="function"?t(e):t}function Mn(e){var t=at();return gl(t,Xe,e)}function gl(e,t,i){var s=e.queue;if(s===null)throw Error(I(311));s.lastRenderedReducer=i;var f=e.baseQueue,g=s.pending;if(g!==null){if(f!==null){var A=f.next;f.next=g.next,g.next=A}t.baseQueue=f=g,s.pending=null}if(g=e.baseState,f===null)e.memoizedState=g;else{t=f.next;var H=A=null,G=null,te=t,oe=!1;do{var de=te.lane&-536870913;if(de!==te.lane?(Ne&de)===de:(gi&de)===de){var ne=te.revertLane;if(ne===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),de===ks&&(oe=!0);else if((gi&ne)===ne){te=te.next,ne===ks&&(oe=!0);continue}else de={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},G===null?(H=G=de,A=g):G=G.next=de,Te.lanes|=ne,Pi|=ne;de=te.action,ds&&i(g,de),g=te.hasEagerState?te.eagerState:i(g,de)}else ne={lane:de,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},G===null?(H=G=ne,A=g):G=G.next=ne,Te.lanes|=de,Pi|=de;te=te.next}while(te!==null&&te!==t);if(G===null?A=g:G.next=H,!kt(g,e.memoizedState)&&(ct=!0,oe&&(i=Hs,i!==null)))throw i;e.memoizedState=g,e.baseState=A,e.baseQueue=G,s.lastRenderedState=g}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function pl(e){var t=at(),i=t.queue;if(i===null)throw Error(I(311));i.lastRenderedReducer=e;var s=i.dispatch,f=i.pending,g=t.memoizedState;if(f!==null){i.pending=null;var A=f=f.next;do g=e(g,A.action),A=A.next;while(A!==f);kt(g,t.memoizedState)||(ct=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),i.lastRenderedState=g}return[g,s]}function lh(e,t,i){var s=Te,f=at(),g=Pe;if(g){if(i===void 0)throw Error(I(407));i=i()}else i=t();var A=!kt((Xe||f).memoizedState,i);if(A&&(f.memoizedState=i,ct=!0),f=f.queue,Cl(hh.bind(null,s,f,e),[e]),f.getSnapshot!==t||A||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,js(9,{destroy:void 0},ch.bind(null,s,f,i,t),null),Ke===null)throw Error(I(349));g||(gi&127)!==0||oh(s,t,i)}return i}function oh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Te.updateQueue,t===null?(t=Ln(),Te.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ch(e,t,i,s){t.value=i,t.getSnapshot=s,uh(t)&&dh(e)}function hh(e,t,i){return i(function(){uh(t)&&dh(e)})}function uh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function dh(e){var t=ss(e,2);t!==null&&Bt(t,e,2)}function ml(e){var t=Lt();if(typeof e=="function"){var i=e;if(e=i(),ds){vt(!0);try{i()}finally{vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},t}function fh(e,t,i,s){return e.baseState=i,gl(e,Xe,typeof s=="function"?s:pi)}function w_(e,t,i,s,f){if(Dn(e))throw Error(I(485));if(e=t.action,e!==null){var g={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){g.listeners.push(A)}};U.T!==null?i(!0):g.isTransition=!1,s(g),i=t.pending,i===null?(g.next=t.pending=g,_h(t,g)):(g.next=i.next,t.pending=i.next=g)}}function _h(e,t){var i=t.action,s=t.payload,f=e.state;if(t.isTransition){var g=U.T,A={};U.T=A;try{var H=i(f,s),G=U.S;G!==null&&G(A,H),vh(e,t,H)}catch(te){Sl(e,t,te)}finally{g!==null&&A.types!==null&&(g.types=A.types),U.T=g}}else try{g=i(f,s),vh(e,t,g)}catch(te){Sl(e,t,te)}}function vh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){gh(e,t,s)},function(s){return Sl(e,t,s)}):gh(e,t,i)}function gh(e,t,i){t.status="fulfilled",t.value=i,ph(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,_h(e,i)))}function Sl(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,ph(t),t=t.next;while(t!==s)}e.action=null}function ph(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mh(e,t){return t}function Sh(e,t){if(Pe){var i=Ke.formState;if(i!==null){e:{var s=Te;if(Pe){if(Ze){t:{for(var f=Ze,g=Vt;f.nodeType!==8;){if(!g){f=null;break t}if(f=Kt(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Ze=Kt(f.nextSibling),s=f.data==="F!";break e}}Ti(s)}s=!1}s&&(t=i[0])}}return i=Lt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mh,lastRenderedState:t},i.queue=s,i=Uh.bind(null,Te,s),s.dispatch=i,s=ml(!1),g=Ll.bind(null,Te,!1,s.queue),s=Lt(),f={state:t,dispatch:null,action:e,pending:null},s.queue=f,i=w_.bind(null,Te,f,g,i),f.dispatch=i,s.memoizedState=e,[t,i,!1]}function Ch(e){var t=at();return yh(t,Xe,e)}function yh(e,t,i){if(t=gl(e,t,mh)[0],e=Mn(pi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Er(t)}catch(A){throw A===zs?pn:A}else s=t;t=at();var f=t.queue,g=f.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,js(9,{destroy:void 0},x_.bind(null,f,i),null)),[s,g,e]}function x_(e,t){e.action=t}function bh(e){var t=at(),i=Xe;if(i!==null)return yh(t,i,e);at(),t=t.memoizedState,i=at();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function js(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Ln(),Te.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function wh(){return at().memoizedState}function An(e,t,i,s){var f=Lt();Te.flags|=e,f.memoizedState=js(1|t,{destroy:void 0},i,s===void 0?null:s)}function Rn(e,t,i,s){var f=at();s=s===void 0?null:s;var g=f.memoizedState.inst;Xe!==null&&s!==null&&hl(s,Xe.memoizedState.deps)?f.memoizedState=js(t,g,i,s):(Te.flags|=e,f.memoizedState=js(1|t,g,i,s))}function xh(e,t){An(8390656,8,e,t)}function Cl(e,t){Rn(2048,8,e,t)}function L_(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Ln(),Te.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Lh(e){var t=at().memoizedState;return L_({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(I(440));return t.impl.apply(void 0,arguments)}}function Eh(e,t){return Rn(4,2,e,t)}function Mh(e,t){return Rn(4,4,e,t)}function Ah(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 Rh(e,t,i){i=i!=null?i.concat([e]):null,Rn(4,4,Ah.bind(null,t,e),i)}function yl(){}function Dh(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&hl(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Th(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&hl(t,s[1]))return s[0];if(s=e(),ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s}function bl(e,t,i){return i===void 0||(gi&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Bu(),Te.lanes|=e,Pi|=e,i)}function Bh(e,t,i,s){return kt(i,t)?i:Us.current!==null?(e=bl(e,i,s),kt(e,t)||(ct=!0),e):(gi&42)===0||(gi&1073741824)!==0&&(Ne&261930)===0?(ct=!0,e.memoizedState=i):(e=Bu(),Te.lanes|=e,Pi|=e,t)}function Oh(e,t,i,s,f){var g=j.p;j.p=g!==0&&8>g?g:8;var A=U.T,H={};U.T=H,Ll(e,!1,t,i);try{var G=f(),te=U.S;if(te!==null&&te(H,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var oe=C_(G,s);Mr(e,t,oe,Pt(e))}else Mr(e,t,s,Pt(e))}catch(de){Mr(e,t,{then:function(){},status:"rejected",reason:de},Pt())}finally{j.p=g,A!==null&&H.types!==null&&(A.types=H.types),U.T=A}}function E_(){}function wl(e,t,i,s){if(e.tag!==5)throw Error(I(476));var f=kh(e).queue;Oh(e,f,t,z,i===null?E_:function(){return Hh(e),i(s)})}function kh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:z},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hh(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Mr(e,t.next.queue,{},Pt())}function xl(){return Ct(qr)}function zh(){return at().memoizedState}function Nh(){return at().memoizedState}function M_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Pt();e=ki(i);var s=Hi(t,e,i);s!==null&&(Bt(s,t,i),br(s,t,i)),t={cache:Ja()},e.payload=t;return}t=t.return}}function A_(e,t,i){var s=Pt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dn(e)?Ih(t,i):(i=Fa(e,t,i,s),i!==null&&(Bt(i,e,s),Ph(i,t,s)))}function Uh(e,t,i){var s=Pt();Mr(e,t,i,s)}function Mr(e,t,i,s){var f={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Dn(e))Ih(t,f);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var A=t.lastRenderedState,H=g(A,i);if(f.hasEagerState=!0,f.eagerState=H,kt(H,A))return hn(e,t,f,0),Ke===null&&cn(),!1}catch{}finally{}if(i=Fa(e,t,f,s),i!==null)return Bt(i,e,s),Ph(i,t,s),!0}return!1}function Ll(e,t,i,s){if(s={lane:2,revertLane:so(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dn(e)){if(t)throw Error(I(479))}else t=Fa(e,i,s,2),t!==null&&Bt(t,e,2)}function Dn(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Ih(e,t){Is=wn=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ph(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Wo(e,i)}}var Ar={readContext:Ct,use:En,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};Ar.useEffectEvent=st;var jh={readContext:Ct,use:En,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:xh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,An(4194308,4,Ah.bind(null,t,e),i)},useLayoutEffect:function(e,t){return An(4194308,4,e,t)},useInsertionEffect:function(e,t){An(4,2,e,t)},useMemo:function(e,t){var i=Lt();t=t===void 0?null:t;var s=e();if(ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Lt();if(i!==void 0){var f=i(t);if(ds){vt(!0);try{i(t)}finally{vt(!1)}}}else f=t;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=A_.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=ml(e);var t=e.queue,i=Uh.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:yl,useDeferredValue:function(e,t){var i=Lt();return bl(i,e,t)},useTransition:function(){var e=ml(!1);return e=Oh.bind(null,Te,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Te,f=Lt();if(Pe){if(i===void 0)throw Error(I(407));i=i()}else{if(i=t(),Ke===null)throw Error(I(349));(Ne&127)!==0||oh(s,t,i)}f.memoizedState=i;var g={value:i,getSnapshot:t};return f.queue=g,xh(hh.bind(null,s,g,e),[e]),s.flags|=2048,js(9,{destroy:void 0},ch.bind(null,s,g,i,t),null),i},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Pe){var i=ai,s=ni;i=(s&~(1<<32-ut(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=xn++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=y_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xl,useFormState:Sh,useActionState:Sh,useOptimistic:function(e){var t=Lt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ll.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:vl,useCacheRefresh:function(){return Lt().memoizedState=M_.bind(null,Te)},useEffectEvent:function(e){var t=Lt(),i={impl:e};return t.memoizedState=i,function(){if(($e&2)!==0)throw Error(I(440));return i.impl.apply(void 0,arguments)}}},El={readContext:Ct,use:En,useCallback:Dh,useContext:Ct,useEffect:Cl,useImperativeHandle:Rh,useInsertionEffect:Eh,useLayoutEffect:Mh,useMemo:Th,useReducer:Mn,useRef:wh,useState:function(){return Mn(pi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=at();return Bh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Mn(pi)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:lh,useId:zh,useHostTransitionStatus:xl,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var i=at();return fh(i,Xe,e,t)},useMemoCache:vl,useCacheRefresh:Nh};El.useEffectEvent=Lh;var Fh={readContext:Ct,use:En,useCallback:Dh,useContext:Ct,useEffect:Cl,useImperativeHandle:Rh,useInsertionEffect:Eh,useLayoutEffect:Mh,useMemo:Th,useReducer:pl,useRef:wh,useState:function(){return pl(pi)},useDebugValue:yl,useDeferredValue:function(e,t){var i=at();return Xe===null?bl(i,e,t):Bh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=pl(pi)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:lh,useId:zh,useHostTransitionStatus:xl,useFormState:bh,useActionState:bh,useOptimistic:function(e,t){var i=at();return Xe!==null?fh(i,Xe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:vl,useCacheRefresh:Nh};Fh.useEffectEvent=Lh;function Ml(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:a({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Al={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=ki(s);f.payload=t,i!=null&&(f.callback=i),t=Hi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=ki(s);f.tag=1,f.payload=t,i!=null&&(f.callback=i),t=Hi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Pt(),s=ki(i);s.tag=2,t!=null&&(s.callback=t),t=Hi(e,s,i),t!==null&&(Bt(t,e,i),br(t,e,i))}};function $h(e,t,i,s,f,g,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,g,A):t.prototype&&t.prototype.isPureReactComponent?!_r(i,s)||!_r(f,g):!0}function qh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Al.enqueueReplaceState(t,t.state,null)}function fs(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=a({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function Wh(e){on(e)}function Gh(e){console.error(e)}function Xh(e){on(e)}function Tn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Vh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Rl(e,t,i){return i=ki(i),i.tag=3,i.payload={element:null},i.callback=function(){Tn(e,t)},i}function Yh(e){return e=ki(e),e.tag=3,e}function Kh(e,t,i,s){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=s.value;e.payload=function(){return f(g)},e.callback=function(){Vh(t,i,s)}}var A=i.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){Vh(t,i,s),typeof f!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var H=s.stack;this.componentDidCatch(s.value,{componentStack:H!==null?H:""})})}function R_(e,t,i,s,f){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,f,!0),i=zt.current,i!==null){switch(i.tag){case 31:case 13:return Yt===null?$n():i.alternate===null&&rt===0&&(rt=3),i.flags&=-257,i.flags|=65536,i.lanes=f,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),eo(e,s,f)),!1;case 22:return i.flags|=65536,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),eo(e,s,f)),!1}throw Error(I(435,i.tag))}return eo(e,s,f),$n(),!1}if(Pe)return t=zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,s!==Va&&(e=Error(I(422),{cause:s}),pr(Wt(e,i)))):(s!==Va&&(t=Error(I(423),{cause:s}),pr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Wt(s,i),f=Rl(e.stateNode,s,f),nl(e,f),rt!==4&&(rt=2)),!1;var g=Error(I(520),{cause:s});if(g=Wt(g,i),zr===null?zr=[g]:zr.push(g),rt!==4&&(rt=2),t===null)return!0;s=Wt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Rl(i.stateNode,s,e),nl(i,e),!1;case 1:if(t=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ji===null||!ji.has(g))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Yh(f),Kh(f,e,i,s),nl(i,f),!1}i=i.return}while(i!==null);return!1}var Dl=Error(I(461)),ct=!1;function yt(e,t,i,s){t.child=e===null?eh(t,null,i,s):us(t,e.child,i,s)}function Qh(e,t,i,s,f){i=i.render;var g=t.ref;if("ref"in s){var A={};for(var H in s)H!=="ref"&&(A[H]=s[H])}else A=s;return ls(t),s=ul(e,t,i,A,g,f),H=dl(),e!==null&&!ct?(fl(e,t,f),mi(e,t,f)):(Pe&&H&&Ga(t),t.flags|=1,yt(e,t,s,f),t.child)}function Zh(e,t,i,s,f){if(e===null){var g=i.type;return typeof g=="function"&&!$a(g)&&g.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=g,Jh(e,t,g,s,f)):(e=dn(i.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Ul(e,f)){var A=g.memoizedProps;if(i=i.compare,i=i!==null?i:_r,i(A,s)&&e.ref===t.ref)return mi(e,t,f)}return t.flags|=1,e=di(g,s),e.ref=t.ref,e.return=t,t.child=e}function Jh(e,t,i,s,f){if(e!==null){var g=e.memoizedProps;if(_r(g,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=g,Ul(e,f))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,mi(e,t,f)}return Tl(e,t,i,s,f)}function eu(e,t,i,s){var f=s.children,g=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(g=g!==null?g.baseLanes|i:i,e!==null){for(s=t.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~g}else s=0,t.child=null;return tu(e,t,g,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gn(t,g!==null?g.cachePool:null),g!==null?sh(t,g):ll(),rh(t);else return s=t.lanes=536870912,tu(e,t,g!==null?g.baseLanes|i:i,i,s)}else g!==null?(gn(t,g.cachePool),sh(t,g),Ni(),t.memoizedState=null):(e!==null&&gn(t,null),ll(),Ni());return yt(e,t,f,i),t.child}function Rr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function tu(e,t,i,s,f){var g=tl();return g=g===null?null:{parent:lt._currentValue,pool:g},t.memoizedState={baseLanes:i,cachePool:g},e!==null&&gn(t,null),ll(),rh(t),e!==null&&Os(e,t,s,!0),t.childLanes=f,null}function Bn(e,t){return t=kn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function iu(e,t,i){return us(t,e.child,null,i),e=Bn(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function D_(e,t,i){var s=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Pe){if(s.mode==="hidden")return e=Bn(t,s),t.lanes=536870912,Rr(null,e);if(cl(t),(e=Ze)?(e=_d(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Ti(t);return t.lanes=536870912,null}return Bn(t,s)}var g=e.memoizedState;if(g!==null){var A=g.dehydrated;if(cl(t),f)if(t.flags&256)t.flags&=-257,t=iu(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(I(558));else if(ct||Os(e,t,i,!1),f=(i&e.childLanes)!==0,ct||f){if(s=Ke,s!==null&&(A=Go(s,i),A!==0&&A!==g.retryLane))throw g.retryLane=A,ss(e,A),Bt(s,e,A),Dl;$n(),t=iu(e,t,i)}else e=g.treeContext,Ze=Kt(A.nextSibling),St=t,Pe=!0,Di=null,Vt=!1,e!==null&&Fc(t,e),t=Bn(t,s),t.flags|=4096;return t}return e=di(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function On(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(I(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Tl(e,t,i,s,f){return ls(t),i=ul(e,t,i,s,void 0,f),s=dl(),e!==null&&!ct?(fl(e,t,f),mi(e,t,f)):(Pe&&s&&Ga(t),t.flags|=1,yt(e,t,i,f),t.child)}function su(e,t,i,s,f,g){return ls(t),t.updateQueue=null,i=ah(t,s,i,f),nh(e),s=dl(),e!==null&&!ct?(fl(e,t,g),mi(e,t,g)):(Pe&&s&&Ga(t),t.flags|=1,yt(e,t,i,g),t.child)}function ru(e,t,i,s,f){if(ls(t),t.stateNode===null){var g=Rs,A=i.contextType;typeof A=="object"&&A!==null&&(g=Ct(A)),g=new i(s,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Al,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=s,g.state=t.memoizedState,g.refs={},sl(t),A=i.contextType,g.context=typeof A=="object"&&A!==null?Ct(A):Rs,g.state=t.memoizedState,A=i.getDerivedStateFromProps,typeof A=="function"&&(Ml(t,i,A,s),g.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(A=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),A!==g.state&&Al.enqueueReplaceState(g,g.state,null),xr(t,s,g,f),wr(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){g=t.stateNode;var H=t.memoizedProps,G=fs(i,H);g.props=G;var te=g.context,oe=i.contextType;A=Rs,typeof oe=="object"&&oe!==null&&(A=Ct(oe));var de=i.getDerivedStateFromProps;oe=typeof de=="function"||typeof g.getSnapshotBeforeUpdate=="function",H=t.pendingProps!==H,oe||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(H||te!==A)&&qh(t,g,s,A),Oi=!1;var ne=t.memoizedState;g.state=ne,xr(t,s,g,f),wr(),te=t.memoizedState,H||ne!==te||Oi?(typeof de=="function"&&(Ml(t,i,de,s),te=t.memoizedState),(G=Oi||$h(t,i,G,s,ne,te,A))?(oe||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=te),g.props=s,g.state=te,g.context=A,s=G):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{g=t.stateNode,rl(e,t),A=t.memoizedProps,oe=fs(i,A),g.props=oe,de=t.pendingProps,ne=g.context,te=i.contextType,G=Rs,typeof te=="object"&&te!==null&&(G=Ct(te)),H=i.getDerivedStateFromProps,(te=typeof H=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(A!==de||ne!==G)&&qh(t,g,s,G),Oi=!1,ne=t.memoizedState,g.state=ne,xr(t,s,g,f),wr();var ae=t.memoizedState;A!==de||ne!==ae||Oi||e!==null&&e.dependencies!==null&&_n(e.dependencies)?(typeof H=="function"&&(Ml(t,i,H,s),ae=t.memoizedState),(oe=Oi||$h(t,i,oe,s,ne,ae,G)||e!==null&&e.dependencies!==null&&_n(e.dependencies))?(te||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,ae,G),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,ae,G)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||A===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ae),g.props=s,g.state=ae,g.context=G,s=oe):(typeof g.componentDidUpdate!="function"||A===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),s=!1)}return g=s,On(e,t),s=(t.flags&128)!==0,g||s?(g=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&s?(t.child=us(t,e.child,null,f),t.child=us(t,null,i,f)):yt(e,t,i,f),t.memoizedState=g.state,e=t.child):e=mi(e,t,f),e}function nu(e,t,i,s){return ns(),t.flags|=256,yt(e,t,i,s),t.child}var Bl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ol(e){return{baseLanes:e,cachePool:Vc()}}function kl(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=It),e}function au(e,t,i){var s=t.pendingProps,f=!1,g=(t.flags&128)!==0,A;if((A=g)||(A=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),A&&(f=!0,t.flags&=-129),A=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(f?zi(t):Ni(),(e=Ze)?(e=_d(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Ic(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Ti(t);return po(e)?t.lanes=32:t.lanes=536870912,null}var H=s.children;return s=s.fallback,f?(Ni(),f=t.mode,H=kn({mode:"hidden",children:H},f),s=rs(s,f,i,null),H.return=t,s.return=t,H.sibling=s,t.child=H,s=t.child,s.memoizedState=Ol(i),s.childLanes=kl(e,A,i),t.memoizedState=Bl,Rr(null,s)):(zi(t),Hl(t,H))}var G=e.memoizedState;if(G!==null&&(H=G.dehydrated,H!==null)){if(g)t.flags&256?(zi(t),t.flags&=-257,t=zl(e,t,i)):t.memoizedState!==null?(Ni(),t.child=e.child,t.flags|=128,t=null):(Ni(),H=s.fallback,f=t.mode,s=kn({mode:"visible",children:s.children},f),H=rs(H,f,i,null),H.flags|=2,s.return=t,H.return=t,s.sibling=H,t.child=s,us(t,e.child,null,i),s=t.child,s.memoizedState=Ol(i),s.childLanes=kl(e,A,i),t.memoizedState=Bl,t=Rr(null,s));else if(zi(t),po(H)){if(A=H.nextSibling&&H.nextSibling.dataset,A)var te=A.dgst;A=te,s=Error(I(419)),s.stack="",s.digest=A,pr({value:s,source:null,stack:null}),t=zl(e,t,i)}else if(ct||Os(e,t,i,!1),A=(i&e.childLanes)!==0,ct||A){if(A=Ke,A!==null&&(s=Go(A,i),s!==0&&s!==G.retryLane))throw G.retryLane=s,ss(e,s),Bt(A,e,s),Dl;go(H)||$n(),t=zl(e,t,i)}else go(H)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,Ze=Kt(H.nextSibling),St=t,Pe=!0,Di=null,Vt=!1,e!==null&&Fc(t,e),t=Hl(t,s.children),t.flags|=4096);return t}return f?(Ni(),H=s.fallback,f=t.mode,G=e.child,te=G.sibling,s=di(G,{mode:"hidden",children:s.children}),s.subtreeFlags=G.subtreeFlags&65011712,te!==null?H=di(te,H):(H=rs(H,f,i,null),H.flags|=2),H.return=t,s.return=t,s.sibling=H,t.child=s,Rr(null,s),s=t.child,H=e.child.memoizedState,H===null?H=Ol(i):(f=H.cachePool,f!==null?(G=lt._currentValue,f=f.parent!==G?{parent:G,pool:G}:f):f=Vc(),H={baseLanes:H.baseLanes|i,cachePool:f}),s.memoizedState=H,s.childLanes=kl(e,A,i),t.memoizedState=Bl,Rr(e.child,s)):(zi(t),i=e.child,e=i.sibling,i=di(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(A=t.deletions,A===null?(t.deletions=[e],t.flags|=16):A.push(e)),t.child=i,t.memoizedState=null,i)}function Hl(e,t){return t=kn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kn(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function zl(e,t,i){return us(t,e.child,null,i),e=Hl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lu(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Qa(e.return,t,i)}function Nl(e,t,i,s,f,g){var A=e.memoizedState;A===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:f,treeForkCount:g}:(A.isBackwards=t,A.rendering=null,A.renderingStartTime=0,A.last=s,A.tail=i,A.tailMode=f,A.treeForkCount=g)}function ou(e,t,i){var s=t.pendingProps,f=s.revealOrder,g=s.tail;s=s.children;var A=nt.current,H=(A&2)!==0;if(H?(A=A&1|2,t.flags|=128):A&=1,V(nt,A),yt(e,t,s,i),s=Pe?gr:0,!H&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lu(e,i,t);else if(e.tag===19)lu(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(f){case"forwards":for(i=t.child,f=null;i!==null;)e=i.alternate,e!==null&&bn(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=t.child,t.child=null):(f=i.sibling,i.sibling=null),Nl(t,!1,f,i,g,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&bn(e)===null){t.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Nl(t,!0,i,null,g,s);break;case"together":Nl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function mi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Pi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,i=di(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=di(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ul(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_n(e)))}function T_(e,t,i){switch(t.tag){case 3:N(t,t.stateNode.containerInfo),Bi(t,lt,e.memoizedState.cache),ns();break;case 27:case 5:se(t);break;case 4:N(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,cl(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(zi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?au(e,t,i):(zi(t),e=mi(e,t,i),e!==null?e.sibling:null);zi(t);break;case 19:var f=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),f){if(s)return ou(e,t,i);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),V(nt,nt.current),s)break;return null;case 22:return t.lanes=0,eu(e,t,i,t.pendingProps);case 24:Bi(t,lt,e.memoizedState.cache)}return mi(e,t,i)}function cu(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Ul(e,i)&&(t.flags&128)===0)return ct=!1,T_(e,t,i);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&jc(t,gr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=cs(t.elementType),t.type=e,typeof e=="function")$a(e)?(s=fs(e,s),t.tag=1,t=ru(null,t,e,s,i)):(t.tag=0,t=Tl(null,t,e,s,i));else{if(e!=null){var f=e.$$typeof;if(f===S){t.tag=11,t=Qh(null,t,e,s,i);break e}else if(f===y){t.tag=14,t=Zh(null,t,e,s,i);break e}}throw t=O(e)||e,Error(I(306,t,""))}}return t;case 0:return Tl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,f=fs(s,t.pendingProps),ru(e,t,s,f,i);case 3:e:{if(N(t,t.stateNode.containerInfo),e===null)throw Error(I(387));s=t.pendingProps;var g=t.memoizedState;f=g.element,rl(e,t),xr(t,s,null,i);var A=t.memoizedState;if(s=A.cache,Bi(t,lt,s),s!==g.cache&&Za(t,[lt],i,!0),wr(),s=A.element,g.isDehydrated)if(g={element:s,isDehydrated:!1,cache:A.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=nu(e,t,s,i);break e}else if(s!==f){f=Wt(Error(I(424)),t),pr(f),t=nu(e,t,s,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(Ze=Kt(e.firstChild),St=t,Pe=!0,Di=null,Vt=!0,i=eh(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ns(),s===f){t=mi(e,t,i);break e}yt(e,t,s,i)}t=t.child}return t;case 26:return On(e,t),e===null?(i=Cd(t.type,null,t.pendingProps,null))?t.memoizedState=i:Pe||(i=t.type,e=t.pendingProps,s=Kn(le.current).createElement(i),s[mt]=t,s[Et]=e,bt(s,i,e),gt(s),t.stateNode=s):t.memoizedState=Cd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Pe&&(s=t.stateNode=pd(t.type,t.pendingProps,le.current),St=t,Vt=!0,f=Ze,Wi(t.type)?(mo=f,Ze=Kt(s.firstChild)):Ze=f),yt(e,t,t.pendingProps.children,i),On(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((f=s=Ze)&&(s=lv(s,t.type,t.pendingProps,Vt),s!==null?(t.stateNode=s,St=t,Ze=Kt(s.firstChild),Vt=!1,f=!0):f=!1),f||Ti(t)),se(t),f=t.type,g=t.pendingProps,A=e!==null?e.memoizedProps:null,s=g.children,fo(f,g)?s=null:A!==null&&fo(f,A)&&(t.flags|=32),t.memoizedState!==null&&(f=ul(e,t,b_,null,null,i),qr._currentValue=f),On(e,t),yt(e,t,s,i),t.child;case 6:return e===null&&Pe&&((e=i=Ze)&&(i=ov(i,t.pendingProps,Vt),i!==null?(t.stateNode=i,St=t,Ze=null,e=!0):e=!1),e||Ti(t)),null;case 13:return au(e,t,i);case 4:return N(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=us(t,null,s,i):yt(e,t,s,i),t.child;case 11:return Qh(e,t,t.type,t.pendingProps,i);case 7:return yt(e,t,t.pendingProps,i),t.child;case 8:return yt(e,t,t.pendingProps.children,i),t.child;case 12:return yt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Bi(t,t.type,s.value),yt(e,t,s.children,i),t.child;case 9:return f=t.type._context,s=t.pendingProps.children,ls(t),f=Ct(f),s=s(f),t.flags|=1,yt(e,t,s,i),t.child;case 14:return Zh(e,t,t.type,t.pendingProps,i);case 15:return Jh(e,t,t.type,t.pendingProps,i);case 19:return ou(e,t,i);case 31:return D_(e,t,i);case 22:return eu(e,t,i,t.pendingProps);case 24:return ls(t),s=Ct(lt),e===null?(f=tl(),f===null&&(f=Ke,g=Ja(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=i),f=g),t.memoizedState={parent:s,cache:f},sl(t),Bi(t,lt,f)):((e.lanes&i)!==0&&(rl(e,t),xr(t,null,null,i),wr()),f=e.memoizedState,g=t.memoizedState,f.parent!==s?(f={parent:s,cache:s},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Bi(t,lt,s)):(s=g.cache,Bi(t,lt,s),s!==f.cache&&Za(t,[lt],i,!0))),yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(I(156,t.tag))}function Si(e){e.flags|=4}function Il(e,t,i,s,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(zu())e.flags|=8192;else throw hs=mn,il}else e.flags&=-16777217}function hu(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ld(t))if(zu())e.flags|=8192;else throw hs=mn,il}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$o():536870912,e.lanes|=t,Ws|=t)}function Dr(e,t){if(!Pe)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 s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function B_(e,t,i){var s=t.pendingProps;switch(Xa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),vi(lt),re(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?Si(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ya())),Je(t),null;case 26:var f=t.type,g=t.memoizedState;return e===null?(Si(t),g!==null?(Je(t),hu(t,g)):(Je(t),Il(t,f,null,s,i))):g?g!==e.memoizedState?(Si(t),Je(t),hu(t,g)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Si(t),Je(t),Il(t,f,e,s,i)),null;case 27:if(ve(t),i=le.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(I(166));return Je(t),null}e=K.current,Bs(t)?$c(t):(e=pd(f,s,i),t.stateNode=e,Si(t))}return Je(t),null;case 5:if(ve(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(!s){if(t.stateNode===null)throw Error(I(166));return Je(t),null}if(g=K.current,Bs(t))$c(t);else{var A=Kn(le.current);switch(g){case 1:g=A.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=A.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=A.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=A.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=A.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof s.is=="string"?A.createElement("select",{is:s.is}):A.createElement("select"),s.multiple?g.multiple=!0:s.size&&(g.size=s.size);break;default:g=typeof s.is=="string"?A.createElement(f,{is:s.is}):A.createElement(f)}}g[mt]=t,g[Et]=s;e:for(A=t.child;A!==null;){if(A.tag===5||A.tag===6)g.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===t)break e;for(;A.sibling===null;){if(A.return===null||A.return===t)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}t.stateNode=g;e:switch(bt(g,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Si(t)}}return Je(t),Il(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Si(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(e=le.current,Bs(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,f=St,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[mt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||ad(e.nodeValue,i)),e||Ti(t,!0)}else e=Kn(e).createTextNode(s),e[mt]=t,t.stateNode=e}return Je(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Bs(t),i!==null){if(e===null){if(!s)throw Error(I(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(557));e[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else i=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(I(558))}return Je(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Bs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(I(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(I(317));f[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),f=!1}else f=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==f&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),Je(t),null);case 4:return re(),e===null&&lo(t.stateNode.containerInfo),Je(t),null;case 10:return vi(t.type),Je(t),null;case 19:if(k(nt),s=t.memoizedState,s===null)return Je(t),null;if(f=(t.flags&128)!==0,g=s.rendering,g===null)if(f)Dr(s,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=bn(e),g!==null){for(t.flags|=128,Dr(s,!1),e=g.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Uc(i,e),i=i.sibling;return V(nt,nt.current&1|2),Pe&&fi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ge()>Pn&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304)}else{if(!f)if(e=bn(g),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!g.alternate&&!Pe)return Je(t),null}else 2*ge()-s.renderingStartTime>Pn&&i!==536870912&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(g.sibling=t.child,t.child=g):(e=s.last,e!==null?e.sibling=g:t.child=g,s.last=g)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ge(),e.sibling=null,i=nt.current,V(nt,f?i&1|2:i&1),Pe&&fi(t,s.treeForkCount),e):(Je(t),null);case 22:case 23:return Nt(t),ol(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),i=t.updateQueue,i!==null&&Hn(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&k(os),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),vi(lt),Je(t),null;case 25:return null;case 30:return null}throw Error(I(156,t.tag))}function O_(e,t){switch(Xa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vi(lt),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(I(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(nt),null;case 4:return re(),null;case 10:return vi(t.type),null;case 22:case 23:return Nt(t),ol(),e!==null&&k(os),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vi(lt),null;case 25:return null;default:return null}}function uu(e,t){switch(Xa(t),t.tag){case 3:vi(lt),re();break;case 26:case 27:case 5:ve(t);break;case 4:re();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:k(nt);break;case 10:vi(t.type);break;case 22:case 23:Nt(t),ol(),e!==null&&k(os);break;case 24:vi(lt)}}function Tr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var f=s.next;i=f;do{if((i.tag&e)===e){s=void 0;var g=i.create,A=i.inst;s=g(),A.destroy=s}i=i.next}while(i!==f)}}catch(H){Ge(t,t.return,H)}}function Ui(e,t,i){try{var s=t.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var g=f.next;s=g;do{if((s.tag&e)===e){var A=s.inst,H=A.destroy;if(H!==void 0){A.destroy=void 0,f=t;var G=i,te=H;try{te()}catch(oe){Ge(f,G,oe)}}}s=s.next}while(s!==g)}}catch(oe){Ge(t,t.return,oe)}}function du(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ih(t,i)}catch(s){Ge(e,e.return,s)}}}function fu(e,t,i){i.props=fs(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ge(e,t,s)}}function Br(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(f){Ge(e,t,f)}}function li(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(f){Ge(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Ge(e,t,f)}else i.current=null}function _u(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(f){Ge(e,e.return,f)}}function Pl(e,t,i){try{var s=e.stateNode;tv(s,e.type,i,t),s[Et]=t}catch(f){Ge(e,e.return,f)}}function vu(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wi(e.type)||e.tag===4}function jl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vu(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&&Wi(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 Fl(e,t,i){var s=e.tag;if(s===5||s===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=hi));else if(s!==4&&(s===27&&Wi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Fl(e,t,i),e=e.sibling;e!==null;)Fl(e,t,i),e=e.sibling}function zn(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Wi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(zn(e,t,i),e=e.sibling;e!==null;)zn(e,t,i),e=e.sibling}function gu(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);bt(t,s,i),t[mt]=e,t[Et]=i}catch(g){Ge(e,e.return,g)}}var Ci=!1,ht=!1,$l=!1,pu=typeof WeakSet=="function"?WeakSet:Set,pt=null;function k_(e,t){if(e=e.containerInfo,ho=sa,e=Rc(e),za(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var f=s.anchorOffset,g=s.focusNode;s=s.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var A=0,H=-1,G=-1,te=0,oe=0,de=e,ne=null;t:for(;;){for(var ae;de!==i||f!==0&&de.nodeType!==3||(H=A+f),de!==g||s!==0&&de.nodeType!==3||(G=A+s),de.nodeType===3&&(A+=de.nodeValue.length),(ae=de.firstChild)!==null;)ne=de,de=ae;for(;;){if(de===e)break t;if(ne===i&&++te===f&&(H=A),ne===g&&++oe===s&&(G=A),(ae=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=ae}i=H===-1||G===-1?null:{start:H,end:G}}else i=null}i=i||{start:0,end:0}}else i=null;for(uo={focusedElem:e,selectionRange:i},sa=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,g=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++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=t,f=g.memoizedProps,g=g.memoizedState,s=i.stateNode;try{var Ce=fs(i.type,f);e=s.getSnapshotBeforeUpdate(Ce,g),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Ge(i,i.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)vo(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vo(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(I(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function mu(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:bi(e,i),s&4&&Tr(5,i);break;case 1:if(bi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(A){Ge(i,i.return,A)}else{var f=fs(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(A){Ge(i,i.return,A)}}s&64&&du(i),s&512&&Br(i,i.return);break;case 3:if(bi(e,i),s&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{ih(e,t)}catch(A){Ge(i,i.return,A)}}break;case 27:t===null&&s&4&&gu(i);case 26:case 5:bi(e,i),t===null&&s&4&&_u(i),s&512&&Br(i,i.return);break;case 12:bi(e,i);break;case 31:bi(e,i),s&4&&yu(e,i);break;case 13:bi(e,i),s&4&&bu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$_.bind(null,i),cv(e,i))));break;case 22:if(s=i.memoizedState!==null||Ci,!s){t=t!==null&&t.memoizedState!==null||ht,f=Ci;var g=ht;Ci=s,(ht=t)&&!g?wi(e,i,(i.subtreeFlags&8772)!==0):bi(e,i),Ci=f,ht=g}break;case 30:break;default:bi(e,i)}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Sa(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 et=null,At=!1;function yi(e,t,i){for(i=i.child;i!==null;)Cu(e,t,i),i=i.sibling}function Cu(e,t,i){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(xt,i)}catch{}switch(i.tag){case 26:ht||li(i,t),yi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||li(i,t);var s=et,f=At;Wi(i.type)&&(et=i.stateNode,At=!1),yi(e,t,i),jr(i.stateNode),et=s,At=f;break;case 5:ht||li(i,t);case 6:if(s=et,f=At,et=null,yi(e,t,i),et=s,At=f,et!==null)if(At)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(g){Ge(i,t,g)}else try{et.removeChild(i.stateNode)}catch(g){Ge(i,t,g)}break;case 18:et!==null&&(At?(e=et,dd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):dd(et,i.stateNode));break;case 4:s=et,f=At,et=i.stateNode.containerInfo,At=!0,yi(e,t,i),et=s,At=f;break;case 0:case 11:case 14:case 15:Ui(2,i,t),ht||Ui(4,i,t),yi(e,t,i);break;case 1:ht||(li(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&fu(i,t,s)),yi(e,t,i);break;case 21:yi(e,t,i);break;case 22:ht=(s=ht)||i.memoizedState!==null,yi(e,t,i),ht=s;break;default:yi(e,t,i)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Js(e)}catch(i){Ge(t,t.return,i)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Js(e)}catch(i){Ge(t,t.return,i)}}function H_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(I(435,e.tag))}}function Nn(e,t){var i=H_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var f=q_.bind(null,e,s);s.then(f,f)}})}function Rt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var f=i[s],g=e,A=t,H=A;e:for(;H!==null;){switch(H.tag){case 27:if(Wi(H.type)){et=H.stateNode,At=!1;break e}break;case 5:et=H.stateNode,At=!1;break e;case 3:case 4:et=H.stateNode.containerInfo,At=!0;break e}H=H.return}if(et===null)throw Error(I(160));Cu(g,A,f),et=null,At=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e),t=t.sibling}var ti=null;function wu(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Dt(e),s&4&&(Ui(3,e,e.return),Tr(3,e),Ui(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&64&&Ci&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var f=ti;if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&4){var g=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":g=f.getElementsByTagName("title")[0],(!g||g[nr]||g[mt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(s),f.head.insertBefore(g,f.querySelector("head > title"))),bt(g,s,i),g[mt]=e,gt(g),s=g;break e;case"link":var A=wd("link","href",f).get(s+(i.href||""));if(A){for(var H=0;H<A.length;H++)if(g=A[H],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){A.splice(H,1);break t}}g=f.createElement(s),bt(g,s,i),f.head.appendChild(g);break;case"meta":if(A=wd("meta","content",f).get(s+(i.content||""))){for(H=0;H<A.length;H++)if(g=A[H],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){A.splice(H,1);break t}}g=f.createElement(s),bt(g,s,i),f.head.appendChild(g);break;default:throw Error(I(468,s))}g[mt]=e,gt(g),s=g}e.stateNode=s}else xd(f,e.type,e.stateNode);else e.stateNode=bd(f,s,e.memoizedProps);else g!==s?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,s===null?xd(f,e.type,e.stateNode):bd(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,i.memoizedProps)}break;case 27:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),i!==null&&s&4&&Pl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),e.flags&32){f=e.stateNode;try{bs(f,"")}catch(Ce){Ge(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,Pl(e,f,i!==null?i.memoizedProps:f)),s&1024&&($l=!0);break;case 6:if(Rt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(I(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Ce){Ge(e,e.return,Ce)}}break;case 3:if(Jn=null,f=ti,ti=Qn(t.containerInfo),Rt(t,e),ti=f,Dt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(Ce){Ge(e,e.return,Ce)}$l&&($l=!1,xu(e));break;case 4:s=ti,ti=Qn(e.stateNode.containerInfo),Rt(t,e),Dt(e),ti=s;break;case 12:Rt(t,e),Dt(e);break;case 31:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 13:Rt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(In=ge()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 22:f=e.memoizedState!==null;var G=i!==null&&i.memoizedState!==null,te=Ci,oe=ht;if(Ci=te||f,ht=oe||G,Rt(t,e),ht=oe,Ci=te,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(i===null||G||Ci||ht||_s(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){G=i=t;try{if(g=G.stateNode,f)A=g.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{H=G.stateNode;var de=G.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;H.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ce){Ge(G,G.return,Ce)}}}else if(t.tag===6){if(i===null){G=t;try{G.stateNode.nodeValue=f?"":G.memoizedProps}catch(Ce){Ge(G,G.return,Ce)}}}else if(t.tag===18){if(i===null){G=t;try{var ae=G.stateNode;f?fd(ae,!0):fd(G.stateNode,!1)}catch(Ce){Ge(G,G.return,Ce)}}}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}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,Nn(e,i))));break;case 19:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nn(e,s)));break;case 30:break;case 21:break;default:Rt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(vu(s)){i=s;break}s=s.return}if(i==null)throw Error(I(160));switch(i.tag){case 27:var f=i.stateNode,g=jl(e);zn(e,g,f);break;case 5:var A=i.stateNode;i.flags&32&&(bs(A,""),i.flags&=-33);var H=jl(e);zn(e,H,A);break;case 3:case 4:var G=i.stateNode.containerInfo,te=jl(e);Fl(e,te,G);break;default:throw Error(I(161))}}catch(oe){Ge(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xu(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function _s(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ui(4,t,t.return),_s(t);break;case 1:li(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&fu(t,t.return,i),_s(t);break;case 27:jr(t.stateNode);case 26:case 5:li(t,t.return),_s(t);break;case 22:t.memoizedState===null&&_s(t);break;case 30:_s(t);break;default:_s(t)}e=e.sibling}}function wi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,f=e,g=t,A=g.flags;switch(g.tag){case 0:case 11:case 15:wi(f,g,i),Tr(4,g);break;case 1:if(wi(f,g,i),s=g,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(te){Ge(s,s.return,te)}if(s=g,f=s.updateQueue,f!==null){var H=s.stateNode;try{var G=f.shared.hiddenCallbacks;if(G!==null)for(f.shared.hiddenCallbacks=null,f=0;f<G.length;f++)th(G[f],H)}catch(te){Ge(s,s.return,te)}}i&&A&64&&du(g),Br(g,g.return);break;case 27:gu(g);case 26:case 5:wi(f,g,i),i&&s===null&&A&4&&_u(g),Br(g,g.return);break;case 12:wi(f,g,i);break;case 31:wi(f,g,i),i&&A&4&&yu(f,g);break;case 13:wi(f,g,i),i&&A&4&&bu(f,g);break;case 22:g.memoizedState===null&&wi(f,g,i),Br(g,g.return);break;case 30:break;default:wi(f,g,i)}t=t.sibling}}function ql(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&&mr(i))}function Wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function ii(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lu(e,t,i,s),t=t.sibling}function Lu(e,t,i,s){var f=t.flags;switch(t.tag){case 0:case 11:case 15:ii(e,t,i,s),f&2048&&Tr(9,t);break;case 1:ii(e,t,i,s);break;case 3:ii(e,t,i,s),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e)));break;case 12:if(f&2048){ii(e,t,i,s),e=t.stateNode;try{var g=t.memoizedProps,A=g.id,H=g.onPostCommit;typeof H=="function"&&H(A,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){Ge(t,t.return,G)}}else ii(e,t,i,s);break;case 31:ii(e,t,i,s);break;case 13:ii(e,t,i,s);break;case 23:break;case 22:g=t.stateNode,A=t.alternate,t.memoizedState!==null?g._visibility&2?ii(e,t,i,s):Or(e,t):g._visibility&2?ii(e,t,i,s):(g._visibility|=2,Fs(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),f&2048&&ql(A,t);break;case 24:ii(e,t,i,s),f&2048&&Wl(t.alternate,t);break;default:ii(e,t,i,s)}}function Fs(e,t,i,s,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var g=e,A=t,H=i,G=s,te=A.flags;switch(A.tag){case 0:case 11:case 15:Fs(g,A,H,G,f),Tr(8,A);break;case 23:break;case 22:var oe=A.stateNode;A.memoizedState!==null?oe._visibility&2?Fs(g,A,H,G,f):Or(g,A):(oe._visibility|=2,Fs(g,A,H,G,f)),f&&te&2048&&ql(A.alternate,A);break;case 24:Fs(g,A,H,G,f),f&&te&2048&&Wl(A.alternate,A);break;default:Fs(g,A,H,G,f)}t=t.sibling}}function Or(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,f=s.flags;switch(s.tag){case 22:Or(i,s),f&2048&&ql(s.alternate,s);break;case 24:Or(i,s),f&2048&&Wl(s.alternate,s);break;default:Or(i,s)}t=t.sibling}}var kr=8192;function $s(e,t,i){if(e.subtreeFlags&kr)for(e=e.child;e!==null;)Eu(e,t,i),e=e.sibling}function Eu(e,t,i){switch(e.tag){case 26:$s(e,t,i),e.flags&kr&&e.memoizedState!==null&&yv(i,ti,e.memoizedState,e.memoizedProps);break;case 5:$s(e,t,i);break;case 3:case 4:var s=ti;ti=Qn(e.stateNode.containerInfo),$s(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=kr,kr=16777216,$s(e,t,i),kr=s):$s(e,t,i));break;default:$s(e,t,i)}}function Mu(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 Hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Ru(s,e)}Mu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Au(e),e=e.sibling}function Au(e){switch(e.tag){case 0:case 11:case 15:Hr(e),e.flags&2048&&Ui(9,e,e.return);break;case 3:Hr(e);break;case 12:Hr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Un(e)):Hr(e);break;default:Hr(e)}}function Un(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Ru(s,e)}Mu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ui(8,t,t.return),Un(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Un(t));break;default:Un(t)}e=e.sibling}}function Ru(e,t){for(;pt!==null;){var i=pt;switch(i.tag){case 0:case 11:case 15:Ui(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:mr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,pt=s;else e:for(i=e;pt!==null;){s=pt;var f=s.sibling,g=s.return;if(Su(s),s===i){pt=null;break e}if(f!==null){f.return=g,pt=f;break e}pt=g}}}var z_={getCacheForType:function(e){var t=Ct(lt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ct(lt).controller.signal}},N_=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ke=null,ke=null,Ne=0,We=0,Ut=null,Ii=!1,qs=!1,Gl=!1,xi=0,rt=0,Pi=0,vs=0,Xl=0,It=0,Ws=0,zr=null,Tt=null,Vl=!1,In=0,Du=0,Pn=1/0,jn=null,ji=null,dt=0,Fi=null,Gs=null,Li=0,Yl=0,Kl=null,Tu=null,Nr=0,Ql=null;function Pt(){return($e&2)!==0&&Ne!==0?Ne&-Ne:U.T!==null?so():Xo()}function Bu(){if(It===0)if((Ne&536870912)===0||Pe){var e=si;si<<=1,(si&3932160)===0&&(si=262144),It=e}else It=536870912;return e=zt.current,e!==null&&(e.flags|=32),It}function Bt(e,t,i){(e===Ke&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Xs(e,0),$i(e,Ne,It,!1)),rr(e,i),(($e&2)===0||e!==Ke)&&(e===Ke&&(($e&2)===0&&(vs|=i),rt===4&&$i(e,Ne,It,!1)),oi(e))}function Ou(e,t,i){if(($e&6)!==0)throw Error(I(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||sr(e,t),f=s?P_(e,t):Jl(e,t,!0),g=s;do{if(f===0){qs&&!s&&$i(e,t,0,!1);break}else{if(i=e.current.alternate,g&&!U_(i)){f=Jl(e,t,!1),g=!1;continue}if(f===2){if(g=t,e.errorRecoveryDisabledLanes&g)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){t=A;e:{var H=e;f=zr;var G=H.current.memoizedState.isDehydrated;if(G&&(Xs(H,A).flags|=256),A=Jl(H,A,!1),A!==2){if(Gl&&!G){H.errorRecoveryDisabledLanes|=g,vs|=g,f=4;break e}g=Tt,Tt=f,g!==null&&(Tt===null?Tt=g:Tt.push.apply(Tt,g))}f=A}if(g=!1,f!==2)continue}}if(f===1){Xs(e,0),$i(e,t,0,!0);break}e:{switch(s=e,g=f,g){case 0:case 1:throw Error(I(345));case 4:if((t&4194048)!==t)break;case 6:$i(s,t,It,!Ii);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(I(329))}if((t&62914560)===t&&(f=In+300-ge(),10<f)){if($i(s,t,It,!Ii),Kr(s,0,!0)!==0)break e;Li=t,s.timeoutHandle=hd(ku.bind(null,s,i,Tt,jn,Vl,t,It,vs,Ws,Ii,g,"Throttled",-0,0),f);break e}ku(s,i,Tt,jn,Vl,t,It,vs,Ws,Ii,g,null,-0,0)}}break}while(!0);oi(e)}function ku(e,t,i,s,f,g,A,H,G,te,oe,de,ne,ae){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},Eu(t,g,de);var Ce=(g&62914560)===g?In-ge():(g&4194048)===g?Du-ge():0;if(Ce=bv(de,Ce),Ce!==null){Li=g,e.cancelPendingCommit=Ce(Fu.bind(null,e,t,g,i,s,f,A,H,G,oe,de,null,ne,ae)),$i(e,g,A,!te);return}}Fu(e,t,g,i,s,f,A,H,G)}function U_(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 s=0;s<i.length;s++){var f=i[s],g=f.getSnapshot;f=f.value;try{if(!kt(g(),f))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 $i(e,t,i,s){t&=~Xl,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var f=t;0<f;){var g=31-ut(f),A=1<<g;s[g]=-1,f&=~A}i!==0&&qo(e,i,t)}function Fn(){return($e&6)===0?(Ur(0),!1):!0}function Zl(){if(ke!==null){if(We===0)var e=ke.return;else e=ke,_i=as=null,_l(e),Ns=null,Cr=0,e=ke;for(;e!==null;)uu(e.alternate,e),e=e.return;ke=null}}function Xs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,rv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Li=0,Zl(),Ke=e,ke=i=di(e.current,null),Ne=t,We=0,Ut=null,Ii=!1,qs=sr(e,t),Gl=!1,Ws=It=Xl=vs=Pi=rt=0,Tt=zr=null,Vl=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var f=31-ut(s),g=1<<f;t|=e[f],s&=~g}return xi=t,cn(),i}function Hu(e,t){Te=null,U.H=Ar,t===zs||t===pn?(t=Qc(),We=3):t===il?(t=Qc(),We=4):We=t===Dl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,ke===null&&(rt=1,Tn(e,Wt(t,e.current)))}function zu(){var e=zt.current;return e===null?!0:(Ne&4194048)===Ne?Yt===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===Yt:!1}function Nu(){var e=U.H;return U.H=Ar,e===null?Ar:e}function Uu(){var e=U.A;return U.A=z_,e}function $n(){rt=4,Ii||(Ne&4194048)!==Ne&&zt.current!==null||(qs=!0),(Pi&134217727)===0&&(vs&134217727)===0||Ke===null||$i(Ke,Ne,It,!1)}function Jl(e,t,i){var s=$e;$e|=2;var f=Nu(),g=Uu();(Ke!==e||Ne!==t)&&(jn=null,Xs(e,t)),t=!1;var A=rt;e:do try{if(We!==0&&ke!==null){var H=ke,G=Ut;switch(We){case 8:Zl(),A=6;break e;case 3:case 2:case 9:case 6:zt.current===null&&(t=!0);var te=We;if(We=0,Ut=null,Vs(e,H,G,te),i&&qs){A=0;break e}break;default:te=We,We=0,Ut=null,Vs(e,H,G,te)}}I_(),A=rt;break}catch(oe){Hu(e,oe)}while(!0);return t&&e.shellSuspendCounter++,_i=as=null,$e=s,U.H=f,U.A=g,ke===null&&(Ke=null,Ne=0,cn()),A}function I_(){for(;ke!==null;)Iu(ke)}function P_(e,t){var i=$e;$e|=2;var s=Nu(),f=Uu();Ke!==e||Ne!==t?(jn=null,Pn=ge()+500,Xs(e,t)):qs=sr(e,t);e:do try{if(We!==0&&ke!==null){t=ke;var g=Ut;t:switch(We){case 1:We=0,Ut=null,Vs(e,t,g,1);break;case 2:case 9:if(Yc(g)){We=0,Ut=null,Pu(t);break}t=function(){We!==2&&We!==9||Ke!==e||(We=7),oi(e)},g.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Yc(g)?(We=0,Ut=null,Pu(t)):(We=0,Ut=null,Vs(e,t,g,7));break;case 5:var A=null;switch(ke.tag){case 26:A=ke.memoizedState;case 5:case 27:var H=ke;if(A?Ld(A):H.stateNode.complete){We=0,Ut=null;var G=H.sibling;if(G!==null)ke=G;else{var te=H.return;te!==null?(ke=te,qn(te)):ke=null}break t}}We=0,Ut=null,Vs(e,t,g,5);break;case 6:We=0,Ut=null,Vs(e,t,g,6);break;case 8:Zl(),rt=6;break e;default:throw Error(I(462))}}j_();break}catch(oe){Hu(e,oe)}while(!0);return _i=as=null,U.H=s,U.A=f,$e=i,ke!==null?0:(Ke=null,Ne=0,cn(),rt)}function j_(){for(;ke!==null&&!me();)Iu(ke)}function Iu(e){var t=cu(e.alternate,e,xi);e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Pu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=su(i,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=su(i,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:_l(t);default:uu(i,t),t=ke=Uc(t,xi),t=cu(i,t,xi)}e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Vs(e,t,i,s){_i=as=null,_l(t),Ns=null,Cr=0;var f=t.return;try{if(R_(e,f,t,i,Ne)){rt=1,Tn(e,Wt(i,e.current)),ke=null;return}}catch(g){if(f!==null)throw ke=f,g;rt=1,Tn(e,Wt(i,e.current)),ke=null;return}t.flags&32768?(Pe||s===1?e=!0:qs||(Ne&536870912)!==0?e=!1:(Ii=e=!0,(s===2||s===9||s===3||s===6)&&(s=zt.current,s!==null&&s.tag===13&&(s.flags|=16384))),ju(t,e)):qn(t)}function qn(e){var t=e;do{if((t.flags&32768)!==0){ju(t,Ii);return}e=t.return;var i=B_(t.alternate,t,xi);if(i!==null){ke=i;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);rt===0&&(rt=5)}function ju(e,t){do{var i=O_(e.alternate,e);if(i!==null){i.flags&=32767,ke=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=i}while(e!==null);rt=6,ke=null}function Fu(e,t,i,s,f,g,A,H,G){e.cancelPendingCommit=null;do Wn();while(dt!==0);if(($e&6)!==0)throw Error(I(327));if(t!==null){if(t===e.current)throw Error(I(177));if(g=t.lanes|t.childLanes,g|=ja,Cf(e,i,g,A,H,G),e===Ke&&(ke=Ke=null,Ne=0),Gs=t,Fi=e,Li=i,Yl=g,Kl=f,Tu=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,W_(Qe,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,f=j.p,j.p=2,A=$e,$e|=4;try{k_(e,t,i)}finally{$e=A,j.p=f,U.T=s}}dt=1,$u(),qu(),Wu()}}function $u(){if(dt===1){dt=0;var e=Fi,t=Gs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var s=j.p;j.p=2;var f=$e;$e|=4;try{wu(t,e);var g=uo,A=Rc(e.containerInfo),H=g.focusedElem,G=g.selectionRange;if(A!==H&&H&&H.ownerDocument&&Ac(H.ownerDocument.documentElement,H)){if(G!==null&&za(H)){var te=G.start,oe=G.end;if(oe===void 0&&(oe=te),"selectionStart"in H)H.selectionStart=te,H.selectionEnd=Math.min(oe,H.value.length);else{var de=H.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),Ce=H.textContent.length,Ee=Math.min(G.start,Ce),Ye=G.end===void 0?Ee:Math.min(G.end,Ce);!ae.extend&&Ee>Ye&&(A=Ye,Ye=Ee,Ee=A);var Z=Mc(H,Ee),Y=Mc(H,Ye);if(Z&&Y&&(ae.rangeCount!==1||ae.anchorNode!==Z.node||ae.anchorOffset!==Z.offset||ae.focusNode!==Y.node||ae.focusOffset!==Y.offset)){var ee=de.createRange();ee.setStart(Z.node,Z.offset),ae.removeAllRanges(),Ee>Ye?(ae.addRange(ee),ae.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),ae.addRange(ee))}}}}for(de=[],ae=H;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<de.length;H++){var ce=de[H];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}sa=!!ho,uo=ho=null}finally{$e=f,j.p=s,U.T=i}}e.current=t,dt=2}}function qu(){if(dt===2){dt=0;var e=Fi,t=Gs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var s=j.p;j.p=2;var f=$e;$e|=4;try{mu(e,t.alternate,t)}finally{$e=f,j.p=s,U.T=i}}dt=3}}function Wu(){if(dt===4||dt===3){dt=0,he();var e=Fi,t=Gs,i=Li,s=Tu;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Gs=Fi=null,Gu(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ji=null),pa(i),t=t.stateNode,tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(xt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,f=j.p,j.p=2,U.T=null;try{for(var g=e.onRecoverableError,A=0;A<s.length;A++){var H=s[A];g(H.value,{componentStack:H.stack})}}finally{U.T=t,j.p=f}}(Li&3)!==0&&Wn(),oi(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===Ql?Nr++:(Nr=0,Ql=e):Nr=0,Ur(0)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function Wn(){return $u(),qu(),Wu(),Xu()}function Xu(){if(dt!==5)return!1;var e=Fi,t=Yl;Yl=0;var i=pa(Li),s=U.T,f=j.p;try{j.p=32>i?32:i,U.T=null,i=Kl,Kl=null;var g=Fi,A=Li;if(dt=0,Gs=Fi=null,Li=0,($e&6)!==0)throw Error(I(331));var H=$e;if($e|=4,Au(g.current),Lu(g,g.current,A,i),$e=H,Ur(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(xt,g)}catch{}return!0}finally{j.p=f,U.T=s,Gu(e,t)}}function Vu(e,t,i){t=Wt(i,t),t=Rl(e.stateNode,t,2),e=Hi(e,t,2),e!==null&&(rr(e,2),oi(e))}function Ge(e,t,i){if(e.tag===3)Vu(e,e,i);else for(;t!==null;){if(t.tag===3){Vu(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ji===null||!ji.has(s))){e=Wt(i,e),i=Yh(2),s=Hi(t,i,2),s!==null&&(Kh(i,s,t,e),rr(s,2),oi(s));break}}t=t.return}}function eo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new N_;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(i)||(Gl=!0,f.add(i),e=F_.bind(null,e,t,i),t.then(e,e))}function F_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ke===e&&(Ne&i)===i&&(rt===4||rt===3&&(Ne&62914560)===Ne&&300>ge()-In?($e&2)===0&&Xs(e,0):Xl|=i,Ws===Ne&&(Ws=0)),oi(e)}function Yu(e,t){t===0&&(t=$o()),e=ss(e,t),e!==null&&(rr(e,t),oi(e))}function $_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Yu(e,i)}function q_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(I(314))}s!==null&&s.delete(t),Yu(e,i)}function W_(e,t){return Se(e,t)}var Gn=null,Ys=null,to=!1,Xn=!1,io=!1,qi=0;function oi(e){e!==Ys&&e.next===null&&(Ys===null?Gn=Ys=e:Ys=Ys.next=e),Xn=!0,to||(to=!0,X_())}function Ur(e,t){if(!io&&Xn){io=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var g=0;else{var A=s.suspendedLanes,H=s.pingedLanes;g=(1<<31-ut(42|e)+1)-1,g&=f&~(A&~H),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,Ju(s,g))}else g=Ne,g=Kr(s,s===Ke?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(g&3)===0||sr(s,g)||(i=!0,Ju(s,g));s=s.next}while(i);io=!1}}function G_(){Ku()}function Ku(){Xn=to=!1;var e=0;qi!==0&&sv()&&(e=qi);for(var t=ge(),i=null,s=Gn;s!==null;){var f=s.next,g=Qu(s,t);g===0?(s.next=null,i===null?Gn=f:i.next=f,f===null&&(Ys=i)):(i=s,(e!==0||(g&3)!==0)&&(Xn=!0)),s=f}dt!==0&&dt!==5||Ur(e),qi!==0&&(qi=0)}function Qu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var A=31-ut(g),H=1<<A,G=f[A];G===-1?((H&i)===0||(H&s)!==0)&&(f[A]=Sf(H,t)):G<=t&&(e.expiredLanes|=H),g&=~H}if(t=Ke,i=Ne,i=Kr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&pe(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||sr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&pe(s),pa(i)){case 2:case 8:i=_t;break;case 32:i=Qe;break;case 268435456:i=Ie;break;default:i=Qe}return s=Zu.bind(null,e),i=Se(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&pe(s),e.callbackPriority=2,e.callbackNode=null,2}function Zu(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Wn()&&e.callbackNode!==i)return null;var s=Ne;return s=Kr(e,e===Ke?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ou(e,s,t),Qu(e,ge()),e.callbackNode!=null&&e.callbackNode===i?Zu.bind(null,e):null)}function Ju(e,t){if(Wn())return null;Ou(e,t,!0)}function X_(){nv(function(){($e&6)!==0?Se(Re,G_):Ku()})}function so(){if(qi===0){var e=ks;e===0&&(e=jt,jt<<=1,(jt&261888)===0&&(jt=256)),qi=e}return qi}function ed(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function td(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 V_(e,t,i,s,f){if(t==="submit"&&i&&i.stateNode===f){var g=ed((f[Et]||null).action),A=s.submitter;A&&(t=(t=A[Et]||null)?ed(t.formAction):A.getAttribute("formAction"),t!==null&&(g=t,A=null));var H=new nn("action","action",null,s,f);e.push({event:H,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(qi!==0){var G=A?td(f,A):new FormData(f);wl(i,{pending:!0,data:G,method:f.method,action:g},null,G)}}else typeof g=="function"&&(H.preventDefault(),G=A?td(f,A):new FormData(f),wl(i,{pending:!0,data:G,method:f.method,action:g},g,G))},currentTarget:f}]})}}for(var ro=0;ro<Pa.length;ro++){var no=Pa[ro],Y_=no.toLowerCase(),K_=no[0].toUpperCase()+no.slice(1);ei(Y_,"on"+K_)}ei(Bc,"onAnimationEnd"),ei(Oc,"onAnimationIteration"),ei(kc,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(d_,"onTransitionRun"),ei(f_,"onTransitionStart"),ei(__,"onTransitionCancel"),ei(Hc,"onTransitionEnd"),Cs("onMouseEnter",["mouseout","mouseover"]),Cs("onMouseLeave",["mouseout","mouseover"]),Cs("onPointerEnter",["pointerout","pointerover"]),Cs("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(" "),Q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ir));function id(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],f=s.event;s=s.listeners;e:{var g=void 0;if(t)for(var A=s.length-1;0<=A;A--){var H=s[A],G=H.instance,te=H.currentTarget;if(H=H.listener,G!==g&&f.isPropagationStopped())break e;g=H,f.currentTarget=te;try{g(f)}catch(oe){on(oe)}f.currentTarget=null,g=G}else for(A=0;A<s.length;A++){if(H=s[A],G=H.instance,te=H.currentTarget,H=H.listener,G!==g&&f.isPropagationStopped())break e;g=H,f.currentTarget=te;try{g(f)}catch(oe){on(oe)}f.currentTarget=null,g=G}}}}function He(e,t){var i=t[ma];i===void 0&&(i=t[ma]=new Set);var s=e+"__bubble";i.has(s)||(sd(t,e,2,!1),i.add(s))}function ao(e,t,i){var s=0;t&&(s|=4),sd(i,e,s,t)}var Vn="_reactListening"+Math.random().toString(36).slice(2);function lo(e){if(!e[Vn]){e[Vn]=!0,Ko.forEach(function(i){i!=="selectionchange"&&(Q_.has(i)||ao(i,!1,e),ao(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vn]||(t[Vn]=!0,ao("selectionchange",!1,t))}}function sd(e,t,i,s){switch(Bd(t)){case 2:var f=Lv;break;case 8:f=Ev;break;default:f=wo}i=f.bind(null,t,i,e),f=void 0,!Ma||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(t,i,{capture:!0,passive:f}):e.addEventListener(t,i,!0):f!==void 0?e.addEventListener(t,i,{passive:f}):e.addEventListener(t,i,!1)}function oo(e,t,i,s,f){var g=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var H=s.stateNode.containerInfo;if(H===f)break;if(A===4)for(A=s.return;A!==null;){var G=A.tag;if((G===3||G===4)&&A.stateNode.containerInfo===f)return;A=A.return}for(;H!==null;){if(A=ps(H),A===null)return;if(G=A.tag,G===5||G===6||G===26||G===27){s=g=A;continue e}H=H.parentNode}}s=s.return}oc(function(){var te=g,oe=La(i),de=[];e:{var ne=zc.get(e);if(ne!==void 0){var ae=nn,Ce=e;switch(e){case"keypress":if(sn(i)===0)break e;case"keydown":case"keyup":ae=qf;break;case"focusin":Ce="focus",ae=Ta;break;case"focusout":Ce="blur",ae=Ta;break;case"beforeblur":case"afterblur":ae=Ta;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":ae=uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Bf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Xf;break;case Bc:case Oc:case kc:ae=Hf;break;case Hc:ae=Yf;break;case"scroll":case"scrollend":ae=Df;break;case"wheel":ae=Qf;break;case"copy":case"cut":case"paste":ae=Nf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=fc;break;case"toggle":case"beforetoggle":ae=Jf}var Ee=(t&4)!==0,Ye=!Ee&&(e==="scroll"||e==="scrollend"),Z=Ee?ne!==null?ne+"Capture":null:ne;Ee=[];for(var Y=te,ee;Y!==null;){var ce=Y;if(ee=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||ee===null||Z===null||(ce=lr(Y,Z),ce!=null&&Ee.push(Pr(Y,ce,ee))),Ye)break;Y=Y.return}0<Ee.length&&(ne=new ae(ne,Ce,null,i,oe),de.push({event:ne,listeners:Ee}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",ne&&i!==xa&&(Ce=i.relatedTarget||i.fromElement)&&(ps(Ce)||Ce[gs]))break e;if((ae||ne)&&(ne=oe.window===oe?oe:(ne=oe.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(Ce=i.relatedTarget||i.toElement,ae=te,Ce=Ce?ps(Ce):null,Ce!==null&&(Ye=ie(Ce),Ee=Ce.tag,Ce!==Ye||Ee!==5&&Ee!==27&&Ee!==6)&&(Ce=null)):(ae=null,Ce=te),ae!==Ce)){if(Ee=uc,ce="onMouseLeave",Z="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=fc,ce="onPointerLeave",Z="onPointerEnter",Y="pointer"),Ye=ae==null?ne:ar(ae),ee=Ce==null?ne:ar(Ce),ne=new Ee(ce,Y+"leave",ae,i,oe),ne.target=Ye,ne.relatedTarget=ee,ce=null,ps(oe)===te&&(Ee=new Ee(Z,Y+"enter",Ce,i,oe),Ee.target=ee,Ee.relatedTarget=Ye,ce=Ee),Ye=ce,ae&&Ce)t:{for(Ee=Z_,Z=ae,Y=Ce,ee=0,ce=Z;ce;ce=Ee(ce))ee++;ce=0;for(var xe=Y;xe;xe=Ee(xe))ce++;for(;0<ee-ce;)Z=Ee(Z),ee--;for(;0<ce-ee;)Y=Ee(Y),ce--;for(;ee--;){if(Z===Y||Y!==null&&Z===Y.alternate){Ee=Z;break t}Z=Ee(Z),Y=Ee(Y)}Ee=null}else Ee=null;ae!==null&&rd(de,ne,ae,Ee,!1),Ce!==null&&Ye!==null&&rd(de,Ye,Ce,Ee,!0)}}e:{if(ne=te?ar(te):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var je=yc;else if(Sc(ne))if(bc)je=c_;else{je=l_;var ye=a_}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&wa(te.elementType)&&(je=yc):je=o_;if(je&&(je=je(e,te))){Cc(de,je,i,oe);break e}ye&&ye(e,ne,te),e==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&ba(ne,"number",ne.value)}switch(ye=te?ar(te):window,e){case"focusin":(Sc(ye)||ye.contentEditable==="true")&&(Es=ye,Na=te,vr=null);break;case"focusout":vr=Na=Es=null;break;case"mousedown":Ua=!0;break;case"contextmenu":case"mouseup":case"dragend":Ua=!1,Dc(de,i,oe);break;case"selectionchange":if(u_)break;case"keydown":case"keyup":Dc(de,i,oe)}var Be;if(Oa)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ls?pc(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(_c&&i.locale!=="ko"&&(Ls||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ls&&(Be=cc()):(Ai=oe,Aa="value"in Ai?Ai.value:Ai.textContent,Ls=!0)),ye=Yn(te,Ue),0<ye.length&&(Ue=new dc(Ue,e,null,i,oe),de.push({event:Ue,listeners:ye}),Be?Ue.data=Be:(Be=mc(i),Be!==null&&(Ue.data=Be)))),(Be=t_?i_(e,i):s_(e,i))&&(Ue=Yn(te,"onBeforeInput"),0<Ue.length&&(ye=new dc("onBeforeInput","beforeinput",null,i,oe),de.push({event:ye,listeners:Ue}),ye.data=Be)),V_(de,e,te,i,oe)}id(de,t)})}function Pr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Yn(e,t){for(var i=t+"Capture",s=[];e!==null;){var f=e,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=lr(e,i),f!=null&&s.unshift(Pr(e,f,g)),f=lr(e,t),f!=null&&s.push(Pr(e,f,g))),e.tag===3)return s;e=e.return}return[]}function Z_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rd(e,t,i,s,f){for(var g=t._reactName,A=[];i!==null&&i!==s;){var H=i,G=H.alternate,te=H.stateNode;if(H=H.tag,G!==null&&G===s)break;H!==5&&H!==26&&H!==27||te===null||(G=te,f?(te=lr(i,g),te!=null&&A.unshift(Pr(i,te,G))):f||(te=lr(i,g),te!=null&&A.push(Pr(i,te,G)))),i=i.return}A.length!==0&&e.push({event:t,listeners:A})}var J_=/\r\n?/g,ev=/\u0000|\uFFFD/g;function nd(e){return(typeof e=="string"?e:""+e).replace(J_,`
49
+ `).replace(ev,"")}function ad(e,t){return t=nd(t),nd(e)===t}function Ve(e,t,i,s,f,g){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||bs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&bs(e,""+s);break;case"className":Zr(e,"class",s);break;case"tabIndex":Zr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zr(e,i,s);break;case"style":ac(e,s,g);break;case"data":if(t!=="object"){Zr(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="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 g=="function"&&(i==="formAction"?(t!=="input"&&Ve(e,t,"name",f.name,f,null),Ve(e,t,"formEncType",f.formEncType,f,null),Ve(e,t,"formMethod",f.formMethod,f,null),Ve(e,t,"formTarget",f.formTarget,f,null)):(Ve(e,t,"encType",f.encType,f,null),Ve(e,t,"method",f.method,f,null),Ve(e,t,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=hi);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(I(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(I(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=en(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":He("beforetoggle",e),He("toggle",e),Qr(e,"popover",s);break;case"xlinkActuate":ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ci(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ci(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ci(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ci(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ci(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Af.get(i)||i,Qr(e,i,s))}}function co(e,t,i,s,f,g){switch(i){case"style":ac(e,s,g);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(I(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(I(60));e.innerHTML=i}}break;case"children":typeof s=="string"?bs(e,s):(typeof s=="number"||typeof s=="bigint")&&bs(e,""+s);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"onClick":s!=null&&(e.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qo.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),t=i.slice(2,f?i.length-7:void 0),g=e[Et]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(t,g,f),typeof s=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,f);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Qr(e,i,s)}}}function bt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var s=!1,f=!1,g;for(g in i)if(i.hasOwnProperty(g)){var A=i[g];if(A!=null)switch(g){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(I(137,t));default:Ve(e,t,g,A,i,null)}}f&&Ve(e,t,"srcSet",i.srcSet,i,null),s&&Ve(e,t,"src",i.src,i,null);return;case"input":He("invalid",e);var H=g=A=f=null,G=null,te=null;for(s in i)if(i.hasOwnProperty(s)){var oe=i[s];if(oe!=null)switch(s){case"name":f=oe;break;case"type":A=oe;break;case"checked":G=oe;break;case"defaultChecked":te=oe;break;case"value":g=oe;break;case"defaultValue":H=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(I(137,t));break;default:Ve(e,t,s,oe,i,null)}}ic(e,g,H,G,te,A,f,!1);return;case"select":He("invalid",e),s=A=g=null;for(f in i)if(i.hasOwnProperty(f)&&(H=i[f],H!=null))switch(f){case"value":g=H;break;case"defaultValue":A=H;break;case"multiple":s=H;default:Ve(e,t,f,H,i,null)}t=g,i=A,e.multiple=!!s,t!=null?ys(e,!!s,t,!1):i!=null&&ys(e,!!s,i,!0);return;case"textarea":He("invalid",e),g=f=s=null;for(A in i)if(i.hasOwnProperty(A)&&(H=i[A],H!=null))switch(A){case"value":s=H;break;case"defaultValue":f=H;break;case"children":g=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(I(91));break;default:Ve(e,t,A,H,i,null)}rc(e,s,f,g);return;case"option":for(G in i)if(i.hasOwnProperty(G)&&(s=i[G],s!=null))switch(G){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ve(e,t,G,s,i,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(s=0;s<Ir.length;s++)He(Ir[s],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(te in i)if(i.hasOwnProperty(te)&&(s=i[te],s!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(I(137,t));default:Ve(e,t,te,s,i,null)}return;default:if(wa(t)){for(oe in i)i.hasOwnProperty(oe)&&(s=i[oe],s!==void 0&&co(e,t,oe,s,i,void 0));return}}for(H in i)i.hasOwnProperty(H)&&(s=i[H],s!=null&&Ve(e,t,H,s,i,null))}function tv(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,A=null,H=null,G=null,te=null,oe=null;for(ae in i){var de=i[ae];if(i.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":G=de;default:s.hasOwnProperty(ae)||Ve(e,t,ae,null,s,de)}}for(var ne in s){var ae=s[ne];if(de=i[ne],s.hasOwnProperty(ne)&&(ae!=null||de!=null))switch(ne){case"type":g=ae;break;case"name":f=ae;break;case"checked":te=ae;break;case"defaultChecked":oe=ae;break;case"value":A=ae;break;case"defaultValue":H=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(I(137,t));break;default:ae!==de&&Ve(e,t,ne,ae,s,de)}}ya(e,A,H,G,te,oe,g,f);return;case"select":ae=A=H=ne=null;for(g in i)if(G=i[g],i.hasOwnProperty(g)&&G!=null)switch(g){case"value":break;case"multiple":ae=G;default:s.hasOwnProperty(g)||Ve(e,t,g,null,s,G)}for(f in s)if(g=s[f],G=i[f],s.hasOwnProperty(f)&&(g!=null||G!=null))switch(f){case"value":ne=g;break;case"defaultValue":H=g;break;case"multiple":A=g;default:g!==G&&Ve(e,t,f,g,s,G)}t=H,i=A,s=ae,ne!=null?ys(e,!!i,ne,!1):!!s!=!!i&&(t!=null?ys(e,!!i,t,!0):ys(e,!!i,i?[]:"",!1));return;case"textarea":ae=ne=null;for(H in i)if(f=i[H],i.hasOwnProperty(H)&&f!=null&&!s.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Ve(e,t,H,null,s,f)}for(A in s)if(f=s[A],g=i[A],s.hasOwnProperty(A)&&(f!=null||g!=null))switch(A){case"value":ne=f;break;case"defaultValue":ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(I(91));break;default:f!==g&&Ve(e,t,A,f,s,g)}sc(e,ne,ae);return;case"option":for(var Ce in i)if(ne=i[Ce],i.hasOwnProperty(Ce)&&ne!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ve(e,t,Ce,null,s,ne)}for(G in s)if(ne=s[G],ae=i[G],s.hasOwnProperty(G)&&ne!==ae&&(ne!=null||ae!=null))switch(G){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Ve(e,t,G,ne,s,ae)}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 Ee in i)ne=i[Ee],i.hasOwnProperty(Ee)&&ne!=null&&!s.hasOwnProperty(Ee)&&Ve(e,t,Ee,null,s,ne);for(te in s)if(ne=s[te],ae=i[te],s.hasOwnProperty(te)&&ne!==ae&&(ne!=null||ae!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(I(137,t));break;default:Ve(e,t,te,ne,s,ae)}return;default:if(wa(t)){for(var Ye in i)ne=i[Ye],i.hasOwnProperty(Ye)&&ne!==void 0&&!s.hasOwnProperty(Ye)&&co(e,t,Ye,void 0,s,ne);for(oe in s)ne=s[oe],ae=i[oe],!s.hasOwnProperty(oe)||ne===ae||ne===void 0&&ae===void 0||co(e,t,oe,ne,s,ae);return}}for(var Z in i)ne=i[Z],i.hasOwnProperty(Z)&&ne!=null&&!s.hasOwnProperty(Z)&&Ve(e,t,Z,null,s,ne);for(de in s)ne=s[de],ae=i[de],!s.hasOwnProperty(de)||ne===ae||ne==null&&ae==null||Ve(e,t,de,ne,s,ae)}function ld(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var f=i[s],g=f.transferSize,A=f.initiatorType,H=f.duration;if(g&&H&&ld(A)){for(A=0,H=f.responseEnd,s+=1;s<i.length;s++){var G=i[s],te=G.startTime;if(te>H)break;var oe=G.transferSize,de=G.initiatorType;oe&&ld(de)&&(G=G.responseEnd,A+=oe*(G<H?1:(H-te)/(G-te)))}if(--s,t+=8*(g+A)/(f.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 ho=null,uo=null;function Kn(e){return e.nodeType===9?e:e.ownerDocument}function od(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 cd(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 fo(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 _o=null;function sv(){var e=window.event;return e&&e.type==="popstate"?e===_o?!1:(_o=e,!0):(_o=null,!1)}var hd=typeof setTimeout=="function"?setTimeout:void 0,rv=typeof clearTimeout=="function"?clearTimeout:void 0,ud=typeof Promise=="function"?Promise:void 0,nv=typeof queueMicrotask=="function"?queueMicrotask:typeof ud<"u"?function(e){return ud.resolve(null).then(e).catch(av)}:hd;function av(e){setTimeout(function(){throw e})}function Wi(e){return e==="head"}function dd(e,t){var i=t,s=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(f),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")jr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,jr(i);for(var g=i.firstChild;g;){var A=g.nextSibling,H=g.nodeName;g[nr]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&g.rel.toLowerCase()==="stylesheet"||i.removeChild(g),g=A}}else i==="body"&&jr(e.ownerDocument.body);i=f}while(i);Js(t)}function fd(e,t){var i=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function vo(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":vo(i),Sa(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function lv(e,t,i,s){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=Kt(e.nextSibling),e===null)break}return null}function ov(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Kt(e.nextSibling),e===null))return null;return e}function _d(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Kt(e.nextSibling),e===null))return null;return e}function go(e){return e.data==="$?"||e.data==="$~"}function po(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cv(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Kt(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 mo=null;function vd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Kt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function gd(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 pd(e,t,i){switch(t=Kn(i),e){case"html":if(e=t.documentElement,!e)throw Error(I(452));return e;case"head":if(e=t.head,!e)throw Error(I(453));return e;case"body":if(e=t.body,!e)throw Error(I(454));return e;default:throw Error(I(451))}}function jr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Sa(e)}var Qt=new Map,md=new Set;function Qn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ei=j.d;j.d={f:hv,r:uv,D:dv,C:fv,L:_v,m:vv,X:pv,S:gv,M:mv};function hv(){var e=Ei.f(),t=Fn();return e||t}function uv(e){var t=ms(e);t!==null&&t.tag===5&&t.type==="form"?Hh(t):Ei.r(e)}var Ks=typeof document>"u"?null:document;function Sd(e,t,i){var s=Ks;if(s&&typeof t=="string"&&t){var f=$t(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),md.has(f)||(md.add(f),e={rel:e,crossOrigin:i,href:t},s.querySelector(f)===null&&(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function dv(e){Ei.D(e),Sd("dns-prefetch",e,null)}function fv(e,t){Ei.C(e,t),Sd("preconnect",e,t)}function _v(e,t,i){Ei.L(e,t,i);var s=Ks;if(s&&e&&t){var f='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+$t(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+$t(i.imageSizes)+'"]')):f+='[href="'+$t(e)+'"]';var g=f;switch(t){case"style":g=Qs(e);break;case"script":g=Zs(e)}Qt.has(g)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qt.set(g,e),s.querySelector(f)!==null||t==="style"&&s.querySelector(Fr(g))||t==="script"&&s.querySelector($r(g))||(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function vv(e,t){Ei.m(e,t);var i=Ks;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+$t(s)+'"][href="'+$t(e)+'"]',g=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Zs(e)}if(!Qt.has(g)&&(e=a({rel:"modulepreload",href:e},t),Qt.set(g,e),i.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector($r(g)))return}s=i.createElement("link"),bt(s,"link",e),gt(s),i.head.appendChild(s)}}}function gv(e,t,i){Ei.S(e,t,i);var s=Ks;if(s&&e){var f=Ss(s).hoistableStyles,g=Qs(e);t=t||"default";var A=f.get(g);if(!A){var H={loading:0,preload:null};if(A=s.querySelector(Fr(g)))H.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qt.get(g))&&So(e,i);var G=A=s.createElement("link");gt(G),bt(G,"link",e),G._p=new Promise(function(te,oe){G.onload=te,G.onerror=oe}),G.addEventListener("load",function(){H.loading|=1}),G.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Zn(A,t,s)}A={type:"stylesheet",instance:A,count:1,state:H},f.set(g,A)}}}function pv(e,t){Ei.X(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),g=s.get(f);g||(g=i.querySelector($r(f)),g||(e=a({src:e,async:!0},t),(t=Qt.get(f))&&Co(e,t),g=i.createElement("script"),gt(g),bt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(f,g))}}function mv(e,t){Ei.M(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),g=s.get(f);g||(g=i.querySelector($r(f)),g||(e=a({src:e,async:!0,type:"module"},t),(t=Qt.get(f))&&Co(e,t),g=i.createElement("script"),gt(g),bt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(f,g))}}function Cd(e,t,i,s){var f=(f=le.current)?Qn(f):null;if(!f)throw Error(I(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Qs(i.href),i=Ss(f).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Qs(i.href);var g=Ss(f).hoistableStyles,A=g.get(e);if(A||(f=f.ownerDocument||f,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,A),(g=f.querySelector(Fr(e)))&&!g._p&&(A.instance=g,A.state.loading=5),Qt.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},Qt.set(e,i),g||Sv(f,e,i,A.state))),t&&s===null)throw Error(I(528,""));return A}if(t&&s!==null)throw Error(I(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zs(i),i=Ss(f).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(I(444,e))}}function Qs(e){return'href="'+$t(e)+'"'}function Fr(e){return'link[rel="stylesheet"]['+e+"]"}function yd(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function Sv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),bt(t,"link",i),gt(t),e.head.appendChild(t))}function Zs(e){return'[src="'+$t(e)+'"]'}function $r(e){return"script[async]"+e}function bd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+$t(i.href)+'"]');if(s)return t.instance=s,gt(s),s;var f=a({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),gt(s),bt(s,"style",f),Zn(s,i.precedence,e),t.instance=s;case"stylesheet":f=Qs(i.href);var g=e.querySelector(Fr(f));if(g)return t.state.loading|=4,t.instance=g,gt(g),g;s=yd(i),(f=Qt.get(f))&&So(s,f),g=(e.ownerDocument||e).createElement("link"),gt(g);var A=g;return A._p=new Promise(function(H,G){A.onload=H,A.onerror=G}),bt(g,"link",s),t.state.loading|=4,Zn(g,i.precedence,e),t.instance=g;case"script":return g=Zs(i.src),(f=e.querySelector($r(g)))?(t.instance=f,gt(f),f):(s=i,(f=Qt.get(g))&&(s=a({},i),Co(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),gt(f),bt(f,"link",s),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(I(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Zn(s,i.precedence,e));return t.instance}function Zn(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,g=f,A=0;A<s.length;A++){var H=s[A];if(H.dataset.precedence===t)g=H;else if(g!==f)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function So(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Co(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jn=null;function wd(e,t,i){if(Jn===null){var s=new Map,f=Jn=new Map;f.set(i,s)}else f=Jn,s=f.get(i),s||(s=new Map,f.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var g=i[f];if(!(g[nr]||g[mt]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var A=g.getAttribute(t)||"";A=e+A;var H=s.get(A);H?H.push(g):s.set(A,[g])}}return s}function xd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Cv(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 Ld(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Qs(s.href),g=t.querySelector(Fr(f));if(g){t=g._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ea.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=g,gt(g);return}g=t.ownerDocument||t,s=yd(s),(f=Qt.get(f))&&So(s,f),g=g.createElement("link"),gt(g);var A=g;A._p=new Promise(function(H,G){A.onload=H,A.onerror=G}),bt(g,"link",s),i.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ea.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var yo=0;function bv(e,t){return e.stylesheets&&e.count===0&&ia(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+t);0<e.imgBytes&&yo===0&&(yo=62500*iv());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>yo?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function ea(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ia(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ta=null;function ia(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ta=new Map,t.forEach(wv,e),ta=null,ea.call(e))}function wv(e,t){if(!(t.state.loading&4)){var i=ta.get(e);if(i)var s=i.get(null);else{i=new Map,ta.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var A=f[g];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(i.set(A.dataset.precedence,A),s=A)}s&&i.set(null,s)}f=t.instance,A=f.getAttribute("data-precedence"),g=i.get(A)||s,g===s&&i.set(null,f),i.set(A,f),this.count++,s=ea.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),g?g.parentNode.insertBefore(f,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var qr={$$typeof:l,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function xv(e,t,i,s,f,g,A,H,G){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=va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.hiddenUpdates=va(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function Ed(e,t,i,s,f,g,A,H,G,te,oe,de){return e=new xv(e,t,i,A,G,te,oe,de,H),t=1,g===!0&&(t|=24),g=Ht(3,null,null,t),e.current=g,g.stateNode=e,t=Ja(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:s,isDehydrated:i,cache:t},sl(g),e}function Md(e){return e?(e=Rs,e):Rs}function Ad(e,t,i,s,f,g){f=Md(f),s.context===null?s.context=f:s.pendingContext=f,s=ki(t),s.payload={element:i},g=g===void 0?null:g,g!==null&&(s.callback=g),i=Hi(e,s,t),i!==null&&(Bt(i,e,t),br(i,e,t))}function Rd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function bo(e,t){Rd(e,t),(e=e.alternate)&&Rd(e,t)}function Dd(e){if(e.tag===13||e.tag===31){var t=ss(e,67108864);t!==null&&Bt(t,e,67108864),bo(e,67108864)}}function Td(e){if(e.tag===13||e.tag===31){var t=Pt();t=ga(t);var i=ss(e,t);i!==null&&Bt(i,e,t),bo(e,t)}}var sa=!0;function Lv(e,t,i,s){var f=U.T;U.T=null;var g=j.p;try{j.p=2,wo(e,t,i,s)}finally{j.p=g,U.T=f}}function Ev(e,t,i,s){var f=U.T;U.T=null;var g=j.p;try{j.p=8,wo(e,t,i,s)}finally{j.p=g,U.T=f}}function wo(e,t,i,s){if(sa){var f=xo(s);if(f===null)oo(e,t,s,ra,i),Od(e,s);else if(Av(f,e,t,i,s))s.stopPropagation();else if(Od(e,s),t&4&&-1<Mv.indexOf(e)){for(;f!==null;){var g=ms(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var A=Jt(g.pendingLanes);if(A!==0){var H=g;for(H.pendingLanes|=2,H.entangledLanes|=2;A;){var G=1<<31-ut(A);H.entanglements[1]|=G,A&=~G}oi(g),($e&6)===0&&(Pn=ge()+500,Ur(0))}}break;case 31:case 13:H=ss(g,2),H!==null&&Bt(H,g,2),Fn(),bo(g,2)}if(g=xo(s),g===null&&oo(e,t,s,ra,i),g===f)break;f=g}f!==null&&s.stopPropagation()}else oo(e,t,s,null,i)}}function xo(e){return e=La(e),Lo(e)}var ra=null;function Lo(e){if(ra=null,e=ps(e),e!==null){var t=ie(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=n(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 ra=e,null}function Bd(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(ze()){case Re:return 2;case _t:return 8;case Qe:case it:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Eo=!1,Gi=null,Xi=null,Vi=null,Wr=new Map,Gr=new Map,Yi=[],Mv="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 Od(e,t){switch(e){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":Wr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gr.delete(t.pointerId)}}function Xr(e,t,i,s,f,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:g,targetContainers:[f]},t!==null&&(t=ms(t),t!==null&&Dd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function Av(e,t,i,s,f){switch(t){case"focusin":return Gi=Xr(Gi,e,t,i,s,f),!0;case"dragenter":return Xi=Xr(Xi,e,t,i,s,f),!0;case"mouseover":return Vi=Xr(Vi,e,t,i,s,f),!0;case"pointerover":var g=f.pointerId;return Wr.set(g,Xr(Wr.get(g)||null,e,t,i,s,f)),!0;case"gotpointercapture":return g=f.pointerId,Gr.set(g,Xr(Gr.get(g)||null,e,t,i,s,f)),!0}return!1}function kd(e){var t=ps(e.target);if(t!==null){var i=ie(t);if(i!==null){if(t=i.tag,t===13){if(t=F(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Td(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,Vo(e.priority,function(){Td(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 na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=xo(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);xa=s,i.target.dispatchEvent(s),xa=null}else return t=ms(i),t!==null&&Dd(t),e.blockedOn=i,!1;t.shift()}return!0}function Hd(e,t,i){na(e)&&i.delete(t)}function Rv(){Eo=!1,Gi!==null&&na(Gi)&&(Gi=null),Xi!==null&&na(Xi)&&(Xi=null),Vi!==null&&na(Vi)&&(Vi=null),Wr.forEach(Hd),Gr.forEach(Hd)}function aa(e,t){e.blockedOn===t&&(e.blockedOn=null,Eo||(Eo=!0,P.unstable_scheduleCallback(P.unstable_NormalPriority,Rv)))}var la=null;function zd(e){la!==e&&(la=e,P.unstable_scheduleCallback(P.unstable_NormalPriority,function(){la===e&&(la=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],f=e[t+2];if(typeof s!="function"){if(Lo(s||i)===null)continue;break}var g=ms(i);g!==null&&(e.splice(t,3),t-=3,wl(g,{pending:!0,data:f,method:i.method,action:s},s,f))}}))}function Js(e){function t(G){return aa(G,e)}Gi!==null&&aa(Gi,e),Xi!==null&&aa(Xi,e),Vi!==null&&aa(Vi,e),Wr.forEach(t),Gr.forEach(t);for(var i=0;i<Yi.length;i++){var s=Yi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Yi.length&&(i=Yi[0],i.blockedOn===null);)kd(i),i.blockedOn===null&&Yi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var f=i[s],g=i[s+1],A=f[Et]||null;if(typeof g=="function")A||zd(i);else if(A){var H=null;if(g&&g.hasAttribute("formAction")){if(f=g,A=g[Et]||null)H=A.formAction;else if(Lo(f)!==null)continue}else H=A.action;typeof H=="function"?i[s+1]=H:(i.splice(s,3),s-=3),zd(i)}}}function Nd(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(A){return f=A})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function Mo(e){this._internalRoot=e}oa.prototype.render=Mo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));var i=t.current,s=Pt();Ad(i,s,e,t,null,null)},oa.prototype.unmount=Mo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ad(e.current,2,null,e,null,null),Fn(),t[gs]=null}};function oa(e){this._internalRoot=e}oa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Yi.length&&t!==0&&t<Yi[i].priority;i++);Yi.splice(i,0,e),i===0&&kd(e)}};var Ud=W.version;if(Ud!=="19.2.4")throw Error(I(527,Ud,"19.2.4"));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=d(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var Dv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{xt=ca.inject(Dv),tt=ca}catch{}}return Yr.createRoot=function(e,t){if(!J(e))throw Error(I(299));var i=!1,s="",f=Wh,g=Gh,A=Xh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(A=t.onRecoverableError)),t=Ed(e,1,!1,null,null,i,s,null,f,g,A,Nd),e[gs]=t.current,lo(e),new Mo(t)},Yr.hydrateRoot=function(e,t,i){if(!J(e))throw Error(I(299));var s=!1,f="",g=Wh,A=Gh,H=Xh,G=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(A=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError),i.formState!==void 0&&(G=i.formState)),t=Ed(e,1,!0,t,i??null,s,f,G,g,A,H,Nd),t.context=Md(null),i=t.current,s=Pt(),s=ga(s),f=ki(s),f.callback=null,Hi(i,f,s),i=s,t.current.lanes=i,rr(t,i),oi(t),e[gs]=t.current,lo(e),new oa(t)},Yr.version="19.2.4",Yr}var Vd;function Fv(){if(Vd)return Do.exports;Vd=1;function P(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P)}catch(W){console.error(W)}}return P(),Do.exports=jv(),Do.exports}var $v=Fv();const af=768,qv=1e3;function _a(){return"./"}function Qi(P){const W=_a(),X=P.startsWith("/")?P.slice(1):P;return W+X}function Zi(){const P=localStorage.getItem("codev-web-key");return P?{Authorization:`Bearer ${P}`}:{}}async function Wv(){const P=await fetch(Qi("api/state"),{headers:Zi()});if(!P.ok)throw new Error(`Failed to fetch state: ${P.status}`);return P.json()}async function Gv(){const P=await fetch(Qi("api/tabs/shell"),{method:"POST",headers:{"Content-Type":"application/json",...Zi()}});if(!P.ok)throw new Error(await P.text());return P.json()}async function lf(P,W,X){const I=await fetch(Qi("api/tabs/file"),{method:"POST",headers:{"Content-Type":"application/json",...Zi()},body:JSON.stringify({path:P,line:W,terminalId:X})});if(!I.ok)throw new Error(await I.text());return I.json()}async function Xv(P){const W=await fetch(Qi(`api/tabs/${P}`),{method:"DELETE",headers:Zi()});if(!W.ok)throw new Error(await W.text())}async function Vv(){const P=await fetch(Qi("api/files"),{headers:Zi()});if(!P.ok)throw new Error(`Failed to fetch files: ${P.status}`);return P.json()}async function of(P){const W=await fetch(Qi("api/paste-image"),{method:"POST",headers:{"Content-Type":P.type||"image/png",...Zi()},body:P});if(!W.ok)throw new Error(`Image upload failed: ${W.status}`);return W.json()}function Yd(P){if(P.terminalId){const W=window.location.pathname;return`${W.endsWith("/")?W:W+"/"}ws/terminal/${P.terminalId}`}return null}async function Yv(){const P=await fetch(Qi("api/git/status"),{headers:Zi()});if(!P.ok)throw new Error(`Failed to fetch git status: ${P.status}`);return P.json()}async function Kv(){const P=await fetch(Qi("api/files/recent"),{headers:Zi()});if(!P.ok)throw new Error(`Failed to fetch recent files: ${P.status}`);return P.json()}function Qv(){const[P,W]=we.useState(null),[X,I]=we.useState(null),J=we.useCallback(async()=>{try{const ie=await Wv();W(ie),I(null)}catch(ie){I(ie.message)}},[]);return we.useEffect(()=>{J();const ie=setInterval(J,qv);return()=>clearInterval(ie)},[J]),{state:P,error:X,refresh:J}}function Zv(P){const W=[{id:"dashboard",type:"dashboard",label:"Dashboard",closable:!1}];P!=null&&P.architect&&W.push({id:"architect",type:"architect",label:"Architect",closable:!1,terminalId:P.architect.terminalId,persistent:P.architect.persistent});for(const X of(P==null?void 0:P.builders)??[])W.push({id:X.id,type:"builder",label:X.name||`Builder ${X.id}`,closable:!0,projectId:X.id,terminalId:X.terminalId,persistent:X.persistent});for(const X of(P==null?void 0:P.utils)??[])!X.terminalId&&(!X.pid||X.pid===0)||W.push({id:X.id,type:"shell",label:X.name||`Shell ${X.id}`,closable:!0,utilId:X.id,terminalId:X.terminalId,persistent:X.persistent});for(const X of(P==null?void 0:P.annotations)??[]){const I=X.file.split("/").pop()??X.file;W.push({id:X.id,type:"file",label:I,closable:!0,annotationId:X.id,filePath:X.file})}return W}function Jv(P){const[W,X]=we.useState("dashboard"),I=we.useRef(null),J=we.useRef(!1),ie=Zv(P);we.useEffect(()=>{if(J.current||P===null)return;const d=new URLSearchParams(window.location.search).get("tab");if(d){const _=ie.find(a=>a.id===d||a.type===d);if(_){X(_.id),J.current=!0;const a=new URL(window.location.href);a.searchParams.delete("tab"),window.history.replaceState({},"",a.toString())}}else J.current=!0},[ie,P]),we.useEffect(()=>{const u=new Set(ie.map(d=>d.id));if(I.current===null){P!==null&&(I.current=u);return}for(const d of ie)!I.current.has(d.id)&&d.type!=="architect"&&X(d.id);I.current=u},[ie.map(u=>u.id).join(","),P!==null]);const F=we.useCallback(u=>{X(u)},[]),n=ie.find(u=>u.id===W)??ie[0];return{tabs:ie,activeTab:n,activeTabId:W,selectTab:F}}function cf(P){const[W,X]=we.useState(()=>typeof window<"u"?window.matchMedia(P).matches:!1);return we.useEffect(()=>{const I=window.matchMedia(P),J=ie=>X(ie.matches);return I.addEventListener("change",J),X(I.matches),()=>I.removeEventListener("change",J)},[P]),W}function eg({left:P,right:W,defaultSplit:X=50}){const[I,J]=we.useState(X),ie=we.useRef(null),F=we.useRef(!1),n=we.useCallback(u=>{u.preventDefault(),F.current=!0;const d=a=>{if(!F.current||!ie.current)return;const p=ie.current.getBoundingClientRect(),w=(a.clientX-p.left)/p.width*100;J(Math.max(20,Math.min(80,w)))},_=()=>{F.current=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",_)},[]);return Q.jsxs("div",{ref:ie,className:"split-pane",children:[Q.jsx("div",{className:"split-left",style:{width:`${I}%`},children:P}),Q.jsx("div",{className:"split-handle",onMouseDown:n,role:"separator","aria-label":"Resize panels"}),Q.jsx("div",{className:"split-right",style:{width:`${100-I}%`},children:W})]})}function hf({tabs:P,activeTabId:W,onSelectTab:X,onRefresh:I}){const J=async(ie,F)=>{ie.stopPropagation();try{await Xv(F.id),I()}catch(n){console.error("Failed to close tab:",n)}};return Q.jsx("div",{className:"tab-bar",role:"tablist","aria-label":"Content tabs",children:P.map(ie=>Q.jsxs("button",{role:"tab","aria-selected":ie.id===W,className:`tab ${ie.id===W?"tab-active":""}`,onClick:()=>X(ie.id),title:ie.label,children:[Q.jsx("span",{className:"tab-label",children:ie.label}),ie.closable&&Q.jsx("span",{className:"tab-close",onClick:F=>J(F,ie),role:"button","aria-label":`Close ${ie.label}`,tabIndex:0,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),J(F,ie))},children:"×"})]},ie.id))})}var ko={exports:{}},Kd;function tg(){return Kd||(Kd=1,(function(P,W){(function(X,I){P.exports=I()})(globalThis,(()=>(()=>{var X={4567:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const a=u(9042),p=u(9924),w=u(844),b=u(4725),o=u(2585),r=u(3656);let h=n.AccessibilityManager=class extends w.Disposable{constructor(c,l,S,x){super(),this._terminal=c,this._coreBrowserService=S,this._renderService=x,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 v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,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 p.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((v=>this._handleResize(v.rows)))),this.register(this._terminal.onRender((v=>this._refreshRows(v.start,v.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((v=>this._handleChar(v)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
50
50
  `)))),this.register(this._terminal.onA11yTab((v=>this._handleTab(v)))),this.register(this._terminal.onKey((v=>this._handleKey(v.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(c){for(let l=0;l<c;l++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
51
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,l){this._liveRegionDebouncer.refresh(c,l,this._terminal.rows)}_renderRows(c,l){const S=this._terminal.buffer,x=S.lines.length.toString();for(let v=c;v<=l;v++){const y=S.lines.get(S.ydisp+v),m=[],C=(y==null?void 0:y.translateToString(!0,void 0,void 0,m))||"",L=(S.ydisp+v+1).toString(),A=this._rowElements[v];A&&(C.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=C,this._rowColumns.set(A,m)),A.setAttribute("aria-posinset",L),A.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,l){const S=c.target,x=this._rowElements[l===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let v,y;if(l===0?(v=S,y=this._rowElements.pop(),this._rowContainer.removeChild(y)):(v=this._rowElements.shift(),y=S,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),y.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleSelectionChange(){var C;if(this._rowElements.length===0)return;const c=document.getSelection();if(!c)return;if(c.isCollapsed)return void(this._rowContainer.contains(c.anchorNode)&&this._terminal.clearSelection());if(!c.anchorNode||!c.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:c.anchorNode,offset:c.anchorOffset},S={node:c.focusNode,offset:c.focusOffset};if((l.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===S.node&&l.offset>S.offset)&&([l,S]=[S,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const x=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:x,offset:((C=x.textContent)==null?void 0:C.length)??0}),!this._rowContainer.contains(S.node))return;const v=({node:L,offset:A})=>{const E=L instanceof Text?L.parentNode:L;let R=parseInt(E==null?void 0:E.getAttribute("aria-posinset"),10)-1;if(isNaN(R))return console.warn("row is invalid. Race condition?"),null;const k=this._rowColumns.get(E);if(!k)return console.warn("columns is null. Race condition?"),null;let $=A<k.length?k[A]:k.slice(-1)[0]+1;return $>=this._terminal.cols&&(++R,$=0),{row:R,column:$}},y=v(l),m=v(S);if(y&&m){if(y.row>m.row||y.row===m.row&&y.column>=m.column)throw new Error("invalid range");this._terminal.select(y.column,y.row,(m.row-y.row)*this._terminal.cols-y.column+m.column)}}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=this._coreBrowserService.mainDocument.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=h=d([_(1,o.IInstantiationService),_(2,b.ICoreBrowserService),_(3,b.IRenderService)],h)},3614:(F,n)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function d(p,w){return w?"\x1B[200~"+p+"\x1B[201~":p}function _(p,w,b,o){p=d(p=u(p),b.decPrivateModes.bracketedPasteMode&&o.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(p,!0),w.value=""}function a(p,w,b){const o=b.getBoundingClientRect(),r=p.clientX-o.left-10,h=p.clientY-o.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${r}px`,w.style.top=`${h}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=u,n.bracketTextForPaste=d,n.copyHandler=function(p,w){p.clipboardData&&p.clipboardData.setData("text/plain",w.selectionText),p.preventDefault()},n.handlePasteEvent=function(p,w,b,o){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),w,b,o)},n.paste=_,n.moveTextAreaUnderMouseCursor=a,n.rightClickHandler=function(p,w,b,o,r){a(p,w,b),r&&o.rightClickSelect(p),w.value=o.selectionText,w.select()}},7239:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=u(1505);n.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,a,p){this._css.set(_,a,p)}getCss(_,a){return this._css.get(_,a)}setColor(_,a,p){this._color.set(_,a,p)}getColor(_,a){return this._color.get(_,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,_,a))}}}},3551:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const a=u(3656),p=u(8460),w=u(844),b=u(2585),o=u(4725);let r=n.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(h,c,l,S,x){super(),this._element=h,this._mouseService=c,this._renderService=l,this._bufferService=S,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var v;this._lastMouseEvent=void 0,(v=this._activeProviderReplies)==null||v.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!c)return;this._isMouseOut=!1;const l=h.composedPath();for(let S=0;S<l.length;S++){const x=l[S];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&c.x===this._lastBufferCell.x&&c.y===this._lastBufferCell.y||(this._handleHover(c),this._lastBufferCell=c)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,c){var S,x;this._activeProviderReplies&&c||((S=this._activeProviderReplies)==null||S.forEach((v=>{v==null||v.forEach((y=>{y.link.dispose&&y.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let l=!1;for(const[v,y]of this._linkProviderService.linkProviders.entries())c?(x=this._activeProviderReplies)!=null&&x.get(v)&&(l=this._checkLinkProviderResult(v,h,l)):y.provideLinks(h.y,(m=>{var L,A;if(this._isMouseOut)return;const C=m==null?void 0:m.map((E=>({link:E})));(L=this._activeProviderReplies)==null||L.set(v,C),l=this._checkLinkProviderResult(v,h,l),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,c){const l=new Set;for(let S=0;S<c.size;S++){const x=c.get(S);if(x)for(let v=0;v<x.length;v++){const y=x[v],m=y.link.range.start.y<h?0:y.link.range.start.x,C=y.link.range.end.y>h?this._bufferService.cols:y.link.range.end.x;for(let L=m;L<=C;L++){if(l.has(L)){x.splice(v--,1);break}l.add(L)}}}}_checkLinkProviderResult(h,c,l){var v;if(!this._activeProviderReplies)return l;const S=this._activeProviderReplies.get(h);let x=!1;for(let y=0;y<h;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(x=!0);if(!x&&S){const y=S.find((m=>this._linkAtPosition(m.link,c)));y&&(l=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let y=0;y<this._activeProviderReplies.size;y++){const m=(v=this._activeProviderReplies.get(y))==null?void 0:v.find((C=>this._linkAtPosition(C.link,c)));if(m){l=!0,this._handleNewLink(m);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);c&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,c)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,c){this._currentLink&&this._lastMouseEvent&&(!h||!c||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=c)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._linkAtPosition(h.link,c)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var l,S;return(S=(l=this._currentLink)==null?void 0:l.state)==null?void 0:S.decorations.pointerCursor},set:l=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,S;return(S=(l=this._currentLink)==null?void 0:l.state)==null?void 0:S.decorations.underline},set:l=>{var S,x,v;(S=this._currentLink)!=null&&S.state&&((v=(x=this._currentLink)==null?void 0:x.state)==null?void 0:v.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const S=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(S,x),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}}))))}_linkHover(h,c,l){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),c.hover&&c.hover(l,c.text)}_fireUnderlineEvent(h,c){const l=h.range,S=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-S-1,l.end.x,l.end.y-S-1,void 0);(c?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(h,c,l){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),c.leave&&c.leave(l,c.text)}_linkAtPosition(h,c){const l=h.range.start.y*this._bufferService.cols+h.range.start.x,S=h.range.end.y*this._bufferService.cols+h.range.end.x,x=c.y*this._bufferService.cols+c.x;return l<=x&&x<=S}_positionFromMouseEvent(h,c,l){const S=l.getCoords(h,c,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,c,l,S,x){return{x1:h,y1:c,x2:l,y2:S,cols:this._bufferService.cols,fg:x}}};n.Linkifier=r=d([_(1,o.IMouseService),_(2,o.IRenderService),_(3,b.IBufferService),_(4,o.ILinkProviderService)],r)},9042:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const a=u(511),p=u(2585);let w=n.OscLinkProvider=class{constructor(o,r,h){this._bufferService=o,this._optionsService=r,this._oscLinkService=h}provideLinks(o,r){var C;const h=this._bufferService.buffer.lines.get(o-1);if(!h)return void r(void 0);const c=[],l=this._optionsService.rawOptions.linkHandler,S=new a.CellData,x=h.getTrimmedLength();let v=-1,y=-1,m=!1;for(let L=0;L<x;L++)if(y!==-1||h.hasContent(L)){if(h.loadCell(L,S),S.hasExtendedAttrs()&&S.extended.urlId){if(y===-1){y=L,v=S.extended.urlId;continue}m=S.extended.urlId!==v}else y!==-1&&(m=!0);if(m||y!==-1&&L===x-1){const A=(C=this._oscLinkService.getLinkData(v))==null?void 0:C.uri;if(A){const E={start:{x:y+1,y:o},end:{x:L+(m||L!==x-1?0:1),y:o}};let R=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const k=new URL(A);["http:","https:"].includes(k.protocol)||(R=!0)}catch{R=!0}R||c.push({text:A,range:E,activate:(k,$)=>l?l.activate(k,$,E):b(0,$),hover:(k,$)=>{var N;return(N=l==null?void 0:l.hover)==null?void 0:N.call(l,k,$,E)},leave:(k,$)=>{var N;return(N=l==null?void 0:l.leave)==null?void 0:N.call(l,k,$,E)}})}m=!1,S.hasExtendedAttrs()&&S.extended.urlId?(y=L,v=S.extended.urlId):(y=-1,v=-1)}}r(c)}};function b(o,r){if(confirm(`Do you want to navigate to ${r}?
51
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,l){this._liveRegionDebouncer.refresh(c,l,this._terminal.rows)}_renderRows(c,l){const S=this._terminal.buffer,x=S.lines.length.toString();for(let v=c;v<=l;v++){const y=S.lines.get(S.ydisp+v),m=[],C=(y==null?void 0:y.translateToString(!0,void 0,void 0,m))||"",L=(S.ydisp+v+1).toString(),R=this._rowElements[v];R&&(C.length===0?(R.innerText=" ",this._rowColumns.set(R,[0,1])):(R.textContent=C,this._rowColumns.set(R,m)),R.setAttribute("aria-posinset",L),R.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,l){const S=c.target,x=this._rowElements[l===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let v,y;if(l===0?(v=S,y=this._rowElements.pop(),this._rowContainer.removeChild(y)):(v=this._rowElements.shift(),y=S,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),y.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleSelectionChange(){var C;if(this._rowElements.length===0)return;const c=document.getSelection();if(!c)return;if(c.isCollapsed)return void(this._rowContainer.contains(c.anchorNode)&&this._terminal.clearSelection());if(!c.anchorNode||!c.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:c.anchorNode,offset:c.anchorOffset},S={node:c.focusNode,offset:c.focusOffset};if((l.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===S.node&&l.offset>S.offset)&&([l,S]=[S,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const x=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:x,offset:((C=x.textContent)==null?void 0:C.length)??0}),!this._rowContainer.contains(S.node))return;const v=({node:L,offset:R})=>{const E=L instanceof Text?L.parentNode:L;let D=parseInt(E==null?void 0:E.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const O=this._rowColumns.get(E);if(!O)return console.warn("columns is null. Race condition?"),null;let $=R<O.length?O[R]:O.slice(-1)[0]+1;return $>=this._terminal.cols&&(++D,$=0),{row:D,column:$}},y=v(l),m=v(S);if(y&&m){if(y.row>m.row||y.row===m.row&&y.column>=m.column)throw new Error("invalid range");this._terminal.select(y.column,y.row,(m.row-y.row)*this._terminal.cols-y.column+m.column)}}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=this._coreBrowserService.mainDocument.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=h=d([_(1,o.IInstantiationService),_(2,b.ICoreBrowserService),_(3,b.IRenderService)],h)},3614:(F,n)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function d(p,w){return w?"\x1B[200~"+p+"\x1B[201~":p}function _(p,w,b,o){p=d(p=u(p),b.decPrivateModes.bracketedPasteMode&&o.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(p,!0),w.value=""}function a(p,w,b){const o=b.getBoundingClientRect(),r=p.clientX-o.left-10,h=p.clientY-o.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${r}px`,w.style.top=`${h}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=u,n.bracketTextForPaste=d,n.copyHandler=function(p,w){p.clipboardData&&p.clipboardData.setData("text/plain",w.selectionText),p.preventDefault()},n.handlePasteEvent=function(p,w,b,o){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),w,b,o)},n.paste=_,n.moveTextAreaUnderMouseCursor=a,n.rightClickHandler=function(p,w,b,o,r){a(p,w,b),r&&o.rightClickSelect(p),w.value=o.selectionText,w.select()}},7239:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=u(1505);n.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,a,p){this._css.set(_,a,p)}getCss(_,a){return this._css.get(_,a)}setColor(_,a,p){this._color.set(_,a,p)}getColor(_,a){return this._color.get(_,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,_,a))}}}},3551:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const a=u(3656),p=u(8460),w=u(844),b=u(2585),o=u(4725);let r=n.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(h,c,l,S,x){super(),this._element=h,this._mouseService=c,this._renderService=l,this._bufferService=S,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var v;this._lastMouseEvent=void 0,(v=this._activeProviderReplies)==null||v.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!c)return;this._isMouseOut=!1;const l=h.composedPath();for(let S=0;S<l.length;S++){const x=l[S];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&c.x===this._lastBufferCell.x&&c.y===this._lastBufferCell.y||(this._handleHover(c),this._lastBufferCell=c)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,c){var S,x;this._activeProviderReplies&&c||((S=this._activeProviderReplies)==null||S.forEach((v=>{v==null||v.forEach((y=>{y.link.dispose&&y.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let l=!1;for(const[v,y]of this._linkProviderService.linkProviders.entries())c?(x=this._activeProviderReplies)!=null&&x.get(v)&&(l=this._checkLinkProviderResult(v,h,l)):y.provideLinks(h.y,(m=>{var L,R;if(this._isMouseOut)return;const C=m==null?void 0:m.map((E=>({link:E})));(L=this._activeProviderReplies)==null||L.set(v,C),l=this._checkLinkProviderResult(v,h,l),((R=this._activeProviderReplies)==null?void 0:R.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,c){const l=new Set;for(let S=0;S<c.size;S++){const x=c.get(S);if(x)for(let v=0;v<x.length;v++){const y=x[v],m=y.link.range.start.y<h?0:y.link.range.start.x,C=y.link.range.end.y>h?this._bufferService.cols:y.link.range.end.x;for(let L=m;L<=C;L++){if(l.has(L)){x.splice(v--,1);break}l.add(L)}}}}_checkLinkProviderResult(h,c,l){var v;if(!this._activeProviderReplies)return l;const S=this._activeProviderReplies.get(h);let x=!1;for(let y=0;y<h;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(x=!0);if(!x&&S){const y=S.find((m=>this._linkAtPosition(m.link,c)));y&&(l=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let y=0;y<this._activeProviderReplies.size;y++){const m=(v=this._activeProviderReplies.get(y))==null?void 0:v.find((C=>this._linkAtPosition(C.link,c)));if(m){l=!0,this._handleNewLink(m);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const c=this._positionFromMouseEvent(h,this._element,this._mouseService);c&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,c)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,c){this._currentLink&&this._lastMouseEvent&&(!h||!c||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=c)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._linkAtPosition(h.link,c)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var l,S;return(S=(l=this._currentLink)==null?void 0:l.state)==null?void 0:S.decorations.pointerCursor},set:l=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,S;return(S=(l=this._currentLink)==null?void 0:l.state)==null?void 0:S.decorations.underline},set:l=>{var S,x,v;(S=this._currentLink)!=null&&S.state&&((v=(x=this._currentLink)==null?void 0:x.state)==null?void 0:v.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const S=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(S,x),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}}))))}_linkHover(h,c,l){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),c.hover&&c.hover(l,c.text)}_fireUnderlineEvent(h,c){const l=h.range,S=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-S-1,l.end.x,l.end.y-S-1,void 0);(c?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(h,c,l){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),c.leave&&c.leave(l,c.text)}_linkAtPosition(h,c){const l=h.range.start.y*this._bufferService.cols+h.range.start.x,S=h.range.end.y*this._bufferService.cols+h.range.end.x,x=c.y*this._bufferService.cols+c.x;return l<=x&&x<=S}_positionFromMouseEvent(h,c,l){const S=l.getCoords(h,c,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,c,l,S,x){return{x1:h,y1:c,x2:l,y2:S,cols:this._bufferService.cols,fg:x}}};n.Linkifier=r=d([_(1,o.IMouseService),_(2,o.IRenderService),_(3,b.IBufferService),_(4,o.ILinkProviderService)],r)},9042:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const a=u(511),p=u(2585);let w=n.OscLinkProvider=class{constructor(o,r,h){this._bufferService=o,this._optionsService=r,this._oscLinkService=h}provideLinks(o,r){var C;const h=this._bufferService.buffer.lines.get(o-1);if(!h)return void r(void 0);const c=[],l=this._optionsService.rawOptions.linkHandler,S=new a.CellData,x=h.getTrimmedLength();let v=-1,y=-1,m=!1;for(let L=0;L<x;L++)if(y!==-1||h.hasContent(L)){if(h.loadCell(L,S),S.hasExtendedAttrs()&&S.extended.urlId){if(y===-1){y=L,v=S.extended.urlId;continue}m=S.extended.urlId!==v}else y!==-1&&(m=!0);if(m||y!==-1&&L===x-1){const R=(C=this._oscLinkService.getLinkData(v))==null?void 0:C.uri;if(R){const E={start:{x:y+1,y:o},end:{x:L+(m||L!==x-1?0:1),y:o}};let D=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const O=new URL(R);["http:","https:"].includes(O.protocol)||(D=!0)}catch{D=!0}D||c.push({text:R,range:E,activate:(O,$)=>l?l.activate(O,$,E):b(0,$),hover:(O,$)=>{var U;return(U=l==null?void 0:l.hover)==null?void 0:U.call(l,O,$,E)},leave:(O,$)=>{var U;return(U=l==null?void 0:l.leave)==null?void 0:U.call(l,O,$,E)}})}m=!1,S.hasExtendedAttrs()&&S.extended.urlId?(y=L,v=S.extended.urlId):(y=-1,v=-1)}}r(c)}};function b(o,r){if(confirm(`Do you want to navigate to ${r}?
52
52
 
53
- WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=w=d([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],w)},6193:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=u(3614),_=u(3656),a=u(3551),p=u(9042),w=u(3730),b=u(1680),o=u(3107),r=u(5744),h=u(2950),c=u(1296),l=u(428),S=u(4269),x=u(5114),v=u(8934),y=u(3230),m=u(9312),C=u(4725),L=u(6731),A=u(8055),E=u(8969),R=u(8460),k=u(844),$=u(6114),N=u(8437),P=u(2584),j=u(7399),D=u(5941),O=u(9074),T=u(2585),B=u(5435),q=u(4567),K=u(779);class oe extends E.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(W={}){super(W),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new k.MutableDisposable),this._onCursorMove=this.register(new R.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new R.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new R.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new R.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new R.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new R.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new R.EventEmitter),this._onBlur=this.register(new R.EventEmitter),this._onA11yCharEmitter=this.register(new R.EventEmitter),this._onA11yTabEmitter=this.register(new R.EventEmitter),this._onWillOpen=this.register(new R.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((z,re)=>this.refresh(z,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((z=>this._reportWindowsOptions(z)))),this.register(this._inputHandler.onColor((z=>this._handleColorEvent(z)))),this.register((0,R.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,R.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((z=>this._afterResize(z.cols,z.rows)))),this.register((0,k.toDisposable)((()=>{var z,re;this._customKeyEventHandler=void 0,(re=(z=this.element)==null?void 0:z.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const z of W){let re,ee="";switch(z.index){case 256:re="foreground",ee="10";break;case 257:re="background",ee="11";break;case 258:re="cursor",ee="12";break;default:re="ansi",ee="4;"+z.index}switch(z.type){case 0:const ve=A.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${P.C0.ESC}]${ee};${(0,D.toRgbString)(ve)}${P.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((fe=>fe.ansi[z.index]=A.channels.toColor(...z.color)));else{const fe=re;this._themeService.modifyColors((Me=>Me[fe]=A.channels.toColor(...z.color)))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const W=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(W);if(!z)return;const re=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,ve=z.getWidth(re),fe=this._renderService.dimensions.css.cell.width*ve,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=Me+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(z=>{this.hasSelection()&&(0,d.copyHandler)(z,this._selectionService)})));const W=z=>(0,d.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,_.addDisposableDomListener)(this.element,"paste",W)),$.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(z=>{z.button===2&&(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(z=>{(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(z=>{z.button===1&&(0,d.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var re;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),W.appendChild(this.element);const z=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),z.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,_.addDisposableDomListener)(this.screenElement,"mousemove",(ee=>this.updateCursorStyle(ee)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),z.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),$.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(x.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(C.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(C.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(C.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(y.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(C.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(C.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(z);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(C.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(o.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ee=>this._selectionService.handleMouseDown(ee)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(c.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,z=this.element;function re(fe){const Me=W._mouseService.getMouseReportCoords(fe,W.screenElement);if(!Me)return!1;let _e,Oe;switch(fe.overrideType||fe.type){case"mousemove":Oe=32,fe.buttons===void 0?(_e=3,fe.button!==void 0&&(_e=fe.button<3?fe.button:3)):_e=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Oe=0,_e=fe.button<3?fe.button:3;break;case"mousedown":Oe=1,_e=fe.button<3?fe.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(fe)===!1||W.viewport.getLinesScrolled(fe)===0)return!1;Oe=fe.deltaY<0?0:1,_e=4;break;default:return!1}return!(Oe===void 0||_e===void 0||_e>4)&&W.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:_e,action:Oe,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:fe=>(re(fe),fe.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(fe)),wheel:fe=>(re(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&re(fe)},mousemove:fe=>{fe.buttons||re(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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&fe?ee.mousemove||(z.addEventListener("mousemove",ve.mousemove),ee.mousemove=ve.mousemove):(z.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&fe?ee.wheel||(z.addEventListener("wheel",ve.wheel,{passive:!1}),ee.wheel=ve.wheel):(z.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&fe?ee.mouseup||(ee.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&fe?ee.mousedrag||(ee.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(z,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return re(fe),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(fe)}))),this.register((0,_.addDisposableDomListener)(z,"wheel",(fe=>{if(!ee.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(fe);if(Me===0)return;const _e=P.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Oe="";for(let qe=0;qe<Math.abs(Me);qe++)Oe+=_e;return this.coreService.triggerDataEvent(Oe,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(z,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(z,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(W,z){var re;(re=this._renderService)==null||re.refreshRows(W,z)}updateCursorStyle(W){var z;(z=this._selectionService)!=null&&z.shouldColumnSelect(W)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(W,z,re=0){var ee;re===1?(super.scrollLines(W,z,re),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(W)}paste(W){(0,d.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,z,re){this._selectionService.setSelection(W,z,re)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,z){var re;(re=this._selectionService)==null||re.selectLines(W,z)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!z&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,j.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),re.type===3||re.type===2){const ee=this.rows-1;return this.scrollLines(re.type===2?-ee:ee),this.cancel(W,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(re.cancel&&this.cancel(W,!0),!re.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==P.C0.ETX&&re.key!==P.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,z){const re=W.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||W.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||W.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?re:re&&(!z.keyCode||z.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)z=W.charCode;else if(W.which===null||W.which===void 0)z=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;z=W.which}return!(!z||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=W.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(W),!0}return!1}resize(W,z){W!==this.cols||z!==this.rows?super.resize(W,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,z){var re,ee;(re=this._charSizeService)==null||re.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var W;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(N.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var z,re;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(z=this._selectionService)==null||z.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(P.C0.ESC+"[I"):this.coreService.triggerDataEvent(P.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[4;${re};${z}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[6;${ve};${ee}t`)}}cancel(W,z){if(this.options.cancelEvents||z)return W.preventDefault(),W.stopPropagation(),!1}}n.Terminal=oe},9924:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=a-this._lastRefreshMs,w=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const a=u(3656),p=u(4725),w=u(8460),b=u(844),o=u(2585);let r=n.Viewport=class extends b.Disposable{constructor(h,c,l,S,x,v,y,m){super(),this._viewportElement=h,this._scrollArea=c,this._bufferService=l,this._optionsService=S,this._charSizeService=x,this._renderService=v,this._coreBrowserService=y,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((C=>this._renderDimensions=C))),this._handleThemeChange(m.colors),this.register(m.onChangeColors((C=>this._handleThemeChange(C)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 c=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==c&&(this._lastRecordedBufferHeight=c,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 c=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,c){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(c<0&&this._viewportElement.scrollTop!==0||c>0&&l<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const c=this._getPixelsScrolled(h);return c!==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+c:this._smoothScrollState.target+=c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const c=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?c*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._currentRowHeight*this._bufferService.rows),c}getBufferElements(h,c){var m;let l,S="";const x=[],v=c??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let C=h;C<v;C++){const L=y.get(C);if(!L)continue;const A=(m=y.get(C+1))==null?void 0:m.isWrapped;if(S+=L.translateToString(!A),!A||C===y.length-1){const E=document.createElement("div");E.textContent=S,x.push(E),S.length>0&&(l=E),S=""}}return{bufferElements:x,cursorElement:l}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(c/=this._currentRowHeight+0,this._wheelPartialScroll+=c,c=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._bufferService.rows),c}_applyScrollModifier(h,c){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&c.altKey||l==="ctrl"&&c.ctrlKey||l==="shift"&&c.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const c=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}};n.Viewport=r=d([_(2,o.IBufferService),_(3,o.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],r)},3107:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const a=u(4725),p=u(844),w=u(2585);let b=n.BufferDecorationRenderer=class extends p.Disposable{constructor(o,r,h,c,l){super(),this._screenElement=o,this._bufferService=r,this._coreBrowserService=h,this._decorationService=c,this._renderService=l,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((S=>this._removeDecoration(S)))),this.register((0,p.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 o of this._decorationService.decorations)this._renderDecoration(o);this._dimensionsChanged=!1}_renderDecoration(o){this._refreshStyle(o),this._dimensionsChanged&&this._refreshXPosition(o)}_createElement(o){var c;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((c=o==null?void 0:o.options)==null?void 0:c.layer)==="top"),r.style.width=`${Math.round((o.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(o.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(o.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=o.options.x??0;return h&&h>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(o,r),r}_refreshStyle(o){const r=o.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)o.element&&(o.element.style.display="none",o.onRenderEmitter.fire(o.element));else{let h=this._decorationElements.get(o);h||(h=this._createElement(o),o.element=h,this._decorationElements.set(o,h),this._container.appendChild(h),o.onDispose((()=>{this._decorationElements.delete(o),h.remove()}))),h.style.top=r*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",o.onRenderEmitter.fire(h)}}_refreshXPosition(o,r=o.element){if(!r)return;const h=o.options.x??0;(o.options.anchor||"left")==="right"?r.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(o){var r;(r=this._decorationElements.get(o))==null||r.remove(),this._decorationElements.delete(o),o.dispose()}};n.BufferDecorationRenderer=b=d([_(1,w.IBufferService),_(2,a.ICoreBrowserService),_(3,w.IDecorationService),_(4,a.IRenderService)],b)},5871:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,_){return d>=u.startBufferLine-this._linePadding[_||"full"]&&d<=u.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(F,n,u){var d=this&&this.__decorate||function(l,S,x,v){var y,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,S,x,v);else for(var L=l.length-1;L>=0;L--)(y=l[L])&&(C=(m<3?y(C):m>3?y(S,x,C):y(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(l,S){return function(x,v){S(x,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const a=u(5871),p=u(4725),w=u(844),b=u(2585),o={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let c=n.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,S,x,v,y,m,C){var A;super(),this._viewportElement=l,this._screenElement=S,this._bufferService=x,this._decorationService=v,this._renderService=y,this._optionsService=m,this._coreBrowserService=C,this._colorZoneStore=new a.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(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var E;(E=this._canvas)==null||E.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 l=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=l,r.center=S,r.right=l,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=r.left,h.right=r.left+r.center}_refreshDrawHeightConstants(){o.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);o.left=S,o.center=S,o.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const S of l)S.position!=="full"&&this._renderColorZone(S);for(const S of l)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(h[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-o[l.position||"full"]/2),r[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+o[l.position||"full"]))}_queueRefresh(l,S){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=c=d([_(2,b.IBufferService),_(3,b.IDecorationService),_(4,p.IRenderService),_(5,b.IOptionsService),_(6,p.ICoreBrowserService)],c)},2950:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const a=u(4725),p=u(2585),w=u(2584);let b=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(o,r,h,c,l,S){this._textarea=o,this._compositionView=r,this._bufferService=h,this._optionsService=c,this._coreService=l,this._renderService=S,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(o){this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229||o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(o){if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const o=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,h=r.replace(o,"");this._dataAlreadySent=h,r.length>o.length?this._coreService.triggerDataEvent(h,!0):r.length<o.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):r.length===o.length&&r!==o&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(o){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,c=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}o||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=b=d([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,a.IRenderService)],b)},9806:(F,n)=>{function u(d,_,a){const p=a.getBoundingClientRect(),w=d.getComputedStyle(a),b=parseInt(w.getPropertyValue("padding-left")),o=parseInt(w.getPropertyValue("padding-top"));return[_.clientX-p.left-b,_.clientY-p.top-o]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(d,_,a,p,w,b,o,r,h){if(!b)return;const c=u(d,_,a);return c?(c[0]=Math.ceil((c[0]+(h?o/2:0))/o),c[1]=Math.ceil(c[1]/r),c[0]=Math.min(Math.max(c[0],1),p+(h?1:0)),c[1]=Math.min(Math.max(c[1],1),w),c):void 0}},9504:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=u(2584);function _(r,h,c,l){const S=r-a(r,c),x=h-a(h,c),v=Math.abs(S-x)-(function(y,m,C){let L=0;const A=y-a(y,C),E=m-a(m,C);for(let R=0;R<Math.abs(A-E);R++){const k=p(y,m)==="A"?-1:1,$=C.buffer.lines.get(A+k*R);$!=null&&$.isWrapped&&L++}return L})(r,h,c);return o(v,b(p(r,h),l))}function a(r,h){let c=0,l=h.buffer.lines.get(r),S=l==null?void 0:l.isWrapped;for(;S&&r>=0&&r<h.rows;)c++,l=h.buffer.lines.get(--r),S=l==null?void 0:l.isWrapped;return c}function p(r,h){return r>h?"A":"B"}function w(r,h,c,l,S,x){let v=r,y=h,m="";for(;v!==c||y!==l;)v+=S?1:-1,S&&v>x.cols-1?(m+=x.buffer.translateBufferLineToString(y,!1,r,v),v=0,r=0,y++):!S&&v<0&&(m+=x.buffer.translateBufferLineToString(y,!1,0,r+1),v=x.cols-1,r=v,y--);return m+x.buffer.translateBufferLineToString(y,!1,r,v)}function b(r,h){const c=h?"O":"[";return d.C0.ESC+c+r}function o(r,h){r=Math.floor(r);let c="";for(let l=0;l<r;l++)c+=h;return c}n.moveToCellSequence=function(r,h,c,l){const S=c.buffer.x,x=c.buffer.y;if(!c.buffer.hasScrollback)return(function(m,C,L,A,E,R){return _(C,A,E,R).length===0?"":o(w(m,C,m,C-a(C,E),!1,E).length,b("D",R))})(S,x,0,h,c,l)+_(x,h,c,l)+(function(m,C,L,A,E,R){let k;k=_(C,A,E,R).length>0?A-a(A,E):C;const $=A,N=(function(P,j,D,O,T,B){let q;return q=_(D,O,T,B).length>0?O-a(O,T):j,P<D&&q<=O||P>=D&&q<O?"C":"D"})(m,C,L,A,E,R);return o(w(m,k,L,$,N==="C",E).length,b(N,R))})(S,x,r,h,c,l);let v;if(x===h)return v=S>r?"D":"C",o(Math.abs(S-r),b(v,l));v=x>h?"D":"C";const y=Math.abs(x-h);return o((function(m,C){return C.cols-m})(x>h?r:S,c)+(y-1)*c.cols+1+((x>h?S:r)-1),b(v,l))}},1296:function(F,n,u){var d=this&&this.__decorate||function(R,k,$,N){var P,j=arguments.length,D=j<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,$):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(R,k,$,N);else for(var O=R.length-1;O>=0;O--)(P=R[O])&&(D=(j<3?P(D):j>3?P(k,$,D):P(k,$))||D);return j>3&&D&&Object.defineProperty(k,$,D),D},_=this&&this.__param||function(R,k){return function($,N){k($,N,R)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const a=u(3787),p=u(2550),w=u(2223),b=u(6171),o=u(6052),r=u(4725),h=u(8055),c=u(8460),l=u(844),S=u(2585),x="xterm-dom-renderer-owner-",v="xterm-rows",y="xterm-fg-",m="xterm-bg-",C="xterm-focus",L="xterm-selection";let A=1,E=n.DomRenderer=class extends l.Disposable{constructor(R,k,$,N,P,j,D,O,T,B,q,K,oe){super(),this._terminal=R,this._document=k,this._element=$,this._screenElement=N,this._viewportElement=P,this._helperContainer=j,this._linkifier2=D,this._charSizeService=T,this._optionsService=B,this._bufferService=q,this._coreBrowserService=K,this._themeService=oe,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,o.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new c.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(v),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.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 R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),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/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const k=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=k,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(R){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let k=`${this._terminalSelector} .${v} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;k+=`${this._terminalSelector} .${v} .xterm-dim { color: ${h.color.multiplyOpacity(R.foreground,.5).css};}`,k+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const $=`blink_underline_${this._terminalClass}`,N=`blink_bar_${this._terminalClass}`,P=`blink_block_${this._terminalClass}`;k+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,k+=`@keyframes ${N} { 50% { box-shadow: none; }}`,k+=`@keyframes ${P} { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,k+=`${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${R.cursor.css} !important; color: ${R.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,k+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[j,D]of R.ansi.entries())k+=`${this._terminalSelector} .${y}${j} { color: ${D.css}; }${this._terminalSelector} .${y}${j}.xterm-dim { color: ${h.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${m}${j} { background-color: ${D.css}; }`;k+=`${this._terminalSelector} .${y}${w.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(R.background).css}; }${this._terminalSelector} .${y}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${m}${w.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=k}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,k){for(let $=this._rowElements.length;$<=k;$++){const N=this._document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>k;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,k){this._refreshRowElements(R,k),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(C),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(C),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,k,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,k,$),this.renderRows(0,this._bufferService.rows-1),!R||!k)return;this._selectionRenderModel.update(this._terminal,R,k,$);const N=this._selectionRenderModel.viewportStartRow,P=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||D<0)return;const O=this._document.createDocumentFragment();if($){const T=R[0]>k[0];O.appendChild(this._createSelectionElement(j,T?k[0]:R[0],T?R[0]:k[0],D-j+1))}else{const T=N===j?R[0]:0,B=j===P?k[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(j,T,B));const q=D-j-1;if(O.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,q)),j!==D){const K=P===D?k[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(D,0,K))}}this._selectionContainer.appendChild(O)}_createSelectionElement(R,k,$,N=1){const P=this._document.createElement("div"),j=k*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*($-k);return j+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-j),P.style.height=N*this.dimensions.css.cell.height+"px",P.style.top=R*this.dimensions.css.cell.height+"px",P.style.left=`${j}px`,P.style.width=`${D}px`,P}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 R of this._rowElements)R.replaceChildren()}renderRows(R,k){const $=this._bufferService.buffer,N=$.ybase+$.y,P=Math.min($.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=R;T<=k;T++){const B=T+$.ydisp,q=this._rowElements[T],K=$.lines.get(B);if(!q||!K)break;q.replaceChildren(...this._rowFactory.createRow(K,B,B===N,D,O,P,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,k,$,N,P,j){$<0&&(R=0),N<0&&(k=0);const D=this._bufferService.rows-1;$=Math.max(Math.min($,D),0),N=Math.max(Math.min(N,D),0),P=Math.min(P,this._bufferService.cols);const O=this._bufferService.buffer,T=O.ybase+O.y,B=Math.min(O.x,P-1),q=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=$;ce<=N;++ce){const W=ce+O.ydisp,z=this._rowElements[ce],re=O.lines.get(W);if(!z||!re)break;z.replaceChildren(...this._rowFactory.createRow(re,W,W===T,K,oe,B,q,this.dimensions.css.cell.width,this._widthCache,j?ce===$?R:0:-1,j?(ce===N?k:P)-1:-1))}}};n.DomRenderer=E=d([_(7,S.IInstantiationService),_(8,r.ICharSizeService),_(9,S.IOptionsService),_(10,S.IBufferService),_(11,r.ICoreBrowserService),_(12,r.IThemeService)],E)},3787:function(F,n,u){var d=this&&this.__decorate||function(v,y,m,C){var L,A=arguments.length,E=A<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,y,m,C);else for(var R=v.length-1;R>=0;R--)(L=v[R])&&(E=(A<3?L(E):A>3?L(y,m,E):L(y,m))||E);return A>3&&E&&Object.defineProperty(y,m,E),E},_=this&&this.__param||function(v,y){return function(m,C){y(m,C,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const a=u(2223),p=u(643),w=u(511),b=u(2585),o=u(8055),r=u(4725),h=u(4269),c=u(6171),l=u(3734);let S=n.DomRendererRowFactory=class{constructor(v,y,m,C,L,A,E){this._document=v,this._characterJoinerService=y,this._optionsService=m,this._coreBrowserService=C,this._coreService=L,this._decorationService=A,this._themeService=E,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,y,m){this._selectionStart=v,this._selectionEnd=y,this._columnSelectMode=m}createRow(v,y,m,C,L,A,E,R,k,$,N){const P=[],j=this._characterJoinerService.getJoinedCharacters(y),D=this._themeService.colors;let O,T=v.getNoBgTrimmedLength();m&&T<A+1&&(T=A+1);let B=0,q="",K=0,oe=0,ce=0,W=!1,z=0,re=!1,ee=0;const ve=[],fe=$!==-1&&N!==-1;for(let Me=0;Me<T;Me++){v.loadCell(Me,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let Oe=!1,qe=Me,be=this._workCell;if(j.length>0&&Me===j[0][0]){Oe=!0;const Le=j.shift();be=new h.JoinedCellData(this._workCell,v.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),qe=Le[1]-1,_e=be.getWidth()}const ft=this._isCellInSelection(Me,y),Ot=m&&Me===A,Se=fe&&Me>=$&&Me<=N;let pe=!1;this._decorationService.forEachDecorationAtCell(Me,y,void 0,(Le=>{pe=!0}));let me=be.getChars()||p.WHITESPACE_CELL_CHAR;if(me===" "&&(be.isUnderline()||be.isOverline())&&(me=" "),ee=_e*R-k.get(me,be.isBold(),be.isItalic()),O){if(B&&(ft&&re||!ft&&!re&&be.bg===K)&&(ft&&re&&D.selectionForeground||be.fg===oe)&&be.extended.ext===ce&&Se===W&&ee===z&&!Ot&&!Oe&&!pe){be.isInvisible()?q+=p.WHITESPACE_CELL_CHAR:q+=me,B++;continue}B&&(O.textContent=q),O=this._document.createElement("span"),B=0,q=""}else O=this._document.createElement("span");if(K=be.bg,oe=be.fg,ce=be.extended.ext,W=Se,z=ee,re=ft,Oe&&A>=Me&&A<=qe&&(A=Me),!this._coreService.isCursorHidden&&Ot&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&ve.push("xterm-cursor-blink"),ve.push(C==="bar"?"xterm-cursor-bar":C==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(be.isBold()&&ve.push("xterm-bold"),be.isItalic()&&ve.push("xterm-italic"),be.isDim()&&ve.push("xterm-dim"),q=be.isInvisible()?p.WHITESPACE_CELL_CHAR:be.getChars()||p.WHITESPACE_CELL_CHAR,be.isUnderline()&&(ve.push(`xterm-underline-${be.extended.underlineStyle}`),q===" "&&(q=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Le=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Le<8&&(Le+=8),O.style.textDecorationColor=D.ansi[Le].css}be.isOverline()&&(ve.push("xterm-overline"),q===" "&&(q=" ")),be.isStrikethrough()&&ve.push("xterm-strikethrough"),Se&&(O.style.textDecoration="underline");let ue=be.getFgColor(),ge=be.getFgColorMode(),ze=be.getBgColor(),Re=be.getBgColorMode();const _t=!!be.isInverse();if(_t){const Le=ue;ue=ze,ze=Le;const xt=ge;ge=Re,Re=xt}let Qe,it,Ie,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(Me,y,void 0,(Le=>{Le.options.layer!=="top"&&Ae||(Le.backgroundColorRGB&&(Re=50331648,ze=Le.backgroundColorRGB.rgba>>8&16777215,Qe=Le.backgroundColorRGB),Le.foregroundColorRGB&&(ge=50331648,ue=Le.foregroundColorRGB.rgba>>8&16777215,it=Le.foregroundColorRGB),Ae=Le.options.layer==="top")})),!Ae&&ft&&(Qe=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,ze=Qe.rgba>>8&16777215,Re=50331648,Ae=!0,D.selectionForeground&&(ge=50331648,ue=D.selectionForeground.rgba>>8&16777215,it=D.selectionForeground)),Ae&&ve.push("xterm-decoration-top"),Re){case 16777216:case 33554432:Ie=D.ansi[ze],ve.push(`xterm-bg-${ze}`);break;case 50331648:Ie=o.channels.toColor(ze>>16,ze>>8&255,255&ze),this._addStyle(O,`background-color:#${x((ze>>>0).toString(16),"0",6)}`);break;default:_t?(Ie=D.foreground,ve.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ie=D.background}switch(Qe||be.isDim()&&(Qe=o.color.multiplyOpacity(Ie,.5)),ge){case 16777216:case 33554432:be.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(O,Ie,D.ansi[ue],be,Qe,void 0)||ve.push(`xterm-fg-${ue}`);break;case 50331648:const Le=o.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(O,Ie,Le,be,Qe,it)||this._addStyle(O,`color:#${x(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Ie,D.foreground,be,Qe,it)||_t&&ve.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ve.length&&(O.className=ve.join(" "),ve.length=0),Ot||Oe||pe?O.textContent=q:B++,ee!==this.defaultSpacing&&(O.style.letterSpacing=`${ee}px`),P.push(O),Me=qe}return O&&B&&(O.textContent=q),P}_applyMinimumContrast(v,y,m,C,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.treatGlyphAsBackgroundColor)(C.getCode()))return!1;const E=this._getContrastCache(C);let R;if(L||A||(R=E.getColor(y.rgba,m.rgba)),R===void 0){const k=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);R=o.color.ensureContrastRatio(L||y,A||m,k),E.setColor((L||y).rgba,(A||m).rgba,R??null)}return!!R&&(this._addStyle(v,`color:${R.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,y){v.setAttribute("style",`${v.getAttribute("style")||""}${y};`)}_isCellInSelection(v,y){const m=this._selectionStart,C=this._selectionEnd;return!(!m||!C)&&(this._columnSelectMode?m[0]<=C[0]?v>=m[0]&&y>=m[1]&&v<C[0]&&y<=C[1]:v<m[0]&&y>=m[1]&&v>=C[0]&&y<=C[1]:y>m[1]&&y<C[1]||m[1]===C[1]&&y===m[1]&&v>=m[0]&&v<C[0]||m[1]<C[1]&&y===C[1]&&v<C[0]||m[1]<C[1]&&y===m[1]&&v>=m[0])}};function x(v,y,m){for(;v.length<m;)v=y+v;return v}n.DomRendererRowFactory=S=d([_(1,r.ICharacterJoinerService),_(2,b.IOptionsService),_(3,r.ICoreBrowserService),_(4,b.ICoreService),_(5,b.IDecorationService),_(6,r.IThemeService)],S)},2550:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 _=u.createElement("span");_.classList.add("xterm-char-measure-element");const a=u.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[_,a,p,w],this._container.appendChild(_),this._container.appendChild(a),this._container.appendChild(p),this._container.appendChild(w),d.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(u,d,_,a){u===this._font&&d===this._fontSize&&_===this._weight&&a===this._weightBold||(this._font=u,this._fontSize=d,this._weight=_,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(u,d,_){let a=0;if(!d&&!_&&u.length===1&&(a=u.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const b=this._measure(u,0);return b>0&&(this._flat[a]=b),b}let p=u;d&&(p+="B"),_&&(p+="I");let w=this._holey.get(p);if(w===void 0){let b=0;d&&(b|=1),_&&(b|=2),w=this._measure(u,b),w>0&&this._holey.set(p,w)}return w}_measure(u,d){const _=this._measureElements[d];return _.textContent=u.repeat(32),_.offsetWidth/32}}},2223:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},6052:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},456:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const a=u(2585),p=u(8460),w=u(844);let b=n.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(c,l,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new r(c,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const c=this._measureStrategy.measure();c.width===this.width&&c.height===this.height||(this.width=c.width,this.height=c.height,this._onCharSizeChange.fire())}};n.CharSizeService=b=d([_(2,a.IOptionsService)],b);class o extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,S){l!==void 0&&l>0&&S!==void 0&&S>0&&(this._result.width=l,this._result.height=S)}}class r extends o{constructor(l,S,x){super(),this._document=l,this._parentElement=S,this._optionsService=x,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 h extends o{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(3734),p=u(643),w=u(511),b=u(2585);class o extends a.AttributeData{constructor(c,l,S){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=l,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=o;let r=n.CharacterJoinerService=class uf{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(c){const l={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(l),l.id}deregister(c){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===c)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(c);if(!l||l.length===0)return[];const S=[],x=l.translateToString(!0);let v=0,y=0,m=0,C=l.getFg(0),L=l.getBg(0);for(let A=0;A<l.getTrimmedLength();A++)if(l.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(A-v>1){const E=this._getJoinedRanges(x,m,y,l,v);for(let R=0;R<E.length;R++)S.push(E[R])}v=A,m=y,C=this._workCell.fg,L=this._workCell.bg}y+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const A=this._getJoinedRanges(x,m,y,l,v);for(let E=0;E<A.length;E++)S.push(A[E])}return S}_getJoinedRanges(c,l,S,x,v){const y=c.substring(l,S);let m=[];try{m=this._characterJoiners[0].handler(y)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(y);for(let A=0;A<L.length;A++)uf._mergeRanges(m,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(c,l,S){let x=0,v=!1,y=0,m=c[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=l.getWidth(C),A=l.getString(C).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=y&&(m[0]=C,v=!0),m[1]<=y){if(m[1]=C,m=c[++x],!m)break;m[0]<=y?(m[0]=C,v=!0):v=!1}y+=A}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(c,l){let S=!1;for(let x=0;x<c.length;x++){const v=c[x];if(S){if(l[1]<=v[0])return c[x-1][1]=l[1],c;if(l[1]<=v[1])return c[x-1][1]=Math.max(l[1],v[1]),c.splice(x,1),c;c.splice(x,1),x--}else{if(l[1]<=v[0])return c.splice(x,0,l),c;if(l[1]<=v[1])return v[0]=Math.min(l[0],v[0]),c;l[0]<v[1]&&(v[0]=Math.min(l[0],v[0]),S=!0)}}return S?c[c.length-1][1]=l[1]:c.push(l),c}};n.CharacterJoinerService=r=d([_(0,b.IBufferService)],r)},5114:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const d=u(844),_=u(8460),a=u(3656);class p extends d.Disposable{constructor(o,r,h){super(),this._textarea=o,this._window=r,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((c=>this._screenDprMonitor.setWindow(c)))),this.register((0,_.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(o){this._window!==o&&(this._window=o,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}}n.CoreBrowserService=p;class w extends d.Disposable{constructor(o){super(),this._parentWindow=o,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(o){this._parentWindow=o,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var o;this._outerListener&&((o=this._resolutionMediaMatchList)==null||o.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,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const d=u(844);class _ extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const w=this.linkProviders.indexOf(p);w!==-1&&this.linkProviders.splice(w,1)}}}}n.LinkProviderService=_},8934:function(F,n,u){var d=this&&this.__decorate||function(b,o,r,h){var c,l=arguments.length,S=l<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,r):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,o,r,h);else for(var x=b.length-1;x>=0;x--)(c=b[x])&&(S=(l<3?c(S):l>3?c(o,r,S):c(o,r))||S);return l>3&&S&&Object.defineProperty(o,r,S),S},_=this&&this.__param||function(b,o){return function(r,h){o(r,h,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const a=u(4725),p=u(9806);let w=n.MouseService=class{constructor(b,o){this._renderService=b,this._charSizeService=o}getCoords(b,o,r,h,c){return(0,p.getCoords)(window,b,o,r,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,c)}getMouseReportCoords(b,o){const r=(0,p.getCoordsRelativeToElement)(window,b,o);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};n.MouseService=w=d([_(0,a.IRenderService),_(1,a.ICharSizeService)],w)},3230:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const a=u(6193),p=u(4725),w=u(8460),b=u(844),o=u(7226),r=u(2585);let h=n.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(c,l,S,x,v,y,m,C){super(),this._rowCount=c,this._charSizeService=x,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._observerDisposable=this.register(new b.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,A)=>this._renderRows(L,A)),m),this.register(this._renderDebouncer),this.register(m.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(y.onResize((()=>this._fullRefresh()))),this.register(y.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(v.onDecorationRegistered((()=>this._fullRefresh()))),this.register(v.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(y.cols,y.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(y.buffer.y,y.buffer.y,!0)))),this.register(C.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(m.window,l),this.register(m.onWindowChange((L=>this._registerIntersectionObserver(L,l))))}_registerIntersectionObserver(c,l){if("IntersectionObserver"in c){const S=new c.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});S.observe(l),this._observerDisposable.value=(0,b.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(c){this._isPaused=c.isIntersecting===void 0?c.intersectionRatio===0:!c.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(c,l,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(c,l,this._rowCount))}_renderRows(c,l){this._renderer.value&&(c=Math.min(c,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(c,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:c,end:l}),this._onRender.fire({start:c,end:l}),this._isNextRenderRedrawOnly=!0)}resize(c,l){this._rowCount=l,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(c){this._renderer.value=c,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(c){return this._renderDebouncer.addRefreshCallback(c)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var c,l;this._renderer.value&&((l=(c=this._renderer.value).clearTextureAtlas)==null||l.call(c),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(c,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(c,l)})):this._renderer.value.handleResize(c,l),this._fullRefresh())}handleCharSizeChanged(){var c;(c=this._renderer.value)==null||c.handleCharSizeChanged()}handleBlur(){var c;(c=this._renderer.value)==null||c.handleBlur()}handleFocus(){var c;(c=this._renderer.value)==null||c.handleFocus()}handleSelectionChanged(c,l,S){var x;this._selectionState.start=c,this._selectionState.end=l,this._selectionState.columnSelectMode=S,(x=this._renderer.value)==null||x.handleSelectionChanged(c,l,S)}handleCursorMove(){var c;(c=this._renderer.value)==null||c.handleCursorMove()}clear(){var c;(c=this._renderer.value)==null||c.clear()}};n.RenderService=h=d([_(2,r.IOptionsService),_(3,p.ICharSizeService),_(4,r.IDecorationService),_(5,r.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],h)},9312:function(F,n,u){var d=this&&this.__decorate||function(m,C,L,A){var E,R=arguments.length,k=R<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,C,L,A);else for(var $=m.length-1;$>=0;$--)(E=m[$])&&(k=(R<3?E(k):R>3?E(C,L,k):E(C,L))||k);return R>3&&k&&Object.defineProperty(C,L,k),k},_=this&&this.__param||function(m,C){return function(L,A){C(L,A,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const a=u(9806),p=u(9504),w=u(456),b=u(4725),o=u(8460),r=u(844),h=u(6114),c=u(4841),l=u(511),S=u(2585),x=" ",v=new RegExp(x,"g");let y=n.SelectionService=class extends r.Disposable{constructor(m,C,L,A,E,R,k,$,N){super(),this._element=m,this._screenElement=C,this._linkifier=L,this._bufferService=A,this._coreService=E,this._mouseService=R,this._optionsService=k,this._renderService=$,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new o.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new o.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new o.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=P=>this._handleMouseMove(P),this._mouseUpListener=P=>this._handleMouseUp(P),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((P=>this._handleTrim(P))),this.register(this._bufferService.buffers.onBufferActivate((P=>this._handleBufferActivate(P)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!m||!C||m[0]===C[0]&&m[1]===C[1])}get selectionText(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!m||!C)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(m[0]===C[0])return"";const E=m[0]<C[0]?m[0]:C[0],R=m[0]<C[0]?C[0]:m[0];for(let k=m[1];k<=C[1];k++){const $=L.translateBufferLineToString(k,!0,E,R);A.push($)}}else{const E=m[1]===C[1]?C[0]:void 0;A.push(L.translateBufferLineToString(m[1],!0,m[0],E));for(let R=m[1]+1;R<=C[1]-1;R++){const k=L.lines.get(R),$=L.translateBufferLineToString(R,!0);k!=null&&k.isWrapped?A[A.length-1]+=$:A.push($)}if(m[1]!==C[1]){const R=L.lines.get(C[1]),k=L.translateBufferLineToString(C[1],!0,0,C[0]);R&&R.isWrapped?A[A.length-1]+=k:A.push(k)}}return A.map((E=>E.replace(v," "))).join(h.isWindows?`\r
53
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=w=d([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],w)},6193:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=u(3614),_=u(3656),a=u(3551),p=u(9042),w=u(3730),b=u(1680),o=u(3107),r=u(5744),h=u(2950),c=u(1296),l=u(428),S=u(4269),x=u(5114),v=u(8934),y=u(3230),m=u(9312),C=u(4725),L=u(6731),R=u(8055),E=u(8969),D=u(8460),O=u(844),$=u(6114),U=u(8437),j=u(2584),z=u(7399),M=u(5941),B=u(9074),T=u(2585),k=u(5435),V=u(4567),K=u(779);class ue extends E.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(q={}){super(q),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,re)=>this.refresh(N,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,O.toDisposable)((()=>{var N,re;this._customKeyEventHandler=void 0,(re=(N=this.element)==null?void 0:N.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(q){if(this._themeService)for(const N of q){let re,se="";switch(N.index){case 256:re="foreground",se="10";break;case 257:re="background",se="11";break;case 258:re="cursor",se="12";break;default:re="ansi",se="4;"+N.index}switch(N.type){case 0:const ve=R.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${se};${(0,M.toRgbString)(ve)}${j.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((fe=>fe.ansi[N.index]=R.channels.toColor(...N.color)));else{const fe=re;this._themeService.modifyColors((Me=>Me[fe]=R.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(q){q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var q;return(q=this.textarea)==null?void 0:q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.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 q=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(q);if(!N)return;const re=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,ve=N.getWidth(re),fe=this._renderService.dimensions.css.cell.width*ve,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=Me+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,d.copyHandler)(N,this._selectionService)})));const q=N=>(0,d.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",q)),this.register((0,_.addDisposableDomListener)(this.element,"paste",q)),$.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,d.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,d.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,d.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(q=>this._keyUp(q)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(q=>this._keyDown(q)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(q=>this._keyPress(q)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(q=>this._compositionHelper.compositionupdate(q)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(q=>this._inputEvent(q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(q){var re;if(!q)throw new Error("Terminal requires a parent element.");if(q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=q.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"),q.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.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,_.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),$.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(x.CoreBrowserService,this.textarea,q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(C.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(C.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(C.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(y.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(C.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(C.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(C.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(o.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(c.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const q=this,N=this.element;function re(fe){const Me=q._mouseService.getMouseReportCoords(fe,q.screenElement);if(!Me)return!1;let _e,Oe;switch(fe.overrideType||fe.type){case"mousemove":Oe=32,fe.buttons===void 0?(_e=3,fe.button!==void 0&&(_e=fe.button<3?fe.button:3)):_e=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Oe=0,_e=fe.button<3?fe.button:3;break;case"mousedown":Oe=1,_e=fe.button<3?fe.button:3;break;case"wheel":if(q._customWheelEventHandler&&q._customWheelEventHandler(fe)===!1||q.viewport.getLinesScrolled(fe)===0)return!1;Oe=fe.deltaY<0?0:1,_e=4;break;default:return!1}return!(Oe===void 0||_e===void 0||_e>4)&&q.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:_e,action:Oe,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:fe=>(re(fe),fe.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(fe)),wheel:fe=>(re(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&re(fe)},mousemove:fe=>{fe.buttons||re(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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&fe?se.mousemove||(N.addEventListener("mousemove",ve.mousemove),se.mousemove=ve.mousemove):(N.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&fe?se.wheel||(N.addEventListener("wheel",ve.wheel,{passive:!1}),se.wheel=ve.wheel):(N.removeEventListener("wheel",se.wheel),se.wheel=null),2&fe?se.mouseup||(se.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&fe?se.mousedrag||(se.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(N,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return re(fe),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(fe)}))),this.register((0,_.addDisposableDomListener)(N,"wheel",(fe=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(fe);if(Me===0)return;const _e=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Oe="";for(let qe=0;qe<Math.abs(Me);qe++)Oe+=_e;return this.coreService.triggerDataEvent(Oe,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(N,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(N,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(q,N){var re;(re=this._renderService)==null||re.refreshRows(q,N)}updateCursorStyle(q){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(q)?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(q,N,re=0){var se;re===1?(super.scrollLines(q,N,re),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(q)}paste(q){(0,d.paste)(q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(q){this._customKeyEventHandler=q}attachCustomWheelEventHandler(q){this._customWheelEventHandler=q}registerLinkProvider(q){return this._linkProviderService.registerLinkProvider(q)}registerCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(q);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+q)}registerDecoration(q){return this._decorationService.registerDecoration(q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(q,N,re){this._selectionService.setSelection(q,N,re)}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 q;(q=this._selectionService)==null||q.clearSelection()}selectAll(){var q;(q=this._selectionService)==null||q.selectAll()}selectLines(q,N){var re;(re=this._selectionService)==null||re.selectLines(q,N)}_keyDown(q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&q.altKey;if(!N&&!this._compositionHelper.keydown(q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||q.key!=="Dead"&&q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,z.evaluateKeyboardEvent)(q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(q),re.type===3||re.type===2){const se=this.rows-1;return this.scrollLines(re.type===2?-se:se),this.cancel(q,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,q)||(re.cancel&&this.cancel(q,!0),!re.key||!!(q.key&&!q.ctrlKey&&!q.altKey&&!q.metaKey&&q.key.length===1&&q.key.charCodeAt(0)>=65&&q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==j.C0.ETX&&re.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||q.altKey||q.ctrlKey?this.cancel(q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(q,N){const re=q.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||q.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||q.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?re:re&&(!N.keyCode||N.keyCode>47)}_keyUp(q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(q)||this.focus(),this.updateCursorStyle(q),this._keyPressHandled=!1)}_keyPress(q){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;if(this.cancel(q),q.charCode)N=q.charCode;else if(q.which===null||q.which===void 0)N=q.keyCode;else{if(q.which===0||q.charCode===0)return!1;N=q.which}return!(!N||(q.altKey||q.ctrlKey||q.metaKey)&&!this._isThirdLevelShift(this.browser,q)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(q){if(q.data&&q.inputType==="insertText"&&(!q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=q.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(q),!0}return!1}resize(q,N){q!==this.cols||N!==this.rows?super.resize(q,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(q,N){var re,se;(re=this._charSizeService)==null||re.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var q;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(q=this.viewport)==null||q.reset(),this.refresh(0,this.rows-1)}}reset(){var N,re;this.options.rows=this.rows,this.options.cols=this.cols;const q=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var q;(q=this._renderService)==null||q.clearTextureAtlas()}_reportFocus(){var q;(q=this.element)!=null&&q.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(q){if(this._renderService)switch(q){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${re};${N}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${ve};${se}t`)}}cancel(q,N){if(this.options.cancelEvents||N)return q.preventDefault(),q.stopPropagation(),!1}}n.Terminal=ue},9924:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=a-this._lastRefreshMs,w=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const a=u(3656),p=u(4725),w=u(8460),b=u(844),o=u(2585);let r=n.Viewport=class extends b.Disposable{constructor(h,c,l,S,x,v,y,m){super(),this._viewportElement=h,this._scrollArea=c,this._bufferService=l,this._optionsService=S,this._charSizeService=x,this._renderService=v,this._coreBrowserService=y,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((C=>this._renderDimensions=C))),this._handleThemeChange(m.colors),this.register(m.onChangeColors((C=>this._handleThemeChange(C)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 c=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==c&&(this._lastRecordedBufferHeight=c,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 c=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,c){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(c<0&&this._viewportElement.scrollTop!==0||c>0&&l<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const c=this._getPixelsScrolled(h);return c!==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+c:this._smoothScrollState.target+=c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const c=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+c,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?c*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._currentRowHeight*this._bufferService.rows),c}getBufferElements(h,c){var m;let l,S="";const x=[],v=c??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let C=h;C<v;C++){const L=y.get(C);if(!L)continue;const R=(m=y.get(C+1))==null?void 0:m.isWrapped;if(S+=L.translateToString(!R),!R||C===y.length-1){const E=document.createElement("div");E.textContent=S,x.push(E),S.length>0&&(l=E),S=""}}return{bufferElements:x,cursorElement:l}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let c=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(c/=this._currentRowHeight+0,this._wheelPartialScroll+=c,c=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._bufferService.rows),c}_applyScrollModifier(h,c){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&c.altKey||l==="ctrl"&&c.ctrlKey||l==="shift"&&c.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const c=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(h,c))}};n.Viewport=r=d([_(2,o.IBufferService),_(3,o.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],r)},3107:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const a=u(4725),p=u(844),w=u(2585);let b=n.BufferDecorationRenderer=class extends p.Disposable{constructor(o,r,h,c,l){super(),this._screenElement=o,this._bufferService=r,this._coreBrowserService=h,this._decorationService=c,this._renderService=l,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((S=>this._removeDecoration(S)))),this.register((0,p.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 o of this._decorationService.decorations)this._renderDecoration(o);this._dimensionsChanged=!1}_renderDecoration(o){this._refreshStyle(o),this._dimensionsChanged&&this._refreshXPosition(o)}_createElement(o){var c;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((c=o==null?void 0:o.options)==null?void 0:c.layer)==="top"),r.style.width=`${Math.round((o.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(o.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(o.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=o.options.x??0;return h&&h>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(o,r),r}_refreshStyle(o){const r=o.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)o.element&&(o.element.style.display="none",o.onRenderEmitter.fire(o.element));else{let h=this._decorationElements.get(o);h||(h=this._createElement(o),o.element=h,this._decorationElements.set(o,h),this._container.appendChild(h),o.onDispose((()=>{this._decorationElements.delete(o),h.remove()}))),h.style.top=r*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",o.onRenderEmitter.fire(h)}}_refreshXPosition(o,r=o.element){if(!r)return;const h=o.options.x??0;(o.options.anchor||"left")==="right"?r.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(o){var r;(r=this._decorationElements.get(o))==null||r.remove(),this._decorationElements.delete(o),o.dispose()}};n.BufferDecorationRenderer=b=d([_(1,w.IBufferService),_(2,a.ICoreBrowserService),_(3,w.IDecorationService),_(4,a.IRenderService)],b)},5871:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,_){return d>=u.startBufferLine-this._linePadding[_||"full"]&&d<=u.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(F,n,u){var d=this&&this.__decorate||function(l,S,x,v){var y,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,S,x,v);else for(var L=l.length-1;L>=0;L--)(y=l[L])&&(C=(m<3?y(C):m>3?y(S,x,C):y(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(l,S){return function(x,v){S(x,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const a=u(5871),p=u(4725),w=u(844),b=u(2585),o={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let c=n.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,S,x,v,y,m,C){var R;super(),this._viewportElement=l,this._screenElement=S,this._bufferService=x,this._decorationService=v,this._renderService=y,this._optionsService=m,this._coreBrowserService=C,this._colorZoneStore=new a.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(),(R=this._viewportElement.parentElement)==null||R.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var E;(E=this._canvas)==null||E.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 l=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=l,r.center=S,r.right=l,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=r.left,h.right=r.left+r.center}_refreshDrawHeightConstants(){o.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);o.left=S,o.center=S,o.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const S of l)S.position!=="full"&&this._renderColorZone(S);for(const S of l)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(h[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-o[l.position||"full"]/2),r[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+o[l.position||"full"]))}_queueRefresh(l,S){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=c=d([_(2,b.IBufferService),_(3,b.IDecorationService),_(4,p.IRenderService),_(5,b.IOptionsService),_(6,p.ICoreBrowserService)],c)},2950:function(F,n,u){var d=this&&this.__decorate||function(o,r,h,c){var l,S=arguments.length,x=S<3?r:c===null?c=Object.getOwnPropertyDescriptor(r,h):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,r,h,c);else for(var v=o.length-1;v>=0;v--)(l=o[v])&&(x=(S<3?l(x):S>3?l(r,h,x):l(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(o,r){return function(h,c){r(h,c,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const a=u(4725),p=u(2585),w=u(2584);let b=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(o,r,h,c,l,S){this._textarea=o,this._compositionView=r,this._bufferService=h,this._optionsService=c,this._coreService=l,this._renderService=S,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(o){this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229||o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(o){if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const o=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,h=r.replace(o,"");this._dataAlreadySent=h,r.length>o.length?this._coreService.triggerDataEvent(h,!0):r.length<o.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):r.length===o.length&&r!==o&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(o){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,c=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}o||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=b=d([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,a.IRenderService)],b)},9806:(F,n)=>{function u(d,_,a){const p=a.getBoundingClientRect(),w=d.getComputedStyle(a),b=parseInt(w.getPropertyValue("padding-left")),o=parseInt(w.getPropertyValue("padding-top"));return[_.clientX-p.left-b,_.clientY-p.top-o]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(d,_,a,p,w,b,o,r,h){if(!b)return;const c=u(d,_,a);return c?(c[0]=Math.ceil((c[0]+(h?o/2:0))/o),c[1]=Math.ceil(c[1]/r),c[0]=Math.min(Math.max(c[0],1),p+(h?1:0)),c[1]=Math.min(Math.max(c[1],1),w),c):void 0}},9504:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=u(2584);function _(r,h,c,l){const S=r-a(r,c),x=h-a(h,c),v=Math.abs(S-x)-(function(y,m,C){let L=0;const R=y-a(y,C),E=m-a(m,C);for(let D=0;D<Math.abs(R-E);D++){const O=p(y,m)==="A"?-1:1,$=C.buffer.lines.get(R+O*D);$!=null&&$.isWrapped&&L++}return L})(r,h,c);return o(v,b(p(r,h),l))}function a(r,h){let c=0,l=h.buffer.lines.get(r),S=l==null?void 0:l.isWrapped;for(;S&&r>=0&&r<h.rows;)c++,l=h.buffer.lines.get(--r),S=l==null?void 0:l.isWrapped;return c}function p(r,h){return r>h?"A":"B"}function w(r,h,c,l,S,x){let v=r,y=h,m="";for(;v!==c||y!==l;)v+=S?1:-1,S&&v>x.cols-1?(m+=x.buffer.translateBufferLineToString(y,!1,r,v),v=0,r=0,y++):!S&&v<0&&(m+=x.buffer.translateBufferLineToString(y,!1,0,r+1),v=x.cols-1,r=v,y--);return m+x.buffer.translateBufferLineToString(y,!1,r,v)}function b(r,h){const c=h?"O":"[";return d.C0.ESC+c+r}function o(r,h){r=Math.floor(r);let c="";for(let l=0;l<r;l++)c+=h;return c}n.moveToCellSequence=function(r,h,c,l){const S=c.buffer.x,x=c.buffer.y;if(!c.buffer.hasScrollback)return(function(m,C,L,R,E,D){return _(C,R,E,D).length===0?"":o(w(m,C,m,C-a(C,E),!1,E).length,b("D",D))})(S,x,0,h,c,l)+_(x,h,c,l)+(function(m,C,L,R,E,D){let O;O=_(C,R,E,D).length>0?R-a(R,E):C;const $=R,U=(function(j,z,M,B,T,k){let V;return V=_(M,B,T,k).length>0?B-a(B,T):z,j<M&&V<=B||j>=M&&V<B?"C":"D"})(m,C,L,R,E,D);return o(w(m,O,L,$,U==="C",E).length,b(U,D))})(S,x,r,h,c,l);let v;if(x===h)return v=S>r?"D":"C",o(Math.abs(S-r),b(v,l));v=x>h?"D":"C";const y=Math.abs(x-h);return o((function(m,C){return C.cols-m})(x>h?r:S,c)+(y-1)*c.cols+1+((x>h?S:r)-1),b(v,l))}},1296:function(F,n,u){var d=this&&this.__decorate||function(D,O,$,U){var j,z=arguments.length,M=z<3?O:U===null?U=Object.getOwnPropertyDescriptor(O,$):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(D,O,$,U);else for(var B=D.length-1;B>=0;B--)(j=D[B])&&(M=(z<3?j(M):z>3?j(O,$,M):j(O,$))||M);return z>3&&M&&Object.defineProperty(O,$,M),M},_=this&&this.__param||function(D,O){return function($,U){O($,U,D)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const a=u(3787),p=u(2550),w=u(2223),b=u(6171),o=u(6052),r=u(4725),h=u(8055),c=u(8460),l=u(844),S=u(2585),x="xterm-dom-renderer-owner-",v="xterm-rows",y="xterm-fg-",m="xterm-bg-",C="xterm-focus",L="xterm-selection";let R=1,E=n.DomRenderer=class extends l.Disposable{constructor(D,O,$,U,j,z,M,B,T,k,V,K,ue){super(),this._terminal=D,this._document=O,this._element=$,this._screenElement=U,this._viewportElement=j,this._helperContainer=z,this._linkifier2=M,this._charSizeService=T,this._optionsService=k,this._bufferService=V,this._coreBrowserService=K,this._themeService=ue,this._terminalClass=R++,this._rowElements=[],this._selectionRenderModel=(0,o.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new c.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(v),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((le=>this._injectCss(le)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((le=>this._handleLinkHover(le)))),this.register(this._linkifier2.onHideLinkUnderline((le=>this._handleLinkLeave(le)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const O=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let O=`${this._terminalSelector} .${v} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${v} .xterm-dim { color: ${h.color.multiplyOpacity(D.foreground,.5).css};}`,O+=`${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 $=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;O+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,O+=`@keyframes ${U} { 50% { box-shadow: none; }}`,O+=`@keyframes ${j} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,O+=`${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[z,M]of D.ansi.entries())O+=`${this._terminalSelector} .${y}${z} { color: ${M.css}; }${this._terminalSelector} .${y}${z}.xterm-dim { color: ${h.color.multiplyOpacity(M,.5).css}; }${this._terminalSelector} .${m}${z} { background-color: ${M.css}; }`;O+=`${this._terminalSelector} .${y}${w.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(D.background).css}; }${this._terminalSelector} .${y}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${m}${w.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=O}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,O){for(let $=this._rowElements.length;$<=O;$++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,O){this._refreshRowElements(D,O),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(C),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(C),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,O,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,O,$),this.renderRows(0,this._bufferService.rows-1),!D||!O)return;this._selectionRenderModel.update(this._terminal,D,O,$);const U=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,z=this._selectionRenderModel.viewportCappedStartRow,M=this._selectionRenderModel.viewportCappedEndRow;if(z>=this._bufferService.rows||M<0)return;const B=this._document.createDocumentFragment();if($){const T=D[0]>O[0];B.appendChild(this._createSelectionElement(z,T?O[0]:D[0],T?D[0]:O[0],M-z+1))}else{const T=U===z?D[0]:0,k=z===j?O[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(z,T,k));const V=M-z-1;if(B.appendChild(this._createSelectionElement(z+1,0,this._bufferService.cols,V)),z!==M){const K=j===M?O[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(M,0,K))}}this._selectionContainer.appendChild(B)}_createSelectionElement(D,O,$,U=1){const j=this._document.createElement("div"),z=O*this.dimensions.css.cell.width;let M=this.dimensions.css.cell.width*($-O);return z+M>this.dimensions.css.canvas.width&&(M=this.dimensions.css.canvas.width-z),j.style.height=U*this.dimensions.css.cell.height+"px",j.style.top=D*this.dimensions.css.cell.height+"px",j.style.left=`${z}px`,j.style.width=`${M}px`,j}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 D of this._rowElements)D.replaceChildren()}renderRows(D,O){const $=this._bufferService.buffer,U=$.ybase+$.y,j=Math.min($.x,this._bufferService.cols-1),z=this._optionsService.rawOptions.cursorBlink,M=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=D;T<=O;T++){const k=T+$.ydisp,V=this._rowElements[T],K=$.lines.get(k);if(!V||!K)break;V.replaceChildren(...this._rowFactory.createRow(K,k,k===U,M,B,j,z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,O,$,U,j,z){$<0&&(D=0),U<0&&(O=0);const M=this._bufferService.rows-1;$=Math.max(Math.min($,M),0),U=Math.max(Math.min(U,M),0),j=Math.min(j,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,k=Math.min(B.x,j-1),V=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let le=$;le<=U;++le){const q=le+B.ydisp,N=this._rowElements[le],re=B.lines.get(q);if(!N||!re)break;N.replaceChildren(...this._rowFactory.createRow(re,q,q===T,K,ue,k,V,this.dimensions.css.cell.width,this._widthCache,z?le===$?D:0:-1,z?(le===U?O:j)-1:-1))}}};n.DomRenderer=E=d([_(7,S.IInstantiationService),_(8,r.ICharSizeService),_(9,S.IOptionsService),_(10,S.IBufferService),_(11,r.ICoreBrowserService),_(12,r.IThemeService)],E)},3787:function(F,n,u){var d=this&&this.__decorate||function(v,y,m,C){var L,R=arguments.length,E=R<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,y,m,C);else for(var D=v.length-1;D>=0;D--)(L=v[D])&&(E=(R<3?L(E):R>3?L(y,m,E):L(y,m))||E);return R>3&&E&&Object.defineProperty(y,m,E),E},_=this&&this.__param||function(v,y){return function(m,C){y(m,C,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const a=u(2223),p=u(643),w=u(511),b=u(2585),o=u(8055),r=u(4725),h=u(4269),c=u(6171),l=u(3734);let S=n.DomRendererRowFactory=class{constructor(v,y,m,C,L,R,E){this._document=v,this._characterJoinerService=y,this._optionsService=m,this._coreBrowserService=C,this._coreService=L,this._decorationService=R,this._themeService=E,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,y,m){this._selectionStart=v,this._selectionEnd=y,this._columnSelectMode=m}createRow(v,y,m,C,L,R,E,D,O,$,U){const j=[],z=this._characterJoinerService.getJoinedCharacters(y),M=this._themeService.colors;let B,T=v.getNoBgTrimmedLength();m&&T<R+1&&(T=R+1);let k=0,V="",K=0,ue=0,le=0,q=!1,N=0,re=!1,se=0;const ve=[],fe=$!==-1&&U!==-1;for(let Me=0;Me<T;Me++){v.loadCell(Me,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let Oe=!1,qe=Me,be=this._workCell;if(z.length>0&&Me===z[0][0]){Oe=!0;const Le=z.shift();be=new h.JoinedCellData(this._workCell,v.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),qe=Le[1]-1,_e=be.getWidth()}const ft=this._isCellInSelection(Me,y),Ot=m&&Me===R,Se=fe&&Me>=$&&Me<=U;let pe=!1;this._decorationService.forEachDecorationAtCell(Me,y,void 0,(Le=>{pe=!0}));let me=be.getChars()||p.WHITESPACE_CELL_CHAR;if(me===" "&&(be.isUnderline()||be.isOverline())&&(me=" "),se=_e*D-O.get(me,be.isBold(),be.isItalic()),B){if(k&&(ft&&re||!ft&&!re&&be.bg===K)&&(ft&&re&&M.selectionForeground||be.fg===ue)&&be.extended.ext===le&&Se===q&&se===N&&!Ot&&!Oe&&!pe){be.isInvisible()?V+=p.WHITESPACE_CELL_CHAR:V+=me,k++;continue}k&&(B.textContent=V),B=this._document.createElement("span"),k=0,V=""}else B=this._document.createElement("span");if(K=be.bg,ue=be.fg,le=be.extended.ext,q=Se,N=se,re=ft,Oe&&R>=Me&&R<=qe&&(R=Me),!this._coreService.isCursorHidden&&Ot&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&ve.push("xterm-cursor-blink"),ve.push(C==="bar"?"xterm-cursor-bar":C==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(be.isBold()&&ve.push("xterm-bold"),be.isItalic()&&ve.push("xterm-italic"),be.isDim()&&ve.push("xterm-dim"),V=be.isInvisible()?p.WHITESPACE_CELL_CHAR:be.getChars()||p.WHITESPACE_CELL_CHAR,be.isUnderline()&&(ve.push(`xterm-underline-${be.extended.underlineStyle}`),V===" "&&(V=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Le=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Le<8&&(Le+=8),B.style.textDecorationColor=M.ansi[Le].css}be.isOverline()&&(ve.push("xterm-overline"),V===" "&&(V=" ")),be.isStrikethrough()&&ve.push("xterm-strikethrough"),Se&&(B.style.textDecoration="underline");let he=be.getFgColor(),ge=be.getFgColorMode(),ze=be.getBgColor(),Re=be.getBgColorMode();const _t=!!be.isInverse();if(_t){const Le=he;he=ze,ze=Le;const xt=ge;ge=Re,Re=xt}let Qe,it,Ie,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(Me,y,void 0,(Le=>{Le.options.layer!=="top"&&Ae||(Le.backgroundColorRGB&&(Re=50331648,ze=Le.backgroundColorRGB.rgba>>8&16777215,Qe=Le.backgroundColorRGB),Le.foregroundColorRGB&&(ge=50331648,he=Le.foregroundColorRGB.rgba>>8&16777215,it=Le.foregroundColorRGB),Ae=Le.options.layer==="top")})),!Ae&&ft&&(Qe=this._coreBrowserService.isFocused?M.selectionBackgroundOpaque:M.selectionInactiveBackgroundOpaque,ze=Qe.rgba>>8&16777215,Re=50331648,Ae=!0,M.selectionForeground&&(ge=50331648,he=M.selectionForeground.rgba>>8&16777215,it=M.selectionForeground)),Ae&&ve.push("xterm-decoration-top"),Re){case 16777216:case 33554432:Ie=M.ansi[ze],ve.push(`xterm-bg-${ze}`);break;case 50331648:Ie=o.channels.toColor(ze>>16,ze>>8&255,255&ze),this._addStyle(B,`background-color:#${x((ze>>>0).toString(16),"0",6)}`);break;default:_t?(Ie=M.foreground,ve.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ie=M.background}switch(Qe||be.isDim()&&(Qe=o.color.multiplyOpacity(Ie,.5)),ge){case 16777216:case 33554432:be.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(B,Ie,M.ansi[he],be,Qe,void 0)||ve.push(`xterm-fg-${he}`);break;case 50331648:const Le=o.channels.toColor(he>>16&255,he>>8&255,255&he);this._applyMinimumContrast(B,Ie,Le,be,Qe,it)||this._addStyle(B,`color:#${x(he.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Ie,M.foreground,be,Qe,it)||_t&&ve.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ve.length&&(B.className=ve.join(" "),ve.length=0),Ot||Oe||pe?B.textContent=V:k++,se!==this.defaultSpacing&&(B.style.letterSpacing=`${se}px`),j.push(B),Me=qe}return B&&k&&(B.textContent=V),j}_applyMinimumContrast(v,y,m,C,L,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.treatGlyphAsBackgroundColor)(C.getCode()))return!1;const E=this._getContrastCache(C);let D;if(L||R||(D=E.getColor(y.rgba,m.rgba)),D===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);D=o.color.ensureContrastRatio(L||y,R||m,O),E.setColor((L||y).rgba,(R||m).rgba,D??null)}return!!D&&(this._addStyle(v,`color:${D.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,y){v.setAttribute("style",`${v.getAttribute("style")||""}${y};`)}_isCellInSelection(v,y){const m=this._selectionStart,C=this._selectionEnd;return!(!m||!C)&&(this._columnSelectMode?m[0]<=C[0]?v>=m[0]&&y>=m[1]&&v<C[0]&&y<=C[1]:v<m[0]&&y>=m[1]&&v>=C[0]&&y<=C[1]:y>m[1]&&y<C[1]||m[1]===C[1]&&y===m[1]&&v>=m[0]&&v<C[0]||m[1]<C[1]&&y===C[1]&&v<C[0]||m[1]<C[1]&&y===m[1]&&v>=m[0])}};function x(v,y,m){for(;v.length<m;)v=y+v;return v}n.DomRendererRowFactory=S=d([_(1,r.ICharacterJoinerService),_(2,b.IOptionsService),_(3,r.ICoreBrowserService),_(4,b.ICoreService),_(5,b.IDecorationService),_(6,r.IThemeService)],S)},2550:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 _=u.createElement("span");_.classList.add("xterm-char-measure-element");const a=u.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[_,a,p,w],this._container.appendChild(_),this._container.appendChild(a),this._container.appendChild(p),this._container.appendChild(w),d.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(u,d,_,a){u===this._font&&d===this._fontSize&&_===this._weight&&a===this._weightBold||(this._font=u,this._fontSize=d,this._weight=_,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(u,d,_){let a=0;if(!d&&!_&&u.length===1&&(a=u.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const b=this._measure(u,0);return b>0&&(this._flat[a]=b),b}let p=u;d&&(p+="B"),_&&(p+="I");let w=this._holey.get(p);if(w===void 0){let b=0;d&&(b|=1),_&&(b|=2),w=this._measure(u,b),w>0&&this._holey.set(p,w)}return w}_measure(u,d){const _=this._measureElements[d];return _.textContent=u.repeat(32),_.offsetWidth/32}}},2223:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},6052:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},456:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const a=u(2585),p=u(8460),w=u(844);let b=n.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(c,l,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new r(c,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const c=this._measureStrategy.measure();c.width===this.width&&c.height===this.height||(this.width=c.width,this.height=c.height,this._onCharSizeChange.fire())}};n.CharSizeService=b=d([_(2,a.IOptionsService)],b);class o extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,S){l!==void 0&&l>0&&S!==void 0&&S>0&&(this._result.width=l,this._result.height=S)}}class r extends o{constructor(l,S,x){super(),this._document=l,this._parentElement=S,this._optionsService=x,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 h extends o{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(3734),p=u(643),w=u(511),b=u(2585);class o extends a.AttributeData{constructor(c,l,S){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=l,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=o;let r=n.CharacterJoinerService=class uf{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(c){const l={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(l),l.id}deregister(c){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===c)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(c);if(!l||l.length===0)return[];const S=[],x=l.translateToString(!0);let v=0,y=0,m=0,C=l.getFg(0),L=l.getBg(0);for(let R=0;R<l.getTrimmedLength();R++)if(l.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(R-v>1){const E=this._getJoinedRanges(x,m,y,l,v);for(let D=0;D<E.length;D++)S.push(E[D])}v=R,m=y,C=this._workCell.fg,L=this._workCell.bg}y+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const R=this._getJoinedRanges(x,m,y,l,v);for(let E=0;E<R.length;E++)S.push(R[E])}return S}_getJoinedRanges(c,l,S,x,v){const y=c.substring(l,S);let m=[];try{m=this._characterJoiners[0].handler(y)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(y);for(let R=0;R<L.length;R++)uf._mergeRanges(m,L[R])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(c,l,S){let x=0,v=!1,y=0,m=c[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=l.getWidth(C),R=l.getString(C).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=y&&(m[0]=C,v=!0),m[1]<=y){if(m[1]=C,m=c[++x],!m)break;m[0]<=y?(m[0]=C,v=!0):v=!1}y+=R}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(c,l){let S=!1;for(let x=0;x<c.length;x++){const v=c[x];if(S){if(l[1]<=v[0])return c[x-1][1]=l[1],c;if(l[1]<=v[1])return c[x-1][1]=Math.max(l[1],v[1]),c.splice(x,1),c;c.splice(x,1),x--}else{if(l[1]<=v[0])return c.splice(x,0,l),c;if(l[1]<=v[1])return v[0]=Math.min(l[0],v[0]),c;l[0]<v[1]&&(v[0]=Math.min(l[0],v[0]),S=!0)}}return S?c[c.length-1][1]=l[1]:c.push(l),c}};n.CharacterJoinerService=r=d([_(0,b.IBufferService)],r)},5114:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const d=u(844),_=u(8460),a=u(3656);class p extends d.Disposable{constructor(o,r,h){super(),this._textarea=o,this._window=r,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((c=>this._screenDprMonitor.setWindow(c)))),this.register((0,_.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(o){this._window!==o&&(this._window=o,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}}n.CoreBrowserService=p;class w extends d.Disposable{constructor(o){super(),this._parentWindow=o,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(o){this._parentWindow=o,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var o;this._outerListener&&((o=this._resolutionMediaMatchList)==null||o.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,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const d=u(844);class _ extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const w=this.linkProviders.indexOf(p);w!==-1&&this.linkProviders.splice(w,1)}}}}n.LinkProviderService=_},8934:function(F,n,u){var d=this&&this.__decorate||function(b,o,r,h){var c,l=arguments.length,S=l<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,r):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,o,r,h);else for(var x=b.length-1;x>=0;x--)(c=b[x])&&(S=(l<3?c(S):l>3?c(o,r,S):c(o,r))||S);return l>3&&S&&Object.defineProperty(o,r,S),S},_=this&&this.__param||function(b,o){return function(r,h){o(r,h,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const a=u(4725),p=u(9806);let w=n.MouseService=class{constructor(b,o){this._renderService=b,this._charSizeService=o}getCoords(b,o,r,h,c){return(0,p.getCoords)(window,b,o,r,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,c)}getMouseReportCoords(b,o){const r=(0,p.getCoordsRelativeToElement)(window,b,o);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};n.MouseService=w=d([_(0,a.IRenderService),_(1,a.ICharSizeService)],w)},3230:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const a=u(6193),p=u(4725),w=u(8460),b=u(844),o=u(7226),r=u(2585);let h=n.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(c,l,S,x,v,y,m,C){super(),this._rowCount=c,this._charSizeService=x,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._observerDisposable=this.register(new b.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,R)=>this._renderRows(L,R)),m),this.register(this._renderDebouncer),this.register(m.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(y.onResize((()=>this._fullRefresh()))),this.register(y.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(v.onDecorationRegistered((()=>this._fullRefresh()))),this.register(v.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(y.cols,y.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(y.buffer.y,y.buffer.y,!0)))),this.register(C.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(m.window,l),this.register(m.onWindowChange((L=>this._registerIntersectionObserver(L,l))))}_registerIntersectionObserver(c,l){if("IntersectionObserver"in c){const S=new c.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});S.observe(l),this._observerDisposable.value=(0,b.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(c){this._isPaused=c.isIntersecting===void 0?c.intersectionRatio===0:!c.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(c,l,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(c,l,this._rowCount))}_renderRows(c,l){this._renderer.value&&(c=Math.min(c,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(c,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:c,end:l}),this._onRender.fire({start:c,end:l}),this._isNextRenderRedrawOnly=!0)}resize(c,l){this._rowCount=l,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(c){this._renderer.value=c,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(c){return this._renderDebouncer.addRefreshCallback(c)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var c,l;this._renderer.value&&((l=(c=this._renderer.value).clearTextureAtlas)==null||l.call(c),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(c,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(c,l)})):this._renderer.value.handleResize(c,l),this._fullRefresh())}handleCharSizeChanged(){var c;(c=this._renderer.value)==null||c.handleCharSizeChanged()}handleBlur(){var c;(c=this._renderer.value)==null||c.handleBlur()}handleFocus(){var c;(c=this._renderer.value)==null||c.handleFocus()}handleSelectionChanged(c,l,S){var x;this._selectionState.start=c,this._selectionState.end=l,this._selectionState.columnSelectMode=S,(x=this._renderer.value)==null||x.handleSelectionChanged(c,l,S)}handleCursorMove(){var c;(c=this._renderer.value)==null||c.handleCursorMove()}clear(){var c;(c=this._renderer.value)==null||c.clear()}};n.RenderService=h=d([_(2,r.IOptionsService),_(3,p.ICharSizeService),_(4,r.IDecorationService),_(5,r.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],h)},9312:function(F,n,u){var d=this&&this.__decorate||function(m,C,L,R){var E,D=arguments.length,O=D<3?C:R===null?R=Object.getOwnPropertyDescriptor(C,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(m,C,L,R);else for(var $=m.length-1;$>=0;$--)(E=m[$])&&(O=(D<3?E(O):D>3?E(C,L,O):E(C,L))||O);return D>3&&O&&Object.defineProperty(C,L,O),O},_=this&&this.__param||function(m,C){return function(L,R){C(L,R,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const a=u(9806),p=u(9504),w=u(456),b=u(4725),o=u(8460),r=u(844),h=u(6114),c=u(4841),l=u(511),S=u(2585),x=" ",v=new RegExp(x,"g");let y=n.SelectionService=class extends r.Disposable{constructor(m,C,L,R,E,D,O,$,U){super(),this._element=m,this._screenElement=C,this._linkifier=L,this._bufferService=R,this._coreService=E,this._mouseService=D,this._optionsService=O,this._renderService=$,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new o.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new o.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new o.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((j=>this._handleTrim(j))),this.register(this._bufferService.buffers.onBufferActivate((j=>this._handleBufferActivate(j)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!m||!C||m[0]===C[0]&&m[1]===C[1])}get selectionText(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!m||!C)return"";const L=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(m[0]===C[0])return"";const E=m[0]<C[0]?m[0]:C[0],D=m[0]<C[0]?C[0]:m[0];for(let O=m[1];O<=C[1];O++){const $=L.translateBufferLineToString(O,!0,E,D);R.push($)}}else{const E=m[1]===C[1]?C[0]:void 0;R.push(L.translateBufferLineToString(m[1],!0,m[0],E));for(let D=m[1]+1;D<=C[1]-1;D++){const O=L.lines.get(D),$=L.translateBufferLineToString(D,!0);O!=null&&O.isWrapped?R[R.length-1]+=$:R.push($)}if(m[1]!==C[1]){const D=L.lines.get(C[1]),O=L.translateBufferLineToString(C[1],!0,0,C[0]);D&&D.isWrapped?R[R.length-1]+=O:R.push(O)}}return R.map((E=>E.replace(v," "))).join(h.isWindows?`\r
54
54
  `:`
55
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&m&&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(m){const C=this._getMouseBufferCoords(m),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&C)&&this._areCoordsInSelection(C,L,A)}isCellInSelection(m,C){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([m,C],L,A)}_areCoordsInSelection(m,C,L){return m[1]>C[1]&&m[1]<L[1]||C[1]===L[1]&&m[1]===C[1]&&m[0]>=C[0]&&m[0]<L[0]||C[1]<L[1]&&m[1]===L[1]&&m[0]<L[0]||C[1]<L[1]&&m[1]===C[1]&&m[0]>=C[0]}_selectWordAtCursor(m,C){var E,R;const L=(R=(E=this._linkifier.currentLink)==null?void 0:E.link)==null?void 0:R.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,c.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(m);return!!A&&(this._selectWordAt(A,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,C){this._model.clearSelection(),m=Math.max(m,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const C=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(m){let C=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return C>=0&&C<=L?0:(C>L&&(C-=L),C=Math.min(Math.max(C,-50),50),C/=50,C/Math.abs(C)+Math.round(14*C))}shouldForceSelection(m){return h.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const C=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);C&&C.length!==this._model.selectionStart[0]&&C.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const C=this._getMouseBufferCoords(m);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(m){return m.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const C=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const A=L.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}C&&C[0]===this._model.selectionEnd[0]&&C[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 m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const C=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,L=!(!m||!C||m[0]===C[0]&&m[1]===C[1]);L?m&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,C,L)):this._oldHasSelection&&this._fireOnSelectionChange(m,C,L)}_fireOnSelectionChange(m,C,L){this._oldSelectionStart=m,this._oldSelectionEnd=C,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim((C=>this._handleTrim(C)))}_convertViewportColToCharacterIndex(m,C){let L=C;for(let A=0;C>=A;A++){const E=m.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:E>1&&C!==A&&(L+=E-1)}return L}setSelection(m,C,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,C],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,C,L=!0,A=!0){if(m[0]>=this._bufferService.cols)return;const E=this._bufferService.buffer,R=E.lines.get(m[1]);if(!R)return;const k=E.translateBufferLineToString(m[1],!1);let $=this._convertViewportColToCharacterIndex(R,m[0]),N=$;const P=m[0]-$;let j=0,D=0,O=0,T=0;if(k.charAt($)===" "){for(;$>0&&k.charAt($-1)===" ";)$--;for(;N<k.length&&k.charAt(N+1)===" ";)N++}else{let K=m[0],oe=m[0];R.getWidth(K)===0&&(j++,K--),R.getWidth(oe)===2&&(D++,oe++);const ce=R.getString(oe).length;for(ce>1&&(T+=ce-1,N+=ce-1);K>0&&$>0&&!this._isCharWordSeparator(R.loadCell(K-1,this._workCell));){R.loadCell(K-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,K--):W>1&&(O+=W-1,$-=W-1),$--,K--}for(;oe<R.length&&N+1<k.length&&!this._isCharWordSeparator(R.loadCell(oe+1,this._workCell));){R.loadCell(oe+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,oe++):W>1&&(T+=W-1,N+=W-1),N++,oe++}}N++;let B=$+P-j+O,q=Math.min(this._bufferService.cols,N-$+j+D-O-T);if(C||k.slice($,N).trim()!==""){if(L&&B===0&&R.getCodePoint(0)!==32){const K=E.lines.get(m[1]-1);if(K&&R.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const oe=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(oe){const ce=this._bufferService.cols-oe.start;B-=ce,q+=ce}}}if(A&&B+q===this._bufferService.cols&&R.getCodePoint(this._bufferService.cols-1)!==32){const K=E.lines.get(m[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const oe=this._getWordAt([0,m[1]+1],!1,!1,!0);oe&&(q+=oe.length)}}return{start:B,length:q}}}_selectWordAt(m,C){const L=this._getWordAt(m,C);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[L.start,m[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(m){const C=this._getWordAt(m,!0);if(C){let L=m[1];for(;C.start<0;)C.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;C.start+C.length>this._bufferService.cols;)C.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?C.start:C.start+C.length,L]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const C=this._bufferService.buffer.getWrappedRangeForLine(m),L={start:{x:0,y:C.first},end:{x:this._bufferService.cols-1,y:C.last}};this._model.selectionStart=[0,C.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,c.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=y=d([_(3,S.IBufferService),_(4,S.ICoreService),_(5,b.IMouseService),_(6,S.IOptionsService),_(7,b.IRenderService),_(8,b.ICoreBrowserService)],y)},4725:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=u(8343);n.ICharSizeService=(0,d.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),n.IMouseService=(0,d.createDecorator)("MouseService"),n.IRenderService=(0,d.createDecorator)("RenderService"),n.ISelectionService=(0,d.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,d.createDecorator)("ThemeService"),n.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(F,n,u){var d=this&&this.__decorate||function(y,m,C,L){var A,E=arguments.length,R=E<3?m:L===null?L=Object.getOwnPropertyDescriptor(m,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,m,C,L);else for(var k=y.length-1;k>=0;k--)(A=y[k])&&(R=(E<3?A(R):E>3?A(m,C,R):A(m,C))||R);return E>3&&R&&Object.defineProperty(m,C,R),R},_=this&&this.__param||function(y,m){return function(C,L){m(C,L,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const a=u(7239),p=u(8055),w=u(8460),b=u(844),o=u(2585),r=p.css.toColor("#ffffff"),h=p.css.toColor("#000000"),c=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const y=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let C=0;C<216;C++){const L=m[C/36%6|0],A=m[C/6%6|0],E=m[C%6];y.push({css:p.channels.toCss(L,A,E),rgba:p.channels.toRgba(L,A,E)})}for(let C=0;C<24;C++){const L=8+10*C;y.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return y})());let x=n.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(y){super(),this._optionsService=y,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:h,cursor:c,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:p.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:p.color.blend(h,S),ansi:n.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(y={}){const m=this._colors;if(m.foreground=v(y.foreground,r),m.background=v(y.background,h),m.cursor=v(y.cursor,c),m.cursorAccent=v(y.cursorAccent,l),m.selectionBackgroundTransparent=v(y.selectionBackground,S),m.selectionBackgroundOpaque=p.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=v(y.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=p.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=y.selectionForeground?v(y.selectionForeground,p.NULL_COLOR):void 0,m.selectionForeground===p.NULL_COLOR&&(m.selectionForeground=void 0),p.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=p.color.opacity(m.selectionBackgroundTransparent,.3)),p.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=p.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=n.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=v(y.black,n.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=v(y.red,n.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=v(y.green,n.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=v(y.yellow,n.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=v(y.blue,n.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=v(y.magenta,n.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=v(y.cyan,n.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=v(y.white,n.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=v(y.brightBlack,n.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=v(y.brightRed,n.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=v(y.brightGreen,n.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=v(y.brightYellow,n.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=v(y.brightBlue,n.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=v(y.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=v(y.brightCyan,n.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=v(y.brightWhite,n.DEFAULT_ANSI_COLORS[15]),y.extendedAnsi){const C=Math.min(m.ansi.length-16,y.extendedAnsi.length);for(let L=0;L<C;L++)m.ansi[L+16]=v(y.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(y){this._restoreColor(y),this._onChangeColors.fire(this.colors)}_restoreColor(y){if(y!==void 0)switch(y){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[y]=this._restoreColors.ansi[y]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(y){y(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 v(y,m){if(y!==void 0)try{return p.css.toColor(y)}catch{}return m}n.ThemeService=x=d([_(0,o.IOptionsService)],x)},6349:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const b=new Array(w);for(let o=0;o<Math.min(w,this.length);o++)b[o]=this._array[this._getCyclicIndex(o)];this._array=b,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let b=this._length;b<w;b++)this._array[b]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,b){this._array[this._getCyclicIndex(w)]=b}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,b,...o){if(b){for(let r=w;r<this._length-b;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+b)];this._length-=b,this.onDeleteEmitter.fire({index:w,amount:b})}for(let r=this._length-1;r>=w;r--)this._array[this._getCyclicIndex(r+o.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<o.length;r++)this._array[this._getCyclicIndex(w+r)]=o[r];if(o.length&&this.onInsertEmitter.fire({index:w,amount:o.length}),this._length+o.length>this._maxLength){const r=this._length+o.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=o.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,b,o){if(!(b<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+o<0)throw new Error("Cannot shift elements in list beyond index 0");if(o>0){for(let h=b-1;h>=0;h--)this.set(w+h+o,this.get(w+h));const r=w+b+o-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<b;r++)this.set(w+r+o,this.get(w+r))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}n.CircularList=a},1439:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(d,_=5){if(typeof d!="object")return d;const a=Array.isArray(d)?[]:{};for(const p in d)a[p]=_<=1?d[p]:d[p]&&u(d[p],_-1);return a}},8055:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,A=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=A+Math.round((m-A)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E>0||R>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),R-=Math.max(0,Math.ceil(.1*R)),k-=Math.max(0,Math.ceil(.1*k)),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E<255||R<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),R=Math.min(255,R+Math.ceil(.1*(255-R))),k=Math.min(255,k+Math.ceil(.1*(255-k))),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,A=v>>24&255,E=v>>16&255,R=v>>8&255;return u=A+Math.round((m-A)*a),d=E+Math.round((C-E)*a),_=R+Math.round((L-R)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const R=S(v,y,m),k=c(C,o.relativeLuminance(R>>8));if(k<m){const $=x(v,y,m);return k>c(C,o.relativeLuminance($>>8))?R:$}return R}const A=x(v,y,m),E=c(C,o.relativeLuminance(A>>8));if(E<m){const R=S(v,y,m);return E>c(C,o.relativeLuminance(R>>8))?A:R}return A}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},8969:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=u(844),_=u(2585),a=u(4348),p=u(7866),w=u(744),b=u(7302),o=u(6975),r=u(8460),h=u(1753),c=u(1480),l=u(7994),S=u(9282),x=u(5435),v=u(5981),y=u(2660);let m=!1;class C extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((A=>{var E;(E=this._onScrollApi)==null||E.fire(A.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(A){for(const E in A)this.optionsService.options[E]=A[E]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new b.OptionsService(A)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(c.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(y.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((E=>{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((E=>{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 v.WriteBuffer(((E,R)=>this._inputHandler.parse(E,R)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,E){this._writeBuffer.write(A,E)}writeSync(A,E){this._logService.logLevel<=_.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(A,E)}input(A,E=!0){this.coreService.triggerDataEvent(A,E)}resize(A,E){isNaN(A)||isNaN(E)||(A=Math.max(A,w.MINIMUM_COLS),E=Math.max(E,w.MINIMUM_ROWS),this._bufferService.resize(A,E))}scroll(A,E=!1){this._bufferService.scroll(A,E)}scrollLines(A,E,R){this._bufferService.scrollLines(A,E,R)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const E=A-this._bufferService.buffer.ydisp;E!==0&&this.scrollLines(E)}registerEscHandler(A,E){return this._inputHandler.registerEscHandler(A,E)}registerDcsHandler(A,E){return this._inputHandler.registerDcsHandler(A,E)}registerCsiHandler(A,E){return this._inputHandler.registerCsiHandler(A,E)}registerOscHandler(A,E){return this._inputHandler.registerOscHandler(A,E)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const E=this.optionsService.rawOptions.windowsPty;E&&E.buildNumber!==void 0&&E.buildNumber!==void 0?A=E.backend==="conpty"&&E.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const E of A)E.dispose()}))}}}n.CoreTerminal=C},8460:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},5435:function(F,n,u){var d=this&&this.__decorate||function(j,D,O,T){var B,q=arguments.length,K=q<3?D:T===null?T=Object.getOwnPropertyDescriptor(D,O):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(j,D,O,T);else for(var oe=j.length-1;oe>=0;oe--)(B=j[oe])&&(K=(q<3?B(K):q>3?B(D,O,K):B(D,O))||K);return q>3&&K&&Object.defineProperty(D,O,K),K},_=this&&this.__param||function(j,D){return function(O,T){D(O,T,j)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const a=u(2584),p=u(7116),w=u(2015),b=u(844),o=u(482),r=u(8437),h=u(8460),c=u(643),l=u(511),S=u(3734),x=u(2585),v=u(1480),y=u(6242),m=u(6351),C=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function E(j,D){if(j>24)return D.setWinLines||!1;switch(j){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var R;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(n.WindowsOptionsReportType=R={}));let k=0;class $ extends b.Disposable{getAttrData(){return this._curAttrData}constructor(D,O,T,B,q,K,oe,ce,W=new w.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=O,this._coreService=T,this._logService=B,this._optionsService=q,this._oscLinkService=K,this._coreMouseService=oe,this._unicodeService=ce,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o.StringToUtf32,this._utf8Decoder=new o.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((z=>this._activeBuffer=z.activeBuffer))),this._parser.setCsiHandlerFallback(((z,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(z),params:re.toArray()})})),this._parser.setEscHandlerFallback((z=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(z)})})),this._parser.setExecuteHandlerFallback((z=>{this._logService.debug("Unknown EXECUTE code: ",{code:z})})),this._parser.setOscHandlerFallback(((z,re,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:z,action:re,data:ee})})),this._parser.setDcsHandlerFallback(((z,re,ee)=>{re==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(z),action:re,payload:ee})})),this._parser.setPrintHandler(((z,re,ee)=>this.print(z,re,ee))),this._parser.registerCsiHandler({final:"@"},(z=>this.insertChars(z))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(z=>this.scrollLeft(z))),this._parser.registerCsiHandler({final:"A"},(z=>this.cursorUp(z))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(z=>this.scrollRight(z))),this._parser.registerCsiHandler({final:"B"},(z=>this.cursorDown(z))),this._parser.registerCsiHandler({final:"C"},(z=>this.cursorForward(z))),this._parser.registerCsiHandler({final:"D"},(z=>this.cursorBackward(z))),this._parser.registerCsiHandler({final:"E"},(z=>this.cursorNextLine(z))),this._parser.registerCsiHandler({final:"F"},(z=>this.cursorPrecedingLine(z))),this._parser.registerCsiHandler({final:"G"},(z=>this.cursorCharAbsolute(z))),this._parser.registerCsiHandler({final:"H"},(z=>this.cursorPosition(z))),this._parser.registerCsiHandler({final:"I"},(z=>this.cursorForwardTab(z))),this._parser.registerCsiHandler({final:"J"},(z=>this.eraseInDisplay(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(z=>this.eraseInDisplay(z,!0))),this._parser.registerCsiHandler({final:"K"},(z=>this.eraseInLine(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(z=>this.eraseInLine(z,!0))),this._parser.registerCsiHandler({final:"L"},(z=>this.insertLines(z))),this._parser.registerCsiHandler({final:"M"},(z=>this.deleteLines(z))),this._parser.registerCsiHandler({final:"P"},(z=>this.deleteChars(z))),this._parser.registerCsiHandler({final:"S"},(z=>this.scrollUp(z))),this._parser.registerCsiHandler({final:"T"},(z=>this.scrollDown(z))),this._parser.registerCsiHandler({final:"X"},(z=>this.eraseChars(z))),this._parser.registerCsiHandler({final:"Z"},(z=>this.cursorBackwardTab(z))),this._parser.registerCsiHandler({final:"`"},(z=>this.charPosAbsolute(z))),this._parser.registerCsiHandler({final:"a"},(z=>this.hPositionRelative(z))),this._parser.registerCsiHandler({final:"b"},(z=>this.repeatPrecedingCharacter(z))),this._parser.registerCsiHandler({final:"c"},(z=>this.sendDeviceAttributesPrimary(z))),this._parser.registerCsiHandler({prefix:">",final:"c"},(z=>this.sendDeviceAttributesSecondary(z))),this._parser.registerCsiHandler({final:"d"},(z=>this.linePosAbsolute(z))),this._parser.registerCsiHandler({final:"e"},(z=>this.vPositionRelative(z))),this._parser.registerCsiHandler({final:"f"},(z=>this.hVPosition(z))),this._parser.registerCsiHandler({final:"g"},(z=>this.tabClear(z))),this._parser.registerCsiHandler({final:"h"},(z=>this.setMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(z=>this.setModePrivate(z))),this._parser.registerCsiHandler({final:"l"},(z=>this.resetMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(z=>this.resetModePrivate(z))),this._parser.registerCsiHandler({final:"m"},(z=>this.charAttributes(z))),this._parser.registerCsiHandler({final:"n"},(z=>this.deviceStatus(z))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(z=>this.deviceStatusPrivate(z))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(z=>this.softReset(z))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(z=>this.setCursorStyle(z))),this._parser.registerCsiHandler({final:"r"},(z=>this.setScrollRegion(z))),this._parser.registerCsiHandler({final:"s"},(z=>this.saveCursor(z))),this._parser.registerCsiHandler({final:"t"},(z=>this.windowOptions(z))),this._parser.registerCsiHandler({final:"u"},(z=>this.restoreCursor(z))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(z=>this.insertColumns(z))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(z=>this.deleteColumns(z))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(z=>this.selectProtected(z))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(z=>this.requestMode(z,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(z=>this.requestMode(z,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new y.OscHandler((z=>(this.setTitle(z),this.setIconName(z),!0)))),this._parser.registerOscHandler(1,new y.OscHandler((z=>this.setIconName(z)))),this._parser.registerOscHandler(2,new y.OscHandler((z=>this.setTitle(z)))),this._parser.registerOscHandler(4,new y.OscHandler((z=>this.setOrReportIndexedColor(z)))),this._parser.registerOscHandler(8,new y.OscHandler((z=>this.setHyperlink(z)))),this._parser.registerOscHandler(10,new y.OscHandler((z=>this.setOrReportFgColor(z)))),this._parser.registerOscHandler(11,new y.OscHandler((z=>this.setOrReportBgColor(z)))),this._parser.registerOscHandler(12,new y.OscHandler((z=>this.setOrReportCursorColor(z)))),this._parser.registerOscHandler(104,new y.OscHandler((z=>this.restoreIndexedColor(z)))),this._parser.registerOscHandler(110,new y.OscHandler((z=>this.restoreFgColor(z)))),this._parser.registerOscHandler(111,new y.OscHandler((z=>this.restoreBgColor(z)))),this._parser.registerOscHandler(112,new y.OscHandler((z=>this.restoreCursorColor(z)))),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 z in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:z},(()=>this.selectCharset("("+z))),this._parser.registerEscHandler({intermediates:")",final:z},(()=>this.selectCharset(")"+z))),this._parser.registerEscHandler({intermediates:"*",final:z},(()=>this.selectCharset("*"+z))),this._parser.registerEscHandler({intermediates:"+",final:z},(()=>this.selectCharset("+"+z))),this._parser.registerEscHandler({intermediates:"-",final:z},(()=>this.selectCharset("-"+z))),this._parser.registerEscHandler({intermediates:".",final:z},(()=>this.selectCharset("."+z))),this._parser.registerEscHandler({intermediates:"/",final:z},(()=>this.selectCharset("/"+z)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((z=>(this._logService.error("Parsing error: ",z),z))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((z,re)=>this.requestStatusString(z,re))))}_preserveStack(D,O,T,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=T,this._parseStack.position=B}_logSlowResolvingAsync(D){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([D,new Promise(((O,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,O){let T,B=this._activeBuffer.x,q=this._activeBuffer.y,K=0;const oe=this._parseStack.paused;if(oe){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(T),T;B=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>A&&(K=this._parseStack.position+A)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(z=>String.fromCharCode(z))).join("")}"`),typeof D=="string"?D.split("").map((z=>z.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(D.length,A))),oe||this._dirtyRowTracker.clearRange(),D.length>A)for(let z=K;z<D.length;z+=A){const re=z+A<D.length?z+A:D.length,ee=typeof D=="string"?this._stringDecoder.decode(D.substring(z,re),this._parseBuffer):this._utf8Decoder.decode(D.subarray(z,re),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(B,q,ee,z),this._logSlowResolvingAsync(T),T}else if(!oe){const z=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,z))return this._preserveStack(B,q,z,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===B&&this._activeBuffer.y===q||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(ce,this._bufferService.rows-1))}print(D,O,T){let B,q;const K=this._charsetService.charset,oe=this._optionsService.rawOptions.screenReaderMode,ce=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,z=this._coreService.modes.insertMode,re=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-O>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let ve=this._parser.precedingJoinState;for(let fe=O;fe<T;++fe){if(B=D[fe],B<127&&K){const qe=K[String.fromCharCode(B)];qe&&(B=qe.charCodeAt(0))}const Me=this._unicodeService.charProperties(B,ve);q=v.UnicodeService.extractWidth(Me);const _e=v.UnicodeService.extractShouldJoin(Me),Oe=_e?v.UnicodeService.extractWidth(ve):0;if(ve=Me,oe&&this._onA11yChar.fire((0,o.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+q-Oe>ce){if(W){const qe=ee;let be=this._activeBuffer.x-Oe;for(this._activeBuffer.x=Oe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Oe>0&&ee instanceof r.BufferLine&&ee.copyCellsFrom(qe,be,0,Oe,!1);be<ce;)qe.setCellFromCodepoint(be++,0,1,re)}else if(this._activeBuffer.x=ce-1,q===2)continue}if(_e&&this._activeBuffer.x){const qe=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-qe,B,q);for(let be=q-Oe;--be>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(z&&(ee.insertCells(this._activeBuffer.x,q-Oe,this._activeBuffer.getNullCell(re)),ee.getWidth(ce-1)===2&&ee.setCellFromCodepoint(ce-1,c.NULL_CELL_CODE,c.NULL_CELL_WIDTH,re)),ee.setCellFromCodepoint(this._activeBuffer.x++,B,q,re),q>0)for(;--q;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=ve,this._activeBuffer.x<ce&&T-O>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,O){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,O):this._parser.registerCsiHandler(D,(T=>!E(T.params[0],this._optionsService.rawOptions.windowOptions)||O(T)))}registerDcsHandler(D,O){return this._parser.registerDcsHandler(D,new m.DcsHandler(O))}registerEscHandler(D,O){return this._parser.registerEscHandler(D,O)}registerOscHandler(D,O){return this._parser.registerOscHandler(D,new y.OscHandler(O))}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 D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=D,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+O)}cursorUp(D){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const O=D.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=D.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=D.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const O=D.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,O,T,B=!1,q=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);K.replaceCells(O,T,this._activeBuffer.getNullCell(this._eraseAttrData()),q),B&&(K.isWrapped=!1)}_resetBufferLine(D,O=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),T.isWrapped=!1)}eraseInDisplay(D,O=!1){let T;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);T<this._bufferService.rows;T++)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(D,O=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let O=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;O--;)this._activeBuffer.lines.splice(q-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let O=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;O--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let O=D.params[0]||1;for(;O--;)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(D){let O=D.params[0]||1;for(;O--;)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(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const O=this._parser.precedingJoinState;if(!O)return!0;const T=D.params[0]||1,B=v.UnicodeService.extractWidth(O),q=this._activeBuffer.x-B,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(q),oe=new Uint32Array(K.length*T);let ce=0;for(let z=0;z<K.length;){const re=K.codePointAt(z)||0;oe[ce++]=re,z+=re>65535?2:1}let W=ce;for(let z=1;z<T;++z)oe.copyWithin(W,0,ce),W+=ce;return this.print(oe,0,W),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let O=0;O<D.length;O++)switch(D.params[O]){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(),D.params[O]===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(D,O){const T=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:q}=this._coreMouseService,K=this._coreService,{buffers:oe,cols:ce}=this._bufferService,{active:W,alt:z}=oe,re=this._optionsService.rawOptions,ee=_e=>_e?1:2,ve=D.params[0];return fe=ve,Me=O?ve===2?4:ve===4?ee(K.modes.insertMode):ve===12?3:ve===20?ee(re.convertEol):0:ve===1?ee(T.applicationCursorKeys):ve===3?re.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:ve===6?ee(T.origin):ve===7?ee(T.wraparound):ve===8?3:ve===9?ee(B==="X10"):ve===12?ee(re.cursorBlink):ve===25?ee(!K.isCursorHidden):ve===45?ee(T.reverseWraparound):ve===66?ee(T.applicationKeypad):ve===67?4:ve===1e3?ee(B==="VT200"):ve===1002?ee(B==="DRAG"):ve===1003?ee(B==="ANY"):ve===1004?ee(T.sendFocus):ve===1005?4:ve===1006?ee(q==="SGR"):ve===1015?4:ve===1016?ee(q==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?ee(W===z):ve===2004?ee(T.bracketedPasteMode):0,K.triggerDataEvent(`${a.C0.ESC}[${O?"":"?"}${fe};${Me}$y`),!0;var fe,Me}_updateAttrColor(D,O,T,B,q){return O===2?(D|=50331648,D&=-16777216,D|=S.AttributeData.fromColorRGB([T,B,q])):O===5&&(D&=-50331904,D|=33554432|255&T),D}_extractColor(D,O,T){const B=[0,0,-1,0,0,0];let q=0,K=0;do{if(B[K+q]=D.params[O+K],D.hasSubParams(O+K)){const oe=D.getSubParams(O+K);let ce=0;do B[1]===5&&(q=1),B[K+ce+1+q]=oe[ce];while(++ce<oe.length&&ce+K+1+q<B.length);break}if(B[1]===5&&K+q>=2||B[1]===2&&K+q>=5)break;B[1]&&(q=1)}while(++K+O<D.length&&K+q<B.length);for(let oe=2;oe<B.length;++oe)B[oe]===-1&&(B[oe]=0);switch(B[0]){case 38:T.fg=this._updateAttrColor(T.fg,B[1],B[3],B[4],B[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,B[1],B[3],B[4],B[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,B[1],B[3],B[4],B[5])}return K}_processUnderline(D,O){O.extended=O.extended.clone(),(!~D||D>5)&&(D=1),O.extended.underlineStyle=D,O.fg|=268435456,D===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(D){D.fg=r.DEFAULT_ATTR_DATA.fg,D.bg=r.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=D.length;let T;const B=this._curAttrData;for(let q=0;q<O;q++)T=D.params[q],T>=30&&T<=37?(B.fg&=-50331904,B.fg|=16777216|T-30):T>=40&&T<=47?(B.bg&=-50331904,B.bg|=16777216|T-40):T>=90&&T<=97?(B.fg&=-50331904,B.fg|=16777224|T-90):T>=100&&T<=107?(B.bg&=-50331904,B.bg|=16777224|T-100):T===0?this._processSGR0(B):T===1?B.fg|=134217728:T===3?B.bg|=67108864:T===4?(B.fg|=268435456,this._processUnderline(D.hasSubParams(q)?D.getSubParams(q)[0]:1,B)):T===5?B.fg|=536870912:T===7?B.fg|=67108864:T===8?B.fg|=1073741824:T===9?B.fg|=2147483648:T===2?B.bg|=134217728:T===21?this._processUnderline(2,B):T===22?(B.fg&=-134217729,B.bg&=-134217729):T===23?B.bg&=-67108865:T===24?(B.fg&=-268435457,this._processUnderline(0,B)):T===25?B.fg&=-536870913:T===27?B.fg&=-67108865:T===28?B.fg&=-1073741825:T===29?B.fg&=2147483647:T===39?(B.fg&=-67108864,B.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):T===49?(B.bg&=-67108864,B.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?q+=this._extractColor(D,q,B):T===53?B.bg|=1073741824:T===55?B.bg&=-1073741825:T===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):T===100?(B.fg&=-67108864,B.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${O};${T}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${O};${T}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(D){const O=D.params[0]||1;switch(O){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 T=O%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(D){const O=D.params[0]||1;let T;return(D.length<2||(T=D.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(D){if(!E(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const O=[],T=D.split(";");for(;T.length>1;){const B=T.shift(),q=T.shift();if(/^\d+$/.exec(B)){const K=parseInt(B);if(P(K))if(q==="?")O.push({type:0,index:K});else{const oe=(0,C.parseColor)(q);oe&&O.push({type:1,index:K,color:oe})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(D){const O=D.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(D,O){this._getCurrentLinkId()&&this._finishHyperlink();const T=D.split(":");let B;const q=T.findIndex((K=>K.startsWith("id=")));return q!==-1&&(B=T[q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,O){const T=D.split(";");for(let B=0;B<T.length&&!(O>=this._specialColors.length);++B,++O)if(T[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const q=(0,C.parseColor)(T[B]);q&&this._onColor.fire([{type:1,index:this._specialColors[O],color:q}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const O=[],T=D.split(";");for(let B=0;B<T.length;++B)if(/^\d+$/.exec(T[B])){const q=parseInt(T[B]);P(q)&&O.push({type:2,index:q})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,p.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(L[D[0]],p.CHARSETS[D[1]]||p.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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new l.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const T=this._activeBuffer.ybase+this._activeBuffer.y+O,B=this._activeBuffer.lines.get(T);B&&(B.fill(D),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,O){const T=this._bufferService.buffer,B=this._optionsService.rawOptions;return(q=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${q}${a.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,O){this._dirtyRowTracker.markRangeDirty(D,O)}}n.InputHandler=$;let N=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,D){j>D&&(k=j,j=D,D=k),j<this.start&&(this.start=j),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(j){return 0<=j&&j<256}N=d([_(0,x.IBufferService)],N)},844:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},6114:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const _=this._getKey(d);if(_===void 0||(u=this._search(_),u===-1)||this._getKey(this._array[u])!==_)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===_);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,_){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do _(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let _=0,a=this._array.length-1;for(;a>=_;){let p=_+a>>1;const w=this._getKey(this._array[p]);if(w>d)a=p-1;else{if(!(w<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}_=p+1}}return _}}},7226:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=u(643);n.updateWindowsModeWrappedState=function(_){const a=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=a==null?void 0:a.get(_.cols-1),w=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);w&&p&&(w.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},9092:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=u(6349),_=u(7226),a=u(3734),p=u(8437),w=u(4634),b=u(511),o=u(643),r=u(4863),h=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(c,l,S){this._hasScrollback=c,this._optionsService=l,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(c){return c?(this._nullCell.fg=c.fg,this._nullCell.bg=c.bg,this._nullCell.extended=c.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(c){return c?(this._whitespaceCell.fg=c.fg,this._whitespaceCell.bg=c.bg,this._whitespaceCell.extended=c.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(c,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(c),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const c=this.ybase+this.y-this.ydisp;return c>=0&&c<this._rows}_getCorrectBufferLength(c){if(!this._hasScrollback)return c;const l=c+this._optionsService.rawOptions.scrollback;return l>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:l}fillViewportRows(c){if(this.lines.length===0){c===void 0&&(c=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(c))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(c,l){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=0;const v=this._getCorrectBufferLength(l);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<c)for(let m=0;m<this.lines.length;m++)x+=+this.lines.get(m).resize(c,S);let y=0;if(this._rows<l)for(let m=this._rows;m<l;m++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(c,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+y+1?(this.ybase--,y++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(c,S)));else for(let m=this._rows;m>l;m--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const m=this.lines.length-v;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=v}this.x=Math.min(this.x,c-1),this.y=Math.min(this.y,l-1),y&&(this.y+=y),this.savedX=Math.min(this.savedX,c-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(c,l),this._cols>c))for(let y=0;y<this.lines.length;y++)x+=+this.lines.get(y).resize(c,S);this._cols=c,this._rows=l,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let c=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,c=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return c}get _isReflowEnabled(){const c=this._optionsService.rawOptions.windowsPty;return c&&c.buildNumber?this._hasScrollback&&c.backend==="conpty"&&c.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(c,l){this._cols!==c&&(c>this._cols?this._reflowLarger(c,l):this._reflowSmaller(c,l))}_reflowLarger(c,l){const S=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,c,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(S.length>0){const x=(0,w.reflowLargerCreateNewLayout)(this.lines,S);(0,w.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(c,l,x.countRemoved)}}_reflowLargerAdjustViewport(c,l,S){const x=this.getNullCell(p.DEFAULT_ATTR_DATA);let v=S;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(c,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(c,l){const S=this.getNullCell(p.DEFAULT_ATTR_DATA),x=[];let v=0;for(let y=this.lines.length-1;y>=0;y--){let m=this.lines.get(y);if(!m||!m.isWrapped&&m.getTrimmedLength()<=c)continue;const C=[m];for(;m.isWrapped&&y>0;)m=this.lines.get(--y),C.unshift(m);const L=this.ybase+this.y;if(L>=y&&L<y+C.length)continue;const A=C[C.length-1].getTrimmedLength(),E=(0,w.reflowSmallerGetNewLineLengths)(C,this._cols,c),R=E.length-C.length;let k;k=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+R):Math.max(0,this.lines.length-this.lines.maxLength+R);const $=[];for(let T=0;T<R;T++){const B=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);$.push(B)}$.length>0&&(x.push({start:y+C.length+v,newLines:$}),v+=$.length),C.push(...$);let N=E.length-1,P=E[N];P===0&&(N--,P=E[N]);let j=C.length-R-1,D=A;for(;j>=0;){const T=Math.min(D,P);if(C[N]===void 0)break;if(C[N].copyCellsFrom(C[j],D-T,P-T,T,!0),P-=T,P===0&&(N--,P=E[N]),D-=T,D===0){j--;const B=Math.max(j,0);D=(0,w.getWrappedLineTrimmedLength)(C,B,this._cols)}}for(let T=0;T<C.length;T++)E[T]<c&&C[T].setCell(E[T],S);let O=R-k;for(;O-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+R,this.ybase+l-1)}if(x.length>0){const y=[],m=[];for(let N=0;N<this.lines.length;N++)m.push(this.lines.get(N));const C=this.lines.length;let L=C-1,A=0,E=x[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let R=0;for(let N=Math.min(this.lines.maxLength-1,C+v-1);N>=0;N--)if(E&&E.start>L+R){for(let P=E.newLines.length-1;P>=0;P--)this.lines.set(N--,E.newLines[P]);N++,y.push({index:L+1,amount:E.newLines.length}),R+=E.newLines.length,E=x[++A]}else this.lines.set(N,m[L--]);let k=0;for(let N=y.length-1;N>=0;N--)y[N].index+=k,this.lines.onInsertEmitter.fire(y[N]),k+=y[N].amount;const $=Math.max(0,C+v-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(c,l,S=0,x){const v=this.lines.get(c);return v?v.translateToString(l,S,x):""}getWrappedRangeForLine(c){let l=c,S=c;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:l,last:S}}setupTabStops(c){for(c!=null?this.tabs[c]||(c=this.prevStop(c)):(this.tabs={},c=0);c<this._cols;c+=this._optionsService.rawOptions.tabStopWidth)this.tabs[c]=!0}prevStop(c){for(c==null&&(c=this.x);!this.tabs[--c]&&c>0;);return c>=this._cols?this._cols-1:c<0?0:c}nextStop(c){for(c==null&&(c=this.x);!this.tabs[++c]&&c<this._cols;);return c>=this._cols?this._cols-1:c<0?0:c}clearMarkers(c){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===c&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].dispose(),this.markers.splice(c--,1);this._isClearing=!1}addMarker(c){const l=new r.Marker(c);return this.markers.push(l),l.register(this.lines.onTrim((S=>{l.line-=S,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((S=>{l.line>=S.index&&(l.line+=S.amount)}))),l.register(this.lines.onDelete((S=>{l.line>=S.index&&l.line<S.index+S.amount&&l.dispose(),l.line>S.index&&(l.line-=S.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(c){this._isClearing||this.markers.splice(this.markers.indexOf(c),1)}}},8437:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=u(3734),_=u(511),a=u(643),p=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class b{constructor(r,h,c=!1){this.isWrapped=c,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const l=h||_.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let S=0;S<r;++S)this.setCell(S,l);this.length=r}get(r){const h=this._data[3*r+0],c=2097151&h;return[this._data[3*r+1],2097152&h?this._combined[r]:c?(0,p.stringFromCodePoint)(c):"",h>>22,2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):c]}set(r,h){this._data[3*r+1]=h[a.CHAR_DATA_ATTR_INDEX],h[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=h[1],this._data[3*r+0]=2097152|r|h[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=h[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&h}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r]:2097151&h?(0,p.stringFromCodePoint)(2097151&h):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,h){return w=3*r,h.content=this._data[w+0],h.fg=this._data[w+1],h.bg=this._data[w+2],2097152&h.content&&(h.combinedData=this._combined[r]),268435456&h.bg&&(h.extended=this._extendedAttrs[r]),h}setCell(r,h){2097152&h.content&&(this._combined[r]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[r]=h.extended),this._data[3*r+0]=h.content,this._data[3*r+1]=h.fg,this._data[3*r+2]=h.bg}setCellFromCodepoint(r,h,c,l){268435456&l.bg&&(this._extendedAttrs[r]=l.extended),this._data[3*r+0]=h|c<<22,this._data[3*r+1]=l.fg,this._data[3*r+2]=l.bg}addCodepointToCell(r,h,c){let l=this._data[3*r+0];2097152&l?this._combined[r]+=(0,p.stringFromCodePoint)(h):2097151&l?(this._combined[r]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(h),l&=-2097152,l|=2097152):l=h|4194304,c&&(l&=-12582913,l|=c<<22),this._data[3*r+0]=l}insertCells(r,h,c){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length-r){const l=new _.CellData;for(let S=this.length-r-h-1;S>=0;--S)this.setCell(r+h+S,this.loadCell(r+S,l));for(let S=0;S<h;++S)this.setCell(r+S,c)}else for(let l=r;l<this.length;++l)this.setCell(l,c);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,c)}deleteCells(r,h,c){if(r%=this.length,h<this.length-r){const l=new _.CellData;for(let S=0;S<this.length-r-h;++S)this.setCell(r+S,this.loadCell(r+h+S,l));for(let S=this.length-h;S<this.length;++S)this.setCell(S,c)}else for(let l=r;l<this.length;++l)this.setCell(l,c);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,c)}replaceCells(r,h,c,l=!1){if(l)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,c);r<h&&r<this.length;)this.isProtected(r)||this.setCell(r,c),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,c);r<h&&r<this.length;)this.setCell(r++,c)}resize(r,h){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const c=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*c)this._data=new Uint32Array(this._data.buffer,0,c);else{const l=new Uint32Array(c);l.set(this._data),this._data=l}for(let l=this.length;l<r;++l)this.setCell(l,h)}else{this._data=this._data.subarray(0,c);const l=Object.keys(this._combined);for(let x=0;x<l.length;x++){const v=parseInt(l[x],10);v>=r&&delete this._combined[v]}const S=Object.keys(this._extendedAttrs);for(let x=0;x<S.length;x++){const v=parseInt(S[x],10);v>=r&&delete this._extendedAttrs[v]}}return this.length=r,4*c*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,h=!1){if(h)for(let c=0;c<this.length;++c)this.isProtected(c)||this.setCell(c,r);else{this._combined={},this._extendedAttrs={};for(let c=0;c<this.length;++c)this.setCell(c,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const h in r._combined)this._combined[h]=r._combined[h];this._extendedAttrs={};for(const h in r._extendedAttrs)this._extendedAttrs[h]=r._extendedAttrs[h];this.isWrapped=r.isWrapped}clone(){const r=new b(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const h in this._combined)r._combined[h]=this._combined[h];for(const h in this._extendedAttrs)r._extendedAttrs[h]=this._extendedAttrs[h];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,h,c,l,S){const x=r._data;if(S)for(let y=l-1;y>=0;y--){for(let m=0;m<3;m++)this._data[3*(c+y)+m]=x[3*(h+y)+m];268435456&x[3*(h+y)+2]&&(this._extendedAttrs[c+y]=r._extendedAttrs[h+y])}else for(let y=0;y<l;y++){for(let m=0;m<3;m++)this._data[3*(c+y)+m]=x[3*(h+y)+m];268435456&x[3*(h+y)+2]&&(this._extendedAttrs[c+y]=r._extendedAttrs[h+y])}const v=Object.keys(r._combined);for(let y=0;y<v.length;y++){const m=parseInt(v[y],10);m>=h&&(this._combined[m-h+c]=r._combined[m])}}translateToString(r,h,c,l){h=h??0,c=c??this.length,r&&(c=Math.min(c,this.getTrimmedLength())),l&&(l.length=0);let S="";for(;h<c;){const x=this._data[3*h+0],v=2097151&x,y=2097152&x?this._combined[h]:v?(0,p.stringFromCodePoint)(v):a.WHITESPACE_CELL_CHAR;if(S+=y,l)for(let m=0;m<y.length;++m)l.push(h);h+=x>>22||1}return l&&l.push(h),S}}n.BufferLine=b},4841:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(F,n)=>{function u(d,_,a){if(_===d.length-1)return d[_].getTrimmedLength();const p=!d[_].hasContent(a-1)&&d[_].getWidth(a-1)===1,w=d[_+1].getWidth(0)===2;return p&&w?a-1:a}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(d,_,a,p,w){const b=[];for(let o=0;o<d.length-1;o++){let r=o,h=d.get(++r);if(!h.isWrapped)continue;const c=[d.get(o)];for(;r<d.length&&h.isWrapped;)c.push(h),h=d.get(++r);if(p>=o&&p<r){o+=c.length-1;continue}let l=0,S=u(c,l,_),x=1,v=0;for(;x<c.length;){const m=u(c,x,_),C=m-v,L=a-S,A=Math.min(C,L);c[l].copyCellsFrom(c[x],v,S,A,!1),S+=A,S===a&&(l++,S=0),v+=A,v===m&&(x++,v=0),S===0&&l!==0&&c[l-1].getWidth(a-1)===2&&(c[l].copyCellsFrom(c[l-1],a-1,S++,1,!1),c[l-1].setCell(a-1,w))}c[l].replaceCells(S,a,w);let y=0;for(let m=c.length-1;m>0&&(m>l||c[m].getTrimmedLength()===0);m--)y++;y>0&&(b.push(o+c.length-y),b.push(y)),o+=c.length-1}return b},n.reflowLargerCreateNewLayout=function(d,_){const a=[];let p=0,w=_[p],b=0;for(let o=0;o<d.length;o++)if(w===o){const r=_[++p];d.onDeleteEmitter.fire({index:o-b,amount:r}),o+=r-1,b+=r,w=_[++p]}else a.push(o);return{layout:a,countRemoved:b}},n.reflowLargerApplyNewLayout=function(d,_){const a=[];for(let p=0;p<_.length;p++)a.push(d.get(_[p]));for(let p=0;p<a.length;p++)d.set(p,a[p]);d.length=_.length},n.reflowSmallerGetNewLineLengths=function(d,_,a){const p=[],w=d.map(((h,c)=>u(d,c,_))).reduce(((h,c)=>h+c));let b=0,o=0,r=0;for(;r<w;){if(w-r<a){p.push(w-r);break}b+=a;const h=u(d,o,_);b>h&&(b-=h,o++);const c=d[o].getWidth(b-1)===2;c&&b--;const l=c?a-1:a;p.push(l),r+=l}return p},n.getWrappedLineTrimmedLength=u},5295:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=u(8460),_=u(844),a=u(9092);class p extends _.Disposable{constructor(b,o){super(),this._optionsService=b,this._bufferService=o,this._onBufferActivate=this.register(new d.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,o){this._normal.resize(b,o),this._alt.resize(b,o),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}n.BufferSet=p},511:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(482),_=u(643),a=u(3734);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},643:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=u(8460),_=u(844);class a{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}n.Marker=a,a._nextId=1},7116:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(F,n)=>{var u,d,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
56
- `,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(u||(n.C0=u={})),(function(a){a.PAD="€",a.HOP="",a.BPH="‚",a.NBH="ƒ",a.IND="„",a.NEL="…",a.SSA="†",a.ESA="‡",a.HTS="ˆ",a.HTJ="‰",a.VTS="Š",a.PLD="‹",a.PLU="Œ",a.RI="",a.SS2="Ž",a.SS3="",a.DCS="",a.PU1="‘",a.PU2="’",a.STS="“",a.CCH="”",a.MW="•",a.SPA="–",a.EPA="—",a.SOS="˜",a.SGCI="™",a.SCI="š",a.CSI="›",a.ST="œ",a.OSC="",a.PM="ž",a.APC="Ÿ"})(d||(n.C1=d={})),(function(a){a.ST=`${u.ESC}\\`})(_||(n.C1_ESCAPED=_={}))},7399:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=u(2584),_={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:["'",'"']};n.evaluateKeyboardEvent=function(a,p,w,b){const o={type:0,cancel:!1,key:void 0},r=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?o.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?o.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?o.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(o.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:o.key=a.ctrlKey?"\b":d.C0.DEL,a.altKey&&(o.key=d.C0.ESC+o.key);break;case 9:if(a.shiftKey){o.key=d.C0.ESC+"[Z";break}o.key=d.C0.HT,o.cancel=!0;break;case 13:o.key=a.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,o.cancel=!0;break;case 27:o.key=d.C0.ESC,a.altKey&&(o.key=d.C0.ESC+d.C0.ESC),o.cancel=!0;break;case 37:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"D",o.key===d.C0.ESC+"[1;3D"&&(o.key=d.C0.ESC+(w?"b":"[1;5D"))):o.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"C",o.key===d.C0.ESC+"[1;3C"&&(o.key=d.C0.ESC+(w?"f":"[1;5C"))):o.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"A",w||o.key!==d.C0.ESC+"[1;3A"||(o.key=d.C0.ESC+"[1;5A")):o.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"B",w||o.key!==d.C0.ESC+"[1;3B"||(o.key=d.C0.ESC+"[1;5B")):o.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(o.key=d.C0.ESC+"[2~");break;case 46:o.key=r?d.C0.ESC+"[3;"+(r+1)+"~":d.C0.ESC+"[3~";break;case 36:o.key=r?d.C0.ESC+"[1;"+(r+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:o.key=r?d.C0.ESC+"[1;"+(r+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:a.shiftKey?o.type=2:a.ctrlKey?o.key=d.C0.ESC+"[5;"+(r+1)+"~":o.key=d.C0.ESC+"[5~";break;case 34:a.shiftKey?o.type=3:a.ctrlKey?o.key=d.C0.ESC+"[6;"+(r+1)+"~":o.key=d.C0.ESC+"[6~";break;case 112:o.key=r?d.C0.ESC+"[1;"+(r+1)+"P":d.C0.ESC+"OP";break;case 113:o.key=r?d.C0.ESC+"[1;"+(r+1)+"Q":d.C0.ESC+"OQ";break;case 114:o.key=r?d.C0.ESC+"[1;"+(r+1)+"R":d.C0.ESC+"OR";break;case 115:o.key=r?d.C0.ESC+"[1;"+(r+1)+"S":d.C0.ESC+"OS";break;case 116:o.key=r?d.C0.ESC+"[15;"+(r+1)+"~":d.C0.ESC+"[15~";break;case 117:o.key=r?d.C0.ESC+"[17;"+(r+1)+"~":d.C0.ESC+"[17~";break;case 118:o.key=r?d.C0.ESC+"[18;"+(r+1)+"~":d.C0.ESC+"[18~";break;case 119:o.key=r?d.C0.ESC+"[19;"+(r+1)+"~":d.C0.ESC+"[19~";break;case 120:o.key=r?d.C0.ESC+"[20;"+(r+1)+"~":d.C0.ESC+"[20~";break;case 121:o.key=r?d.C0.ESC+"[21;"+(r+1)+"~":d.C0.ESC+"[21~";break;case 122:o.key=r?d.C0.ESC+"[23;"+(r+1)+"~":d.C0.ESC+"[23~";break;case 123:o.key=r?d.C0.ESC+"[24;"+(r+1)+"~":d.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(w&&!b||!a.altKey||a.metaKey)!w||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?o.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(o.key=d.C0.US),a.key==="@"&&(o.key=d.C0.NUL)):a.keyCode===65&&(o.type=1);else{const h=_[a.keyCode],c=h==null?void 0:h[a.shiftKey?1:0];if(c)o.key=d.C0.ESC+c;else if(a.keyCode>=65&&a.keyCode<=90){const l=a.ctrlKey?a.keyCode-64:a.keyCode+32;let S=String.fromCharCode(l);a.shiftKey&&(S=S.toUpperCase()),o.key=d.C0.ESC+S}else if(a.keyCode===32)o.key=d.C0.ESC+(a.ctrlKey?d.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let l=a.code.slice(3,4);a.shiftKey||(l=l.toLowerCase()),o.key=d.C0.ESC+l,o.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?o.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?o.key=d.C0.NUL:a.keyCode>=51&&a.keyCode<=55?o.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?o.key=d.C0.DEL:a.keyCode===219?o.key=d.C0.ESC:a.keyCode===220?o.key=d.C0.FS:a.keyCode===221&&(o.key=d.C0.GS)}return o}},482:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},225:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const d=u(1480),_=[[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]],a=[[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 p;n.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let w=0;w<_.length;++w)p.fill(0,_[w][0],_[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?p[w]:(function(b,o){let r,h=0,c=o.length-1;if(b<o[0][0]||b>o[c][1])return!1;for(;c>=h;)if(r=h+c>>1,b>o[r][1])h=r+1;else{if(!(b<o[r][0]))return!0;c=r-1}return!1})(w,a)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,b){let o=this.wcwidth(w),r=o===0&&b!==0;if(r){const h=d.UnicodeService.extractWidth(b);h===0?r=!1:h>o&&(o=h)}return d.UnicodeService.createPropertyValue(0,o,r)}}},5981:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let o;for(this._isSyncWriting=!0;o=this._writeBuffer.shift();){this._action(o);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(b)}_innerWrite(w=0,b=!0){const o=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],h=this._action(r,b);if(h){const l=S=>Date.now()-o>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(o,S);return void h.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(l)}const c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-o>=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()}}n.WriteBuffer=a},5941:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function _(a,p){const w=a.toString(16),b=w.length<2?"0"+w:w;switch(p){case 4:return w[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}n.parseColor=function(a){if(!a)return;let p=a.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const w=u.exec(p);if(w){const b=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/b*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/b*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/b*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const w=p.length/3,b=[0,0,0];for(let o=0;o<3;++o){const r=parseInt(p.slice(w*o,w*o+w),16);b[o]=w===1?r<<4:w===2?r:w===3?r>>4:r>>8}return b}},n.toRgbString=function(a,p=16){const[w,b,o]=a;return`rgb:${_(w,p)}/${_(b,p)}/${_(o,p)}`}},5770:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=u(482),_=u(8742),a=u(5770),p=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(b,o){this._handlers[b]===void 0&&(this._handlers[b]=[]);const r=this._handlers[b];return r.push(o),{dispose:()=>{const h=r.indexOf(o);h!==-1&&r.splice(h,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(b,o){if(this.reset(),this._ident=b,this._active=this._handlers[b]||p,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(o);else this._handlerFb(this._ident,"HOOK",o)}put(b,o,r){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(b,o,r);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(b,o,r))}unhook(b,o=!0){if(this._active.length){let r=!1,h=this._active.length-1,c=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,r=o,c=this._stack.fallThrough,this._stack.paused=!1),!c&&r===!1){for(;h>=0&&(r=this._active[h].unhook(b),r!==!0);h--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,r;h--}for(;h>=0;h--)if(r=this._active[h].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",b);this._active=p,this._ident=0}};const w=new _.Params;w.addParam(0),n.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=w,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():w,this._data="",this._hitLimit=!1}put(b,o,r){this._hitLimit||(this._data+=(0,d.utf32ToString)(b,o,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let o=!1;if(this._hitLimit)o=!1;else if(b&&(o=this._handler(this._data,this._params),o instanceof Promise))return o.then((r=>(this._params=w,this._data="",this._hitLimit=!1,r)));return this._params=w,this._data="",this._hitLimit=!1,o}}},2015:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=u(844),_=u(8742),a=u(6242),p=u(6351);class w{constructor(h){this.table=new Uint8Array(h)}setDefault(h,c){this.table.fill(h<<4|c)}add(h,c,l,S){this.table[c<<8|h]=l<<4|S}addMany(h,c,l,S){for(let x=0;x<h.length;x++)this.table[c<<8|h[x]]=l<<4|S}}n.TransitionTable=w;const b=160;n.VT500_TRANSITION_TABLE=(function(){const r=new w(4095),h=Array.apply(null,Array(256)).map(((y,m)=>m)),c=(y,m)=>h.slice(y,m),l=c(32,127),S=c(0,24);S.push(25),S.push.apply(S,c(28,32));const x=c(0,14);let v;for(v in r.setDefault(1,0),r.addMany(l,0,2,0),x)r.addMany([24,26,153,154],v,3,0),r.addMany(c(128,144),v,3,0),r.addMany(c(144,152),v,3,0),r.add(156,v,0,0),r.add(27,v,11,1),r.add(157,v,4,8),r.addMany([152,158,159],v,0,7),r.add(155,v,11,3),r.add(144,v,11,9);return r.addMany(S,0,3,0),r.addMany(S,1,3,1),r.add(127,1,0,1),r.addMany(S,8,0,8),r.addMany(S,3,3,3),r.add(127,3,0,3),r.addMany(S,4,3,4),r.add(127,4,0,4),r.addMany(S,6,3,6),r.addMany(S,5,3,5),r.add(127,5,0,5),r.addMany(S,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(l,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(c(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(l,7,0,7),r.addMany(S,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(c(64,127),3,7,0),r.addMany(c(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(c(48,60),4,8,4),r.addMany(c(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(c(32,64),6,0,6),r.add(127,6,0,6),r.addMany(c(64,127),6,0,0),r.addMany(c(32,48),3,9,5),r.addMany(c(32,48),5,9,5),r.addMany(c(48,64),5,0,6),r.addMany(c(64,127),5,7,0),r.addMany(c(32,48),4,9,5),r.addMany(c(32,48),1,9,2),r.addMany(c(32,48),2,9,2),r.addMany(c(48,127),2,10,0),r.addMany(c(48,80),1,10,0),r.addMany(c(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(c(96,127),1,10,0),r.add(80,1,11,9),r.addMany(S,9,0,9),r.add(127,9,0,9),r.addMany(c(28,32),9,0,9),r.addMany(c(32,48),9,9,12),r.addMany(c(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(S,11,0,11),r.addMany(c(32,128),11,0,11),r.addMany(c(28,32),11,0,11),r.addMany(S,10,0,10),r.add(127,10,0,10),r.addMany(c(28,32),10,0,10),r.addMany(c(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(c(32,48),10,9,12),r.addMany(S,12,0,12),r.add(127,12,0,12),r.addMany(c(28,32),12,0,12),r.addMany(c(32,48),12,9,12),r.addMany(c(48,64),12,0,11),r.addMany(c(64,127),12,12,13),r.addMany(c(64,127),10,12,13),r.addMany(c(64,127),9,12,13),r.addMany(S,13,13,13),r.addMany(l,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(b,0,2,0),r.add(b,8,5,8),r.add(b,6,0,6),r.add(b,11,0,11),r.add(b,13,13,13),r})();class o extends d.Disposable{constructor(h=n.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(c,l,S)=>{},this._executeHandlerFb=c=>{},this._csiHandlerFb=(c,l)=>{},this._escHandlerFb=c=>{},this._errorHandlerFb=c=>c,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,c=[64,126]){let l=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=h.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<h.intermediates.length;++x){const v=h.intermediates.charCodeAt(x);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=v}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(c[0]>S||S>c[1])throw new Error(`final must be in range ${c[0]} .. ${c[1]}`);return l<<=8,l|=S,l}identToString(h){const c=[];for(;h;)c.push(String.fromCharCode(255&h)),h>>=8;return c.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,c){const l=this._identifier(h,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const S=this._escHandlers[l];return S.push(c),{dispose:()=>{const x=S.indexOf(c);x!==-1&&S.splice(x,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,c){this._executeHandlers[h.charCodeAt(0)]=c}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,c){const l=this._identifier(h);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const S=this._csiHandlers[l];return S.push(c),{dispose:()=>{const x=S.indexOf(c);x!==-1&&S.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,c){return this._dcsParser.registerHandler(this._identifier(h),c)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,c){return this._oscParser.registerHandler(h,c)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,c,l,S,x){this._parseStack.state=h,this._parseStack.handlers=c,this._parseStack.handlerPos=l,this._parseStack.transition=S,this._parseStack.chunkPos=x}parse(h,c,l){let S,x=0,v=0,y=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,y=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&C>-1){for(;C>=0&&(S=m[C](this._params),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 4:if(l===!1&&C>-1){for(;C>=0&&(S=m[C](),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(x!==24&&x!==26,l),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=h[this._parseStack.chunkPos],S=this._oscParser.end(x!==24&&x!==26,l),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,y=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=y;m<c;++m){switch(x=h[m],v=this._transitions.table[this.currentState<<8|(x<160?x:b)],v>>4){case 2:for(let R=m+1;;++R){if(R>=c||(x=h[R])<32||x>126&&x<b){this._printHandler(h,m,R),m=R-1;break}if(++R>=c||(x=h[R])<32||x>126&&x<b){this._printHandler(h,m,R),m=R-1;break}if(++R>=c||(x=h[R])<32||x>126&&x<b){this._printHandler(h,m,R),m=R-1;break}if(++R>=c||(x=h[R])<32||x>126&&x<b){this._printHandler(h,m,R),m=R-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const C=this._csiHandlers[this._collect<<8|x];let L=C?C.length-1:-1;for(;L>=0&&(S=C[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._preserveStack(3,C,L,v,m),S;L<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++m<c&&(x=h[m])>47&&x<60);m--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const A=this._escHandlers[this._collect<<8|x];let E=A?A.length-1:-1;for(;E>=0&&(S=A[E](),S!==!0);E--)if(S instanceof Promise)return this._preserveStack(4,A,E,v,m),S;E<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let R=m+1;;++R)if(R>=c||(x=h[R])===24||x===26||x===27||x>127&&x<b){this._dcsParser.put(h,m,R),m=R-1;break}break;case 14:if(S=this._dcsParser.unhook(x!==24&&x!==26),S)return this._preserveStack(6,[],0,v,m),S;x===27&&(v|=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 R=m+1;;R++)if(R>=c||(x=h[R])<32||x>127&&x<b){this._oscParser.put(h,m,R),m=R-1;break}break;case 6:if(S=this._oscParser.end(x!==24&&x!==26),S)return this._preserveStack(5,[],0,v,m),S;x===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&v}}}n.EscapeSequenceParser=o},6242:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=u(5770),_=u(482),a=[];n.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,w){this._handlers[p]===void 0&&(this._handlers[p]=[]);const b=this._handlers[p];return b.push(w),{dispose:()=>{const o=b.indexOf(w);o!==-1&&b.splice(o,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,w,b){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(p,w,b);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,w,b))}start(){this.reset(),this._state=1}put(p,w,b){if(this._state!==3){if(this._state===1)for(;w<b;){const o=p[w++];if(o===59){this._state=2,this._start();break}if(o<48||57<o)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+o-48}this._state===2&&b-w>0&&this._put(p,w,b)}}end(p,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,o=this._active.length-1,r=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,b=w,r=this._stack.fallThrough,this._stack.paused=!1),!r&&b===!1){for(;o>=0&&(b=this._active[o].end(p),b!==!0);o--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,b;o--}for(;o>=0;o--)if(b=this._active[o].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",p);this._active=a,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,w,b){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,w,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let w=!1;if(this._hitLimit)w=!1;else if(p&&(w=this._handler(this._data),w instanceof Promise))return w.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,w}}},8742:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class d{static fromArray(a){const p=new d;if(!a.length)return p;for(let w=Array.isArray(a[0])?1:0;w<a.length;++w){const b=a[w];if(Array.isArray(b))for(let o=0;o<b.length;++o)p.addSubParam(b[o]);else p.addParam(b)}return p}constructor(a=32,p=32){if(this.maxLength=a,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new d(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let p=0;p<this.length;++p){a.push(this.params[p]);const w=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];b-w>0&&a.push(Array.prototype.slice.call(this._subParams,w,b))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>u?u:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>u?u:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const p=this._subParamsIdx[a]>>8,w=255&this._subParamsIdx[a];return w-p>0?this._subParams.subarray(p,w):null}getSubParamsAll(){const a={};for(let p=0;p<this.length;++p){const w=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];b-w>0&&(a[p]=this._subParams.slice(w,b))}return a}addDigit(a){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,b=w[p-1];w[p-1]=~b?Math.min(10*b+a,u):a}}n.Params=d},5741:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const _={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(_),d.dispose=()=>this._wrappedAddonDispose(_),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===u){d=_;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=u(3785),_=u(511);n.BufferApiView=class{constructor(a,p){this._buffer=a,this.type=p}init(a){return this._buffer=a,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(a){const p=this._buffer.lines.get(a);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=u(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,a){if(!(_<0||_>=this._line.length))return a?(this._line.loadCell(_,a),a):this._line.loadCell(_,new d.CellData)}translateToString(_,a,p){return this._line.translateToString(_,a,p)}}},8285:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=u(8771),_=u(8460),a=u(844);class p extends a.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}n.BufferNamespaceApi=p},7975:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(_=>d(_.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((_,a)=>d(_,a.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const a=u(8460),p=u(844),w=u(5295),b=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let o=n.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(r,this))}resize(r,h){this.cols=r,this.rows=h,this.buffers.resize(r,h),this._onResize.fire({cols:r,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,h=!1){const c=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===r.fg&&l.getBg(0)===r.bg||(l=c.getBlankLine(r,h),this._cachedBlankLine=l),l.isWrapped=h;const S=c.ybase+c.scrollTop,x=c.ybase+c.scrollBottom;if(c.scrollTop===0){const v=c.lines.isFull;x===c.lines.length-1?v?c.lines.recycle().copyFrom(l):c.lines.push(l.clone()):c.lines.splice(x+1,0,l.clone()),v?this.isUserScrolling&&(c.ydisp=Math.max(c.ydisp-1,0)):(c.ybase++,this.isUserScrolling||c.ydisp++)}else{const v=x-S+1;c.lines.shiftElements(S+1,v-1,-1),c.lines.set(x,l.clone())}this.isUserScrolling||(c.ydisp=c.ybase),this._onScroll.fire(c.ydisp)}scrollLines(r,h,c){const l=this.buffer;if(r<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else r+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const S=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+r,l.ybase),0),S!==l.ydisp&&(h||this._onScroll.fire(l.ydisp))}};n.BufferService=o=d([_(0,b.IOptionsService)],o)},7994:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(F,n,u){var d=this&&this.__decorate||function(l,S,x,v){var y,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,S,x,v);else for(var L=l.length-1;L>=0;L--)(y=l[L])&&(C=(m<3?y(C):m>3?y(S,x,C):y(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(l,S){return function(x,v){S(x,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const a=u(2585),p=u(8460),w=u(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function o(l,S){let x=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(x|=64,x|=l.action):(x|=3&l.button,4&l.button&&(x|=64),8&l.button&&(x|=128),l.action===32?x|=32:l.action!==0||S||(x|=3)),x}const r=String.fromCharCode,h={DEFAULT:l=>{const S=[o(l,!1)+32,l.col+32,l.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${r(S[0])}${r(S[1])}${r(S[2])}`},SGR:l=>{const S=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${o(l,!0)};${l.col};${l.row}${S}`},SGR_PIXELS:l=>{const S=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${o(l,!0)};${l.x};${l.y}${S}`}};let c=n.CoreMouseService=class extends w.Disposable{constructor(l,S){super(),this._bufferService=l,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(b))this.addProtocol(x,b[x]);for(const x of Object.keys(h))this.addEncoding(x,h[x]);this.reset()}addProtocol(l,S){this._protocols[l]=S}addEncoding(l,S){this._encodings[l]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const S=this._encodings[this._activeEncoding](l);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,S,x){if(x){if(l.x!==S.x||l.y!==S.y)return!1}else if(l.col!==S.col||l.row!==S.row)return!1;return l.button===S.button&&l.action===S.action&&l.ctrl===S.ctrl&&l.alt===S.alt&&l.shift===S.shift}};n.CoreMouseService=c=d([_(0,a.IBufferService),_(1,a.ICoreService)],c)},6975:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const a=u(1439),p=u(8460),w=u(844),b=u(2585),o=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=n.CoreService=class extends w.Disposable{constructor(c,l,S){super(),this._bufferService=c,this._logService=l,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(o),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(o),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(c,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${c}"`,(()=>c.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(c)}triggerBinaryEvent(c){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${c}"`,(()=>c.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(c))}};n.CoreService=h=d([_(0,b.IBufferService),_(1,b.ILogService),_(2,b.IOptionsService)],h)},9074:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=u(8055),_=u(8460),a=u(844),p=u(6106);let w=0,b=0;class o extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((c=>c==null?void 0:c.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(c){if(c.marker.isDisposed)return;const l=new r(c);if(l){const S=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),S.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const c of this._decorations.values())c.dispose();this._decorations.clear()}*getDecorationsAtCell(c,l,S){let x=0,v=0;for(const y of this._decorations.getKeyIterator(l))x=y.options.x??0,v=x+(y.options.width??1),c>=x&&c<v&&(!S||(y.options.layer??"bottom")===S)&&(yield y)}forEachDecorationAtCell(c,l,S,x){this._decorations.forEachByKey(l,(v=>{w=v.options.x??0,b=w+(v.options.width??1),c>=w&&c<b&&(!S||(v.options.layer??"bottom")===S)&&x(v)}))}}n.DecorationService=o;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(c){super(),this.options=c,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=c.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=u(2585),_=u(8343);class a{constructor(...w){this._entries=new Map;for(const[b,o]of w)this.set(b,o)}set(w,b){const o=this._entries.get(w);return this._entries.set(w,b),o}forEach(w){for(const[b,o]of this._entries.entries())w(b,o)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}n.ServiceCollection=a,n.InstantiationService=class{constructor(){this._services=new a,this._services.set(d.IInstantiationService,this)}setService(p,w){this._services.set(p,w)}getService(p){return this._services.get(p)}createInstance(p,...w){const b=(0,_.getServiceDependencies)(p).sort(((h,c)=>h.index-c.index)),o=[];for(const h of b){const c=this._services.get(h.id);if(!c)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${h.id}.`);o.push(c)}const r=b.length>0?b[0].index:w.length;if(w.length!==r)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${r+1} conflicts with ${w.length} static arguments`);return new p(...w,...o)}}},7866:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(844),p=u(2585),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},7302:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=u(8460),_=u(844),a=u(6114);n.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:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends _.Disposable{constructor(o){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const h in o)if(h in r)try{const c=o[h];r[h]=this._sanitizeAndValidateOption(h,c)}catch(c){console.error(c)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(o,r){return this.onOptionChange((h=>{h===o&&r(this.rawOptions[o])}))}onMultipleOptionChange(o,r){return this.onOptionChange((h=>{o.indexOf(h)!==-1&&r()}))}_setupOptions(){const o=h=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},r=(h,c)=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);c=this._sanitizeAndValidateOption(h,c),this.rawOptions[h]!==c&&(this.rawOptions[h]=c,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const c={get:o.bind(this,h),set:r.bind(this,h)};Object.defineProperty(this.options,h,c)}}_sanitizeAndValidateOption(o,r){switch(o){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[o]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${o}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[o]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=p.includes(r)?r:n.DEFAULT_OPTIONS[o];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${o} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${o} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${o} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${o} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=w},2660:function(F,n,u){var d=this&&this.__decorate||function(w,b,o,r){var h,c=arguments.length,l=c<3?b:r===null?r=Object.getOwnPropertyDescriptor(b,o):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(w,b,o,r);else for(var S=w.length-1;S>=0;S--)(h=w[S])&&(l=(c<3?h(l):c>3?h(b,o,l):h(b,o))||l);return c>3&&l&&Object.defineProperty(b,o,l),l},_=this&&this.__param||function(w,b){return function(o,r){b(o,r,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const a=u(2585);let p=n.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const b=this._bufferService.buffer;if(w.id===void 0){const S=b.addMarker(b.ybase+b.y),x={data:w,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(x,S))),this._dataByLinkId.set(x.id,x),x.id}const o=w,r=this._getEntryIdKey(o),h=this._entriesWithId.get(r);if(h)return this.addLineToLink(h.id,b.ybase+b.y),h.id;const c=b.addMarker(b.ybase+b.y),l={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[c]};return c.onDispose((()=>this._removeMarkerFromLink(l,c))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(w,b){const o=this._dataByLinkId.get(w);if(o&&o.lines.every((r=>r.line!==b))){const r=this._bufferService.buffer.addMarker(b);o.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(o,r)))}}getLinkData(w){var b;return(b=this._dataByLinkId.get(w))==null?void 0:b.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,b){const o=w.lines.indexOf(b);o!==-1&&(w.lines.splice(o,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};n.OscLinkService=p=d([_(0,a.IBufferService)],p)},8343:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},2585:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(8343);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=u(8460),_=u(225);class a{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,b,o=!1){return(16777215&w)<<3|(3&b)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const w=new _.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let b=0,o=0;const r=w.length;for(let h=0;h<r;++h){let c=w.charCodeAt(h);if(55296<=c&&c<=56319){if(++h>=r)return b+this.wcwidth(c);const x=w.charCodeAt(h);56320<=x&&x<=57343?c=1024*(c-55296)+x-56320+65536:b+=this.wcwidth(x)}const l=this.charProperties(c,o);let S=a.extractWidth(l);a.extractShouldJoin(l)&&(S-=a.extractWidth(o)),b+=S,o=l}return b}charProperties(w,b){return this._activeProvider.charProperties(w,b)}}n.UnicodeService=a}},U={};function J(F){var n=U[F];if(n!==void 0)return n.exports;var u=U[F]={exports:{}};return V[F].call(u.exports,u,u.exports,J),u.exports}var se={};return(()=>{var F=se;Object.defineProperty(F,"__esModule",{value:!0}),F.Terminal=void 0;const n=J(9042),u=J(3236),d=J(844),_=J(5741),a=J(8285),p=J(7975),w=J(7090),b=["cols","rows"];class o extends d.Disposable{constructor(h){super(),this._core=this.register(new u.Terminal(h)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const c=S=>this._core.options[S],l=(S,x)=>{this._checkReadonlyOptions(S),this._core.options[S]=x};for(const S in this._core.options){const x={get:c.bind(this,S),set:l.bind(this,S)};Object.defineProperty(this._publicOptions,S,x)}}_checkReadonlyOptions(h){if(b.includes(h))throw new Error(`Option "${h}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let c="none";switch(this._core.coreMouseService.activeProtocol){case"X10":c="x10";break;case"VT200":c="vt200";break;case"DRAG":c="drag";break;case"ANY":c="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:c,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const c in h)this._publicOptions[c]=h[c]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,c=!0){this._core.input(h,c)}resize(h,c){this._verifyIntegers(h,c),this._core.resize(h,c)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,c,l){this._verifyIntegers(h,c,l),this._core.select(h,c,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,c){this._verifyIntegers(h,c),this._core.selectLines(h,c)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,c){this._core.write(h,c)}writeln(h,c){this._core.write(h),this._core.write(`\r
57
- `,c)}paste(h){this._core.paste(h)}refresh(h,c){this._verifyIntegers(h,c),this._core.refresh(h,c)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return n}_verifyIntegers(...h){for(const c of h)if(c===1/0||isNaN(c)||c%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const c of h)if(c&&(c===1/0||isNaN(c)||c%1!=0||c<0))throw new Error("This API only accepts positive integers")}}F.Terminal=o})(),se})()))})(ko)),ko.exports}var ig=tg(),Ho={exports:{}},Qd;function sg(){return Qd||(Qd=1,(function(I,G){(function(V,U){I.exports=U()})(self,(()=>(()=>{var V={};return(()=>{var U=V;Object.defineProperty(U,"__esModule",{value:!0}),U.FitAddon=void 0,U.FitAddon=class{activate(J){this._terminal=J}dispose(){}fit(){const J=this.proposeDimensions();if(!J||!this._terminal||isNaN(J.cols)||isNaN(J.rows))return;const se=this._terminal._core;this._terminal.rows===J.rows&&this._terminal.cols===J.cols||(se._renderService.clear(),this._terminal.resize(J.cols,J.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const J=this._terminal._core,se=J._renderService.dimensions;if(se.css.cell.width===0||se.css.cell.height===0)return;const F=this._terminal.options.scrollback===0?0:J.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(n.getPropertyValue("height")),d=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),a=u-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=d-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-F;return{cols:Math.max(2,Math.floor(p/se.css.cell.width)),rows:Math.max(1,Math.floor(a/se.css.cell.height))}}}})(),V})()))})(Ho)),Ho.exports}var rg=sg(),zo={exports:{}},Zd;function ng(){return Zd||(Zd=1,(function(I,G){(function(V,U){I.exports=U()})(self,(()=>(()=>{var V={965:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const d=u(374),_=u(509),a=u(855),p=u(859),w=u(381),b=11,o=b*Float32Array.BYTES_PER_ELEMENT;let r,h=0,c=0,l=0;class S extends p.Disposable{constructor(v,y,m,C){super(),this._terminal=v,this._gl=y,this._dimensions=m,this._optionsService=C,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;_.TextureAtlas.maxAtlasPages===void 0&&(_.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,w.createProgram)(L,`#version 300 es
55
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&m&&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(m){const C=this._getMouseBufferCoords(m),L=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(L&&R&&C)&&this._areCoordsInSelection(C,L,R)}isCellInSelection(m,C){const L=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!L||!R)&&this._areCoordsInSelection([m,C],L,R)}_areCoordsInSelection(m,C,L){return m[1]>C[1]&&m[1]<L[1]||C[1]===L[1]&&m[1]===C[1]&&m[0]>=C[0]&&m[0]<L[0]||C[1]<L[1]&&m[1]===L[1]&&m[0]<L[0]||C[1]<L[1]&&m[1]===C[1]&&m[0]>=C[0]}_selectWordAtCursor(m,C){var E,D;const L=(D=(E=this._linkifier.currentLink)==null?void 0:E.link)==null?void 0:D.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,c.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const R=this._getMouseBufferCoords(m);return!!R&&(this._selectWordAt(R,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,C){this._model.clearSelection(),m=Math.max(m,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const C=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(m){let C=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return C>=0&&C<=L?0:(C>L&&(C-=L),C=Math.min(Math.max(C,-50),50),C/=50,C/Math.abs(C)+Math.round(14*C))}shouldForceSelection(m){return h.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const C=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);C&&C.length!==this._model.selectionStart[0]&&C.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const C=this._getMouseBufferCoords(m);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(m){return m.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const C=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const R=L.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}C&&C[0]===this._model.selectionEnd[0]&&C[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 m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const C=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const R=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,L=!(!m||!C||m[0]===C[0]&&m[1]===C[1]);L?m&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,C,L)):this._oldHasSelection&&this._fireOnSelectionChange(m,C,L)}_fireOnSelectionChange(m,C,L){this._oldSelectionStart=m,this._oldSelectionEnd=C,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim((C=>this._handleTrim(C)))}_convertViewportColToCharacterIndex(m,C){let L=C;for(let R=0;C>=R;R++){const E=m.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:E>1&&C!==R&&(L+=E-1)}return L}setSelection(m,C,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,C],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,C,L=!0,R=!0){if(m[0]>=this._bufferService.cols)return;const E=this._bufferService.buffer,D=E.lines.get(m[1]);if(!D)return;const O=E.translateBufferLineToString(m[1],!1);let $=this._convertViewportColToCharacterIndex(D,m[0]),U=$;const j=m[0]-$;let z=0,M=0,B=0,T=0;if(O.charAt($)===" "){for(;$>0&&O.charAt($-1)===" ";)$--;for(;U<O.length&&O.charAt(U+1)===" ";)U++}else{let K=m[0],ue=m[0];D.getWidth(K)===0&&(z++,K--),D.getWidth(ue)===2&&(M++,ue++);const le=D.getString(ue).length;for(le>1&&(T+=le-1,U+=le-1);K>0&&$>0&&!this._isCharWordSeparator(D.loadCell(K-1,this._workCell));){D.loadCell(K-1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===0?(z++,K--):q>1&&(B+=q-1,$-=q-1),$--,K--}for(;ue<D.length&&U+1<O.length&&!this._isCharWordSeparator(D.loadCell(ue+1,this._workCell));){D.loadCell(ue+1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===2?(M++,ue++):q>1&&(T+=q-1,U+=q-1),U++,ue++}}U++;let k=$+j-z+B,V=Math.min(this._bufferService.cols,U-$+z+M-B-T);if(C||O.slice($,U).trim()!==""){if(L&&k===0&&D.getCodePoint(0)!==32){const K=E.lines.get(m[1]-1);if(K&&D.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(ue){const le=this._bufferService.cols-ue.start;k-=le,V+=le}}}if(R&&k+V===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const K=E.lines.get(m[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const ue=this._getWordAt([0,m[1]+1],!1,!1,!0);ue&&(V+=ue.length)}}return{start:k,length:V}}}_selectWordAt(m,C){const L=this._getWordAt(m,C);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[L.start,m[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(m){const C=this._getWordAt(m,!0);if(C){let L=m[1];for(;C.start<0;)C.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;C.start+C.length>this._bufferService.cols;)C.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?C.start:C.start+C.length,L]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const C=this._bufferService.buffer.getWrappedRangeForLine(m),L={start:{x:0,y:C.first},end:{x:this._bufferService.cols-1,y:C.last}};this._model.selectionStart=[0,C.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,c.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=y=d([_(3,S.IBufferService),_(4,S.ICoreService),_(5,b.IMouseService),_(6,S.IOptionsService),_(7,b.IRenderService),_(8,b.ICoreBrowserService)],y)},4725:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=u(8343);n.ICharSizeService=(0,d.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),n.IMouseService=(0,d.createDecorator)("MouseService"),n.IRenderService=(0,d.createDecorator)("RenderService"),n.ISelectionService=(0,d.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,d.createDecorator)("ThemeService"),n.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(F,n,u){var d=this&&this.__decorate||function(y,m,C,L){var R,E=arguments.length,D=E<3?m:L===null?L=Object.getOwnPropertyDescriptor(m,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,C,L);else for(var O=y.length-1;O>=0;O--)(R=y[O])&&(D=(E<3?R(D):E>3?R(m,C,D):R(m,C))||D);return E>3&&D&&Object.defineProperty(m,C,D),D},_=this&&this.__param||function(y,m){return function(C,L){m(C,L,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const a=u(7239),p=u(8055),w=u(8460),b=u(844),o=u(2585),r=p.css.toColor("#ffffff"),h=p.css.toColor("#000000"),c=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const y=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let C=0;C<216;C++){const L=m[C/36%6|0],R=m[C/6%6|0],E=m[C%6];y.push({css:p.channels.toCss(L,R,E),rgba:p.channels.toRgba(L,R,E)})}for(let C=0;C<24;C++){const L=8+10*C;y.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return y})());let x=n.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(y){super(),this._optionsService=y,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:h,cursor:c,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:p.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:p.color.blend(h,S),ansi:n.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(y={}){const m=this._colors;if(m.foreground=v(y.foreground,r),m.background=v(y.background,h),m.cursor=v(y.cursor,c),m.cursorAccent=v(y.cursorAccent,l),m.selectionBackgroundTransparent=v(y.selectionBackground,S),m.selectionBackgroundOpaque=p.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=v(y.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=p.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=y.selectionForeground?v(y.selectionForeground,p.NULL_COLOR):void 0,m.selectionForeground===p.NULL_COLOR&&(m.selectionForeground=void 0),p.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=p.color.opacity(m.selectionBackgroundTransparent,.3)),p.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=p.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=n.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=v(y.black,n.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=v(y.red,n.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=v(y.green,n.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=v(y.yellow,n.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=v(y.blue,n.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=v(y.magenta,n.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=v(y.cyan,n.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=v(y.white,n.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=v(y.brightBlack,n.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=v(y.brightRed,n.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=v(y.brightGreen,n.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=v(y.brightYellow,n.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=v(y.brightBlue,n.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=v(y.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=v(y.brightCyan,n.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=v(y.brightWhite,n.DEFAULT_ANSI_COLORS[15]),y.extendedAnsi){const C=Math.min(m.ansi.length-16,y.extendedAnsi.length);for(let L=0;L<C;L++)m.ansi[L+16]=v(y.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(y){this._restoreColor(y),this._onChangeColors.fire(this.colors)}_restoreColor(y){if(y!==void 0)switch(y){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[y]=this._restoreColors.ansi[y]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(y){y(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 v(y,m){if(y!==void 0)try{return p.css.toColor(y)}catch{}return m}n.ThemeService=x=d([_(0,o.IOptionsService)],x)},6349:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const b=new Array(w);for(let o=0;o<Math.min(w,this.length);o++)b[o]=this._array[this._getCyclicIndex(o)];this._array=b,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let b=this._length;b<w;b++)this._array[b]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,b){this._array[this._getCyclicIndex(w)]=b}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,b,...o){if(b){for(let r=w;r<this._length-b;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+b)];this._length-=b,this.onDeleteEmitter.fire({index:w,amount:b})}for(let r=this._length-1;r>=w;r--)this._array[this._getCyclicIndex(r+o.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<o.length;r++)this._array[this._getCyclicIndex(w+r)]=o[r];if(o.length&&this.onInsertEmitter.fire({index:w,amount:o.length}),this._length+o.length>this._maxLength){const r=this._length+o.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=o.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,b,o){if(!(b<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+o<0)throw new Error("Cannot shift elements in list beyond index 0");if(o>0){for(let h=b-1;h>=0;h--)this.set(w+h+o,this.get(w+h));const r=w+b+o-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<b;r++)this.set(w+r+o,this.get(w+r))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}n.CircularList=a},1439:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(d,_=5){if(typeof d!="object")return d;const a=Array.isArray(d)?[]:{};for(const p in d)a[p]=_<=1?d[p]:d[p]&&u(d[p],_-1);return a}},8055:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E>0||D>0||O>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E<255||D<255||O<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const D=S(v,y,m),O=c(C,o.relativeLuminance(D>>8));if(O<m){const $=x(v,y,m);return O>c(C,o.relativeLuminance($>>8))?D:$}return D}const R=x(v,y,m),E=c(C,o.relativeLuminance(R>>8));if(E<m){const D=S(v,y,m);return E>c(C,o.relativeLuminance(D>>8))?R:D}return R}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},8969:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=u(844),_=u(2585),a=u(4348),p=u(7866),w=u(744),b=u(7302),o=u(6975),r=u(8460),h=u(1753),c=u(1480),l=u(7994),S=u(9282),x=u(5435),v=u(5981),y=u(2660);let m=!1;class C extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((R=>{var E;(E=this._onScrollApi)==null||E.fire(R.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(R){for(const E in R)this.optionsService.options[E]=R[E]}constructor(R){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new b.OptionsService(R)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(c.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(y.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((E=>{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((E=>{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 v.WriteBuffer(((E,D)=>this._inputHandler.parse(E,D)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(R,E){this._writeBuffer.write(R,E)}writeSync(R,E){this._logService.logLevel<=_.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(R,E)}input(R,E=!0){this.coreService.triggerDataEvent(R,E)}resize(R,E){isNaN(R)||isNaN(E)||(R=Math.max(R,w.MINIMUM_COLS),E=Math.max(E,w.MINIMUM_ROWS),this._bufferService.resize(R,E))}scroll(R,E=!1){this._bufferService.scroll(R,E)}scrollLines(R,E,D){this._bufferService.scrollLines(R,E,D)}scrollPages(R){this.scrollLines(R*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(R){const E=R-this._bufferService.buffer.ydisp;E!==0&&this.scrollLines(E)}registerEscHandler(R,E){return this._inputHandler.registerEscHandler(R,E)}registerDcsHandler(R,E){return this._inputHandler.registerDcsHandler(R,E)}registerCsiHandler(R,E){return this._inputHandler.registerCsiHandler(R,E)}registerOscHandler(R,E){return this._inputHandler.registerOscHandler(R,E)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let R=!1;const E=this.optionsService.rawOptions.windowsPty;E&&E.buildNumber!==void 0&&E.buildNumber!==void 0?R=E.backend==="conpty"&&E.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(R=!0),R?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const R=[];R.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const E of R)E.dispose()}))}}}n.CoreTerminal=C},8460:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},5435:function(F,n,u){var d=this&&this.__decorate||function(z,M,B,T){var k,V=arguments.length,K=V<3?M:T===null?T=Object.getOwnPropertyDescriptor(M,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(z,M,B,T);else for(var ue=z.length-1;ue>=0;ue--)(k=z[ue])&&(K=(V<3?k(K):V>3?k(M,B,K):k(M,B))||K);return V>3&&K&&Object.defineProperty(M,B,K),K},_=this&&this.__param||function(z,M){return function(B,T){M(B,T,z)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const a=u(2584),p=u(7116),w=u(2015),b=u(844),o=u(482),r=u(8437),h=u(8460),c=u(643),l=u(511),S=u(3734),x=u(2585),v=u(1480),y=u(6242),m=u(6351),C=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function E(z,M){if(z>24)return M.setWinLines||!1;switch(z){case 1:return!!M.restoreWin;case 2:return!!M.minimizeWin;case 3:return!!M.setWinPosition;case 4:return!!M.setWinSizePixels;case 5:return!!M.raiseWin;case 6:return!!M.lowerWin;case 7:return!!M.refreshWin;case 8:return!!M.setWinSizeChars;case 9:return!!M.maximizeWin;case 10:return!!M.fullscreenWin;case 11:return!!M.getWinState;case 13:return!!M.getWinPosition;case 14:return!!M.getWinSizePixels;case 15:return!!M.getScreenSizePixels;case 16:return!!M.getCellSizePixels;case 18:return!!M.getWinSizeChars;case 19:return!!M.getScreenSizeChars;case 20:return!!M.getIconTitle;case 21:return!!M.getWinTitle;case 22:return!!M.pushTitle;case 23:return!!M.popTitle;case 24:return!!M.setWinLines}return!1}var D;(function(z){z[z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",z[z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(n.WindowsOptionsReportType=D={}));let O=0;class $ extends b.Disposable{getAttrData(){return this._curAttrData}constructor(M,B,T,k,V,K,ue,le,q=new w.EscapeSequenceParser){super(),this._bufferService=M,this._charsetService=B,this._coreService=T,this._logService=k,this._optionsService=V,this._oscLinkService=K,this._coreMouseService=ue,this._unicodeService=le,this._parser=q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o.StringToUtf32,this._utf8Decoder=new o.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:re.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,re,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:re,data:se})})),this._parser.setDcsHandlerFallback(((N,re,se)=>{re==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:re,payload:se})})),this._parser.setPrintHandler(((N,re,se)=>this.print(N,re,se))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new y.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new y.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new y.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new y.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new y.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new y.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new y.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new y.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new y.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new y.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new y.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new y.OscHandler((N=>this.restoreCursorColor(N)))),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 N in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((N,re)=>this.requestStatusString(N,re))))}_preserveStack(M,B,T,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=M,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=k}_logSlowResolvingAsync(M){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([M,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(M,B){let T,k=this._activeBuffer.x,V=this._activeBuffer.y,K=0;const ue=this._parseStack.paused;if(ue){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;k=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,M.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof M=="string"?` "${M}"`:` "${Array.prototype.map.call(M,(N=>String.fromCharCode(N))).join("")}"`),typeof M=="string"?M.split("").map((N=>N.charCodeAt(0))):M),this._parseBuffer.length<M.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(M.length,R))),ue||this._dirtyRowTracker.clearRange(),M.length>R)for(let N=K;N<M.length;N+=R){const re=N+R<M.length?N+R:M.length,se=typeof M=="string"?this._stringDecoder.decode(M.substring(N,re),this._parseBuffer):this._utf8Decoder.decode(M.subarray(N,re),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,se))return this._preserveStack(k,V,se,N),this._logSlowResolvingAsync(T),T}else if(!ue){const N=typeof M=="string"?this._stringDecoder.decode(M,this._parseBuffer):this._utf8Decoder.decode(M,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,N))return this._preserveStack(k,V,N,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===k&&this._activeBuffer.y===V||this._onCursorMove.fire();const le=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(q,this._bufferService.rows-1),Math.min(le,this._bufferService.rows-1))}print(M,B,T){let k,V;const K=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,le=this._bufferService.cols,q=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,re=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let ve=this._parser.precedingJoinState;for(let fe=B;fe<T;++fe){if(k=M[fe],k<127&&K){const qe=K[String.fromCharCode(k)];qe&&(k=qe.charCodeAt(0))}const Me=this._unicodeService.charProperties(k,ve);V=v.UnicodeService.extractWidth(Me);const _e=v.UnicodeService.extractShouldJoin(Me),Oe=_e?v.UnicodeService.extractWidth(ve):0;if(ve=Me,ue&&this._onA11yChar.fire((0,o.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Oe>le){if(q){const qe=se;let be=this._activeBuffer.x-Oe;for(this._activeBuffer.x=Oe,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),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Oe>0&&se instanceof r.BufferLine&&se.copyCellsFrom(qe,be,0,Oe,!1);be<le;)qe.setCellFromCodepoint(be++,0,1,re)}else if(this._activeBuffer.x=le-1,V===2)continue}if(_e&&this._activeBuffer.x){const qe=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-qe,k,V);for(let be=V-Oe;--be>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(N&&(se.insertCells(this._activeBuffer.x,V-Oe,this._activeBuffer.getNullCell(re)),se.getWidth(le-1)===2&&se.setCellFromCodepoint(le-1,c.NULL_CELL_CODE,c.NULL_CELL_WIDTH,re)),se.setCellFromCodepoint(this._activeBuffer.x++,k,V,re),V>0)for(;--V;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=ve,this._activeBuffer.x<le&&T-B>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(M,B){return M.final!=="t"||M.prefix||M.intermediates?this._parser.registerCsiHandler(M,B):this._parser.registerCsiHandler(M,(T=>!E(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(M,B){return this._parser.registerDcsHandler(M,new m.DcsHandler(B))}registerEscHandler(M,B){return this._parser.registerEscHandler(M,B)}registerOscHandler(M,B){return this._parser.registerOscHandler(M,new y.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var M;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&&((M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&M.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const M=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-M),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(M=this._bufferService.cols-1){this._activeBuffer.x=Math.min(M,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(M,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=M,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=M,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(M,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+M,this._activeBuffer.y+B)}cursorUp(M){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,M.params[0]||1)):this._moveCursor(0,-(M.params[0]||1)),!0}cursorDown(M){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,M.params[0]||1)):this._moveCursor(0,M.params[0]||1),!0}cursorForward(M){return this._moveCursor(M.params[0]||1,0),!0}cursorBackward(M){return this._moveCursor(-(M.params[0]||1),0),!0}cursorNextLine(M){return this.cursorDown(M),this._activeBuffer.x=0,!0}cursorPrecedingLine(M){return this.cursorUp(M),this._activeBuffer.x=0,!0}cursorCharAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(M){return this._setCursor(M.length>=2?(M.params[1]||1)-1:0,(M.params[0]||1)-1),!0}charPosAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(M){return this._moveCursor(M.params[0]||1,0),!0}linePosAbsolute(M){return this._setCursor(this._activeBuffer.x,(M.params[0]||1)-1),!0}vPositionRelative(M){return this._moveCursor(0,M.params[0]||1),!0}hVPosition(M){return this.cursorPosition(M),!0}tabClear(M){const B=M.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(M){const B=M.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(M,B,T,k=!1,V=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);K.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),V),k&&(K.isWrapped=!1)}_resetBufferLine(M,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+M),T.isWrapped=!1)}eraseInDisplay(M,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 3:const k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(M,B=!1){switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;B--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;B--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(M){let B=M.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(M){let B=M.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);k.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);k.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);k.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);k.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(M.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(M){const B=this._parser.precedingJoinState;if(!B)return!0;const T=M.params[0]||1,k=v.UnicodeService.extractWidth(B),V=this._activeBuffer.x-k,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),ue=new Uint32Array(K.length*T);let le=0;for(let N=0;N<K.length;){const re=K.codePointAt(N)||0;ue[le++]=re,N+=re>65535?2:1}let q=le;for(let N=1;N<T;++N)ue.copyWithin(q,0,le),q+=le;return this.print(ue,0,q),!0}sendDeviceAttributesPrimary(M){return M.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(M){return M.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(M.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(M){return(this._optionsService.rawOptions.termName+"").indexOf(M)===0}setMode(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),M.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(M,B){const T=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:V}=this._coreMouseService,K=this._coreService,{buffers:ue,cols:le}=this._bufferService,{active:q,alt:N}=ue,re=this._optionsService.rawOptions,se=_e=>_e?1:2,ve=M.params[0];return fe=ve,Me=B?ve===2?4:ve===4?se(K.modes.insertMode):ve===12?3:ve===20?se(re.convertEol):0:ve===1?se(T.applicationCursorKeys):ve===3?re.windowOptions.setWinLines?le===80?2:le===132?1:0:0:ve===6?se(T.origin):ve===7?se(T.wraparound):ve===8?3:ve===9?se(k==="X10"):ve===12?se(re.cursorBlink):ve===25?se(!K.isCursorHidden):ve===45?se(T.reverseWraparound):ve===66?se(T.applicationKeypad):ve===67?4:ve===1e3?se(k==="VT200"):ve===1002?se(k==="DRAG"):ve===1003?se(k==="ANY"):ve===1004?se(T.sendFocus):ve===1005?4:ve===1006?se(V==="SGR"):ve===1015?4:ve===1016?se(V==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?se(q===N):ve===2004?se(T.bracketedPasteMode):0,K.triggerDataEvent(`${a.C0.ESC}[${B?"":"?"}${fe};${Me}$y`),!0;var fe,Me}_updateAttrColor(M,B,T,k,V){return B===2?(M|=50331648,M&=-16777216,M|=S.AttributeData.fromColorRGB([T,k,V])):B===5&&(M&=-50331904,M|=33554432|255&T),M}_extractColor(M,B,T){const k=[0,0,-1,0,0,0];let V=0,K=0;do{if(k[K+V]=M.params[B+K],M.hasSubParams(B+K)){const ue=M.getSubParams(B+K);let le=0;do k[1]===5&&(V=1),k[K+le+1+V]=ue[le];while(++le<ue.length&&le+K+1+V<k.length);break}if(k[1]===5&&K+V>=2||k[1]===2&&K+V>=5)break;k[1]&&(V=1)}while(++K+B<M.length&&K+V<k.length);for(let ue=2;ue<k.length;++ue)k[ue]===-1&&(k[ue]=0);switch(k[0]){case 38:T.fg=this._updateAttrColor(T.fg,k[1],k[3],k[4],k[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,k[1],k[3],k[4],k[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,k[1],k[3],k[4],k[5])}return K}_processUnderline(M,B){B.extended=B.extended.clone(),(!~M||M>5)&&(M=1),B.extended.underlineStyle=M,B.fg|=268435456,M===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(M){M.fg=r.DEFAULT_ATTR_DATA.fg,M.bg=r.DEFAULT_ATTR_DATA.bg,M.extended=M.extended.clone(),M.extended.underlineStyle=0,M.extended.underlineColor&=-67108864,M.updateExtended()}charAttributes(M){if(M.length===1&&M.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=M.length;let T;const k=this._curAttrData;for(let V=0;V<B;V++)T=M.params[V],T>=30&&T<=37?(k.fg&=-50331904,k.fg|=16777216|T-30):T>=40&&T<=47?(k.bg&=-50331904,k.bg|=16777216|T-40):T>=90&&T<=97?(k.fg&=-50331904,k.fg|=16777224|T-90):T>=100&&T<=107?(k.bg&=-50331904,k.bg|=16777224|T-100):T===0?this._processSGR0(k):T===1?k.fg|=134217728:T===3?k.bg|=67108864:T===4?(k.fg|=268435456,this._processUnderline(M.hasSubParams(V)?M.getSubParams(V)[0]:1,k)):T===5?k.fg|=536870912:T===7?k.fg|=67108864:T===8?k.fg|=1073741824:T===9?k.fg|=2147483648:T===2?k.bg|=134217728:T===21?this._processUnderline(2,k):T===22?(k.fg&=-134217729,k.bg&=-134217729):T===23?k.bg&=-67108865:T===24?(k.fg&=-268435457,this._processUnderline(0,k)):T===25?k.fg&=-536870913:T===27?k.fg&=-67108865:T===28?k.fg&=-1073741825:T===29?k.fg&=2147483647:T===39?(k.fg&=-67108864,k.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):T===49?(k.bg&=-67108864,k.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?V+=this._extractColor(M,V,k):T===53?k.bg|=1073741824:T===55?k.bg&=-1073741825:T===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):T===100?(k.fg&=-67108864,k.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(M){switch(M.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(M){if(M.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${B};${T}R`)}return!0}softReset(M){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(M){const B=M.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(M){const B=M.params[0]||1;let T;return(M.length<2||(T=M.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(M){if(!E(M.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=M.length>1?M.params[1]:0;switch(M.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(M){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(M){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(M){return this._windowTitle=M,this._onTitleChange.fire(M),!0}setIconName(M){return this._iconName=M,!0}setOrReportIndexedColor(M){const B=[],T=M.split(";");for(;T.length>1;){const k=T.shift(),V=T.shift();if(/^\d+$/.exec(k)){const K=parseInt(k);if(j(K))if(V==="?")B.push({type:0,index:K});else{const ue=(0,C.parseColor)(V);ue&&B.push({type:1,index:K,color:ue})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(M){const B=M.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(M,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=M.split(":");let k;const V=T.findIndex((K=>K.startsWith("id=")));return V!==-1&&(k=T[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(M,B){const T=M.split(";");for(let k=0;k<T.length&&!(B>=this._specialColors.length);++k,++B)if(T[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const V=(0,C.parseColor)(T[k]);V&&this._onColor.fire([{type:1,index:this._specialColors[B],color:V}])}return!0}setOrReportFgColor(M){return this._setOrReportSpecialColor(M,0)}setOrReportBgColor(M){return this._setOrReportSpecialColor(M,1)}setOrReportCursorColor(M){return this._setOrReportSpecialColor(M,2)}restoreIndexedColor(M){if(!M)return this._onColor.fire([{type:2}]),!0;const B=[],T=M.split(";");for(let k=0;k<T.length;++k)if(/^\d+$/.exec(T[k])){const V=parseInt(T[k]);j(V)&&B.push({type:2,index:V})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(M){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(M){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(M){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,p.DEFAULT_CHARSET),!0}selectCharset(M){return M.length!==2?(this.selectDefaultCharset(),!0):(M[0]==="/"||this._charsetService.setgCharset(L[M[0]],p.CHARSETS[M[1]]||p.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 M=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,M,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(M){return this._charsetService.setgLevel(M),!0}screenAlignmentPattern(){const M=new l.CellData;M.content=4194373,M.fg=this._curAttrData.fg,M.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,k=this._activeBuffer.lines.get(T);k&&(k.fill(M),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(M,B){const T=this._bufferService.buffer,k=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${V}${a.C0.ESC}\\`),!0))(M==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:M==='"p'?'P1$r61;1"p':M==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:M==="m"?"P1$r0m":M===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(M,B){this._dirtyRowTracker.markRangeDirty(M,B)}}n.InputHandler=$;let U=class{constructor(z){this._bufferService=z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(z){z<this.start?this.start=z:z>this.end&&(this.end=z)}markRangeDirty(z,M){z>M&&(O=z,z=M,M=O),z<this.start&&(this.start=z),M>this.end&&(this.end=M)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j(z){return 0<=z&&z<256}U=d([_(0,x.IBufferService)],U)},844:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},6114:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const _=this._getKey(d);if(_===void 0||(u=this._search(_),u===-1)||this._getKey(this._array[u])!==_)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===_);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,_){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do _(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let _=0,a=this._array.length-1;for(;a>=_;){let p=_+a>>1;const w=this._getKey(this._array[p]);if(w>d)a=p-1;else{if(!(w<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}_=p+1}}return _}}},7226:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=u(643);n.updateWindowsModeWrappedState=function(_){const a=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=a==null?void 0:a.get(_.cols-1),w=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);w&&p&&(w.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},9092:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=u(6349),_=u(7226),a=u(3734),p=u(8437),w=u(4634),b=u(511),o=u(643),r=u(4863),h=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(c,l,S){this._hasScrollback=c,this._optionsService=l,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(c){return c?(this._nullCell.fg=c.fg,this._nullCell.bg=c.bg,this._nullCell.extended=c.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(c){return c?(this._whitespaceCell.fg=c.fg,this._whitespaceCell.bg=c.bg,this._whitespaceCell.extended=c.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(c,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(c),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const c=this.ybase+this.y-this.ydisp;return c>=0&&c<this._rows}_getCorrectBufferLength(c){if(!this._hasScrollback)return c;const l=c+this._optionsService.rawOptions.scrollback;return l>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:l}fillViewportRows(c){if(this.lines.length===0){c===void 0&&(c=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(c))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(c,l){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=0;const v=this._getCorrectBufferLength(l);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<c)for(let m=0;m<this.lines.length;m++)x+=+this.lines.get(m).resize(c,S);let y=0;if(this._rows<l)for(let m=this._rows;m<l;m++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(c,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+y+1?(this.ybase--,y++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(c,S)));else for(let m=this._rows;m>l;m--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const m=this.lines.length-v;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=v}this.x=Math.min(this.x,c-1),this.y=Math.min(this.y,l-1),y&&(this.y+=y),this.savedX=Math.min(this.savedX,c-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(c,l),this._cols>c))for(let y=0;y<this.lines.length;y++)x+=+this.lines.get(y).resize(c,S);this._cols=c,this._rows=l,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let c=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,c=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return c}get _isReflowEnabled(){const c=this._optionsService.rawOptions.windowsPty;return c&&c.buildNumber?this._hasScrollback&&c.backend==="conpty"&&c.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(c,l){this._cols!==c&&(c>this._cols?this._reflowLarger(c,l):this._reflowSmaller(c,l))}_reflowLarger(c,l){const S=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,c,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(S.length>0){const x=(0,w.reflowLargerCreateNewLayout)(this.lines,S);(0,w.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(c,l,x.countRemoved)}}_reflowLargerAdjustViewport(c,l,S){const x=this.getNullCell(p.DEFAULT_ATTR_DATA);let v=S;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(c,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(c,l){const S=this.getNullCell(p.DEFAULT_ATTR_DATA),x=[];let v=0;for(let y=this.lines.length-1;y>=0;y--){let m=this.lines.get(y);if(!m||!m.isWrapped&&m.getTrimmedLength()<=c)continue;const C=[m];for(;m.isWrapped&&y>0;)m=this.lines.get(--y),C.unshift(m);const L=this.ybase+this.y;if(L>=y&&L<y+C.length)continue;const R=C[C.length-1].getTrimmedLength(),E=(0,w.reflowSmallerGetNewLineLengths)(C,this._cols,c),D=E.length-C.length;let O;O=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const $=[];for(let T=0;T<D;T++){const k=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);$.push(k)}$.length>0&&(x.push({start:y+C.length+v,newLines:$}),v+=$.length),C.push(...$);let U=E.length-1,j=E[U];j===0&&(U--,j=E[U]);let z=C.length-D-1,M=R;for(;z>=0;){const T=Math.min(M,j);if(C[U]===void 0)break;if(C[U].copyCellsFrom(C[z],M-T,j-T,T,!0),j-=T,j===0&&(U--,j=E[U]),M-=T,M===0){z--;const k=Math.max(z,0);M=(0,w.getWrappedLineTrimmedLength)(C,k,this._cols)}}for(let T=0;T<C.length;T++)E[T]<c&&C[T].setCell(E[T],S);let B=D-O;for(;B-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+l-1)}if(x.length>0){const y=[],m=[];for(let U=0;U<this.lines.length;U++)m.push(this.lines.get(U));const C=this.lines.length;let L=C-1,R=0,E=x[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let D=0;for(let U=Math.min(this.lines.maxLength-1,C+v-1);U>=0;U--)if(E&&E.start>L+D){for(let j=E.newLines.length-1;j>=0;j--)this.lines.set(U--,E.newLines[j]);U++,y.push({index:L+1,amount:E.newLines.length}),D+=E.newLines.length,E=x[++R]}else this.lines.set(U,m[L--]);let O=0;for(let U=y.length-1;U>=0;U--)y[U].index+=O,this.lines.onInsertEmitter.fire(y[U]),O+=y[U].amount;const $=Math.max(0,C+v-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(c,l,S=0,x){const v=this.lines.get(c);return v?v.translateToString(l,S,x):""}getWrappedRangeForLine(c){let l=c,S=c;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:l,last:S}}setupTabStops(c){for(c!=null?this.tabs[c]||(c=this.prevStop(c)):(this.tabs={},c=0);c<this._cols;c+=this._optionsService.rawOptions.tabStopWidth)this.tabs[c]=!0}prevStop(c){for(c==null&&(c=this.x);!this.tabs[--c]&&c>0;);return c>=this._cols?this._cols-1:c<0?0:c}nextStop(c){for(c==null&&(c=this.x);!this.tabs[++c]&&c<this._cols;);return c>=this._cols?this._cols-1:c<0?0:c}clearMarkers(c){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===c&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].dispose(),this.markers.splice(c--,1);this._isClearing=!1}addMarker(c){const l=new r.Marker(c);return this.markers.push(l),l.register(this.lines.onTrim((S=>{l.line-=S,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((S=>{l.line>=S.index&&(l.line+=S.amount)}))),l.register(this.lines.onDelete((S=>{l.line>=S.index&&l.line<S.index+S.amount&&l.dispose(),l.line>S.index&&(l.line-=S.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(c){this._isClearing||this.markers.splice(this.markers.indexOf(c),1)}}},8437:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=u(3734),_=u(511),a=u(643),p=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class b{constructor(r,h,c=!1){this.isWrapped=c,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const l=h||_.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let S=0;S<r;++S)this.setCell(S,l);this.length=r}get(r){const h=this._data[3*r+0],c=2097151&h;return[this._data[3*r+1],2097152&h?this._combined[r]:c?(0,p.stringFromCodePoint)(c):"",h>>22,2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):c]}set(r,h){this._data[3*r+1]=h[a.CHAR_DATA_ATTR_INDEX],h[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=h[1],this._data[3*r+0]=2097152|r|h[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=h[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&h}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r]:2097151&h?(0,p.stringFromCodePoint)(2097151&h):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,h){return w=3*r,h.content=this._data[w+0],h.fg=this._data[w+1],h.bg=this._data[w+2],2097152&h.content&&(h.combinedData=this._combined[r]),268435456&h.bg&&(h.extended=this._extendedAttrs[r]),h}setCell(r,h){2097152&h.content&&(this._combined[r]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[r]=h.extended),this._data[3*r+0]=h.content,this._data[3*r+1]=h.fg,this._data[3*r+2]=h.bg}setCellFromCodepoint(r,h,c,l){268435456&l.bg&&(this._extendedAttrs[r]=l.extended),this._data[3*r+0]=h|c<<22,this._data[3*r+1]=l.fg,this._data[3*r+2]=l.bg}addCodepointToCell(r,h,c){let l=this._data[3*r+0];2097152&l?this._combined[r]+=(0,p.stringFromCodePoint)(h):2097151&l?(this._combined[r]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(h),l&=-2097152,l|=2097152):l=h|4194304,c&&(l&=-12582913,l|=c<<22),this._data[3*r+0]=l}insertCells(r,h,c){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length-r){const l=new _.CellData;for(let S=this.length-r-h-1;S>=0;--S)this.setCell(r+h+S,this.loadCell(r+S,l));for(let S=0;S<h;++S)this.setCell(r+S,c)}else for(let l=r;l<this.length;++l)this.setCell(l,c);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,c)}deleteCells(r,h,c){if(r%=this.length,h<this.length-r){const l=new _.CellData;for(let S=0;S<this.length-r-h;++S)this.setCell(r+S,this.loadCell(r+h+S,l));for(let S=this.length-h;S<this.length;++S)this.setCell(S,c)}else for(let l=r;l<this.length;++l)this.setCell(l,c);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,c)}replaceCells(r,h,c,l=!1){if(l)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,c);r<h&&r<this.length;)this.isProtected(r)||this.setCell(r,c),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,c),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,c);r<h&&r<this.length;)this.setCell(r++,c)}resize(r,h){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const c=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*c)this._data=new Uint32Array(this._data.buffer,0,c);else{const l=new Uint32Array(c);l.set(this._data),this._data=l}for(let l=this.length;l<r;++l)this.setCell(l,h)}else{this._data=this._data.subarray(0,c);const l=Object.keys(this._combined);for(let x=0;x<l.length;x++){const v=parseInt(l[x],10);v>=r&&delete this._combined[v]}const S=Object.keys(this._extendedAttrs);for(let x=0;x<S.length;x++){const v=parseInt(S[x],10);v>=r&&delete this._extendedAttrs[v]}}return this.length=r,4*c*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,h=!1){if(h)for(let c=0;c<this.length;++c)this.isProtected(c)||this.setCell(c,r);else{this._combined={},this._extendedAttrs={};for(let c=0;c<this.length;++c)this.setCell(c,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const h in r._combined)this._combined[h]=r._combined[h];this._extendedAttrs={};for(const h in r._extendedAttrs)this._extendedAttrs[h]=r._extendedAttrs[h];this.isWrapped=r.isWrapped}clone(){const r=new b(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const h in this._combined)r._combined[h]=this._combined[h];for(const h in this._extendedAttrs)r._extendedAttrs[h]=this._extendedAttrs[h];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,h,c,l,S){const x=r._data;if(S)for(let y=l-1;y>=0;y--){for(let m=0;m<3;m++)this._data[3*(c+y)+m]=x[3*(h+y)+m];268435456&x[3*(h+y)+2]&&(this._extendedAttrs[c+y]=r._extendedAttrs[h+y])}else for(let y=0;y<l;y++){for(let m=0;m<3;m++)this._data[3*(c+y)+m]=x[3*(h+y)+m];268435456&x[3*(h+y)+2]&&(this._extendedAttrs[c+y]=r._extendedAttrs[h+y])}const v=Object.keys(r._combined);for(let y=0;y<v.length;y++){const m=parseInt(v[y],10);m>=h&&(this._combined[m-h+c]=r._combined[m])}}translateToString(r,h,c,l){h=h??0,c=c??this.length,r&&(c=Math.min(c,this.getTrimmedLength())),l&&(l.length=0);let S="";for(;h<c;){const x=this._data[3*h+0],v=2097151&x,y=2097152&x?this._combined[h]:v?(0,p.stringFromCodePoint)(v):a.WHITESPACE_CELL_CHAR;if(S+=y,l)for(let m=0;m<y.length;++m)l.push(h);h+=x>>22||1}return l&&l.push(h),S}}n.BufferLine=b},4841:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(F,n)=>{function u(d,_,a){if(_===d.length-1)return d[_].getTrimmedLength();const p=!d[_].hasContent(a-1)&&d[_].getWidth(a-1)===1,w=d[_+1].getWidth(0)===2;return p&&w?a-1:a}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(d,_,a,p,w){const b=[];for(let o=0;o<d.length-1;o++){let r=o,h=d.get(++r);if(!h.isWrapped)continue;const c=[d.get(o)];for(;r<d.length&&h.isWrapped;)c.push(h),h=d.get(++r);if(p>=o&&p<r){o+=c.length-1;continue}let l=0,S=u(c,l,_),x=1,v=0;for(;x<c.length;){const m=u(c,x,_),C=m-v,L=a-S,R=Math.min(C,L);c[l].copyCellsFrom(c[x],v,S,R,!1),S+=R,S===a&&(l++,S=0),v+=R,v===m&&(x++,v=0),S===0&&l!==0&&c[l-1].getWidth(a-1)===2&&(c[l].copyCellsFrom(c[l-1],a-1,S++,1,!1),c[l-1].setCell(a-1,w))}c[l].replaceCells(S,a,w);let y=0;for(let m=c.length-1;m>0&&(m>l||c[m].getTrimmedLength()===0);m--)y++;y>0&&(b.push(o+c.length-y),b.push(y)),o+=c.length-1}return b},n.reflowLargerCreateNewLayout=function(d,_){const a=[];let p=0,w=_[p],b=0;for(let o=0;o<d.length;o++)if(w===o){const r=_[++p];d.onDeleteEmitter.fire({index:o-b,amount:r}),o+=r-1,b+=r,w=_[++p]}else a.push(o);return{layout:a,countRemoved:b}},n.reflowLargerApplyNewLayout=function(d,_){const a=[];for(let p=0;p<_.length;p++)a.push(d.get(_[p]));for(let p=0;p<a.length;p++)d.set(p,a[p]);d.length=_.length},n.reflowSmallerGetNewLineLengths=function(d,_,a){const p=[],w=d.map(((h,c)=>u(d,c,_))).reduce(((h,c)=>h+c));let b=0,o=0,r=0;for(;r<w;){if(w-r<a){p.push(w-r);break}b+=a;const h=u(d,o,_);b>h&&(b-=h,o++);const c=d[o].getWidth(b-1)===2;c&&b--;const l=c?a-1:a;p.push(l),r+=l}return p},n.getWrappedLineTrimmedLength=u},5295:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=u(8460),_=u(844),a=u(9092);class p extends _.Disposable{constructor(b,o){super(),this._optionsService=b,this._bufferService=o,this._onBufferActivate=this.register(new d.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,o){this._normal.resize(b,o),this._alt.resize(b,o),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}n.BufferSet=p},511:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(482),_=u(643),a=u(3734);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},643:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=u(8460),_=u(844);class a{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}n.Marker=a,a._nextId=1},7116:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(F,n)=>{var u,d,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
56
+ `,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(u||(n.C0=u={})),(function(a){a.PAD="€",a.HOP="",a.BPH="‚",a.NBH="ƒ",a.IND="„",a.NEL="…",a.SSA="†",a.ESA="‡",a.HTS="ˆ",a.HTJ="‰",a.VTS="Š",a.PLD="‹",a.PLU="Œ",a.RI="",a.SS2="Ž",a.SS3="",a.DCS="",a.PU1="‘",a.PU2="’",a.STS="“",a.CCH="”",a.MW="•",a.SPA="–",a.EPA="—",a.SOS="˜",a.SGCI="™",a.SCI="š",a.CSI="›",a.ST="œ",a.OSC="",a.PM="ž",a.APC="Ÿ"})(d||(n.C1=d={})),(function(a){a.ST=`${u.ESC}\\`})(_||(n.C1_ESCAPED=_={}))},7399:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=u(2584),_={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:["'",'"']};n.evaluateKeyboardEvent=function(a,p,w,b){const o={type:0,cancel:!1,key:void 0},r=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?o.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?o.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?o.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(o.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:o.key=a.ctrlKey?"\b":d.C0.DEL,a.altKey&&(o.key=d.C0.ESC+o.key);break;case 9:if(a.shiftKey){o.key=d.C0.ESC+"[Z";break}o.key=d.C0.HT,o.cancel=!0;break;case 13:o.key=a.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,o.cancel=!0;break;case 27:o.key=d.C0.ESC,a.altKey&&(o.key=d.C0.ESC+d.C0.ESC),o.cancel=!0;break;case 37:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"D",o.key===d.C0.ESC+"[1;3D"&&(o.key=d.C0.ESC+(w?"b":"[1;5D"))):o.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"C",o.key===d.C0.ESC+"[1;3C"&&(o.key=d.C0.ESC+(w?"f":"[1;5C"))):o.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"A",w||o.key!==d.C0.ESC+"[1;3A"||(o.key=d.C0.ESC+"[1;5A")):o.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(o.key=d.C0.ESC+"[1;"+(r+1)+"B",w||o.key!==d.C0.ESC+"[1;3B"||(o.key=d.C0.ESC+"[1;5B")):o.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(o.key=d.C0.ESC+"[2~");break;case 46:o.key=r?d.C0.ESC+"[3;"+(r+1)+"~":d.C0.ESC+"[3~";break;case 36:o.key=r?d.C0.ESC+"[1;"+(r+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:o.key=r?d.C0.ESC+"[1;"+(r+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:a.shiftKey?o.type=2:a.ctrlKey?o.key=d.C0.ESC+"[5;"+(r+1)+"~":o.key=d.C0.ESC+"[5~";break;case 34:a.shiftKey?o.type=3:a.ctrlKey?o.key=d.C0.ESC+"[6;"+(r+1)+"~":o.key=d.C0.ESC+"[6~";break;case 112:o.key=r?d.C0.ESC+"[1;"+(r+1)+"P":d.C0.ESC+"OP";break;case 113:o.key=r?d.C0.ESC+"[1;"+(r+1)+"Q":d.C0.ESC+"OQ";break;case 114:o.key=r?d.C0.ESC+"[1;"+(r+1)+"R":d.C0.ESC+"OR";break;case 115:o.key=r?d.C0.ESC+"[1;"+(r+1)+"S":d.C0.ESC+"OS";break;case 116:o.key=r?d.C0.ESC+"[15;"+(r+1)+"~":d.C0.ESC+"[15~";break;case 117:o.key=r?d.C0.ESC+"[17;"+(r+1)+"~":d.C0.ESC+"[17~";break;case 118:o.key=r?d.C0.ESC+"[18;"+(r+1)+"~":d.C0.ESC+"[18~";break;case 119:o.key=r?d.C0.ESC+"[19;"+(r+1)+"~":d.C0.ESC+"[19~";break;case 120:o.key=r?d.C0.ESC+"[20;"+(r+1)+"~":d.C0.ESC+"[20~";break;case 121:o.key=r?d.C0.ESC+"[21;"+(r+1)+"~":d.C0.ESC+"[21~";break;case 122:o.key=r?d.C0.ESC+"[23;"+(r+1)+"~":d.C0.ESC+"[23~";break;case 123:o.key=r?d.C0.ESC+"[24;"+(r+1)+"~":d.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(w&&!b||!a.altKey||a.metaKey)!w||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?o.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(o.key=d.C0.US),a.key==="@"&&(o.key=d.C0.NUL)):a.keyCode===65&&(o.type=1);else{const h=_[a.keyCode],c=h==null?void 0:h[a.shiftKey?1:0];if(c)o.key=d.C0.ESC+c;else if(a.keyCode>=65&&a.keyCode<=90){const l=a.ctrlKey?a.keyCode-64:a.keyCode+32;let S=String.fromCharCode(l);a.shiftKey&&(S=S.toUpperCase()),o.key=d.C0.ESC+S}else if(a.keyCode===32)o.key=d.C0.ESC+(a.ctrlKey?d.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let l=a.code.slice(3,4);a.shiftKey||(l=l.toLowerCase()),o.key=d.C0.ESC+l,o.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?o.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?o.key=d.C0.NUL:a.keyCode>=51&&a.keyCode<=55?o.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?o.key=d.C0.DEL:a.keyCode===219?o.key=d.C0.ESC:a.keyCode===220?o.key=d.C0.FS:a.keyCode===221&&(o.key=d.C0.GS)}return o}},482:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},225:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const d=u(1480),_=[[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]],a=[[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 p;n.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let w=0;w<_.length;++w)p.fill(0,_[w][0],_[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?p[w]:(function(b,o){let r,h=0,c=o.length-1;if(b<o[0][0]||b>o[c][1])return!1;for(;c>=h;)if(r=h+c>>1,b>o[r][1])h=r+1;else{if(!(b<o[r][0]))return!0;c=r-1}return!1})(w,a)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,b){let o=this.wcwidth(w),r=o===0&&b!==0;if(r){const h=d.UnicodeService.extractWidth(b);h===0?r=!1:h>o&&(o=h)}return d.UnicodeService.createPropertyValue(0,o,r)}}},5981:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let o;for(this._isSyncWriting=!0;o=this._writeBuffer.shift();){this._action(o);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(b)}_innerWrite(w=0,b=!0){const o=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],h=this._action(r,b);if(h){const l=S=>Date.now()-o>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(o,S);return void h.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(l)}const c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-o>=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()}}n.WriteBuffer=a},5941:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function _(a,p){const w=a.toString(16),b=w.length<2?"0"+w:w;switch(p){case 4:return w[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}n.parseColor=function(a){if(!a)return;let p=a.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const w=u.exec(p);if(w){const b=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/b*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/b*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/b*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const w=p.length/3,b=[0,0,0];for(let o=0;o<3;++o){const r=parseInt(p.slice(w*o,w*o+w),16);b[o]=w===1?r<<4:w===2?r:w===3?r>>4:r>>8}return b}},n.toRgbString=function(a,p=16){const[w,b,o]=a;return`rgb:${_(w,p)}/${_(b,p)}/${_(o,p)}`}},5770:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=u(482),_=u(8742),a=u(5770),p=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(b,o){this._handlers[b]===void 0&&(this._handlers[b]=[]);const r=this._handlers[b];return r.push(o),{dispose:()=>{const h=r.indexOf(o);h!==-1&&r.splice(h,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(b,o){if(this.reset(),this._ident=b,this._active=this._handlers[b]||p,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(o);else this._handlerFb(this._ident,"HOOK",o)}put(b,o,r){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(b,o,r);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(b,o,r))}unhook(b,o=!0){if(this._active.length){let r=!1,h=this._active.length-1,c=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,r=o,c=this._stack.fallThrough,this._stack.paused=!1),!c&&r===!1){for(;h>=0&&(r=this._active[h].unhook(b),r!==!0);h--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,r;h--}for(;h>=0;h--)if(r=this._active[h].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",b);this._active=p,this._ident=0}};const w=new _.Params;w.addParam(0),n.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=w,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():w,this._data="",this._hitLimit=!1}put(b,o,r){this._hitLimit||(this._data+=(0,d.utf32ToString)(b,o,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let o=!1;if(this._hitLimit)o=!1;else if(b&&(o=this._handler(this._data,this._params),o instanceof Promise))return o.then((r=>(this._params=w,this._data="",this._hitLimit=!1,r)));return this._params=w,this._data="",this._hitLimit=!1,o}}},2015:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=u(844),_=u(8742),a=u(6242),p=u(6351);class w{constructor(h){this.table=new Uint8Array(h)}setDefault(h,c){this.table.fill(h<<4|c)}add(h,c,l,S){this.table[c<<8|h]=l<<4|S}addMany(h,c,l,S){for(let x=0;x<h.length;x++)this.table[c<<8|h[x]]=l<<4|S}}n.TransitionTable=w;const b=160;n.VT500_TRANSITION_TABLE=(function(){const r=new w(4095),h=Array.apply(null,Array(256)).map(((y,m)=>m)),c=(y,m)=>h.slice(y,m),l=c(32,127),S=c(0,24);S.push(25),S.push.apply(S,c(28,32));const x=c(0,14);let v;for(v in r.setDefault(1,0),r.addMany(l,0,2,0),x)r.addMany([24,26,153,154],v,3,0),r.addMany(c(128,144),v,3,0),r.addMany(c(144,152),v,3,0),r.add(156,v,0,0),r.add(27,v,11,1),r.add(157,v,4,8),r.addMany([152,158,159],v,0,7),r.add(155,v,11,3),r.add(144,v,11,9);return r.addMany(S,0,3,0),r.addMany(S,1,3,1),r.add(127,1,0,1),r.addMany(S,8,0,8),r.addMany(S,3,3,3),r.add(127,3,0,3),r.addMany(S,4,3,4),r.add(127,4,0,4),r.addMany(S,6,3,6),r.addMany(S,5,3,5),r.add(127,5,0,5),r.addMany(S,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(l,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(c(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(l,7,0,7),r.addMany(S,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(c(64,127),3,7,0),r.addMany(c(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(c(48,60),4,8,4),r.addMany(c(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(c(32,64),6,0,6),r.add(127,6,0,6),r.addMany(c(64,127),6,0,0),r.addMany(c(32,48),3,9,5),r.addMany(c(32,48),5,9,5),r.addMany(c(48,64),5,0,6),r.addMany(c(64,127),5,7,0),r.addMany(c(32,48),4,9,5),r.addMany(c(32,48),1,9,2),r.addMany(c(32,48),2,9,2),r.addMany(c(48,127),2,10,0),r.addMany(c(48,80),1,10,0),r.addMany(c(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(c(96,127),1,10,0),r.add(80,1,11,9),r.addMany(S,9,0,9),r.add(127,9,0,9),r.addMany(c(28,32),9,0,9),r.addMany(c(32,48),9,9,12),r.addMany(c(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(S,11,0,11),r.addMany(c(32,128),11,0,11),r.addMany(c(28,32),11,0,11),r.addMany(S,10,0,10),r.add(127,10,0,10),r.addMany(c(28,32),10,0,10),r.addMany(c(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(c(32,48),10,9,12),r.addMany(S,12,0,12),r.add(127,12,0,12),r.addMany(c(28,32),12,0,12),r.addMany(c(32,48),12,9,12),r.addMany(c(48,64),12,0,11),r.addMany(c(64,127),12,12,13),r.addMany(c(64,127),10,12,13),r.addMany(c(64,127),9,12,13),r.addMany(S,13,13,13),r.addMany(l,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(b,0,2,0),r.add(b,8,5,8),r.add(b,6,0,6),r.add(b,11,0,11),r.add(b,13,13,13),r})();class o extends d.Disposable{constructor(h=n.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(c,l,S)=>{},this._executeHandlerFb=c=>{},this._csiHandlerFb=(c,l)=>{},this._escHandlerFb=c=>{},this._errorHandlerFb=c=>c,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,c=[64,126]){let l=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=h.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<h.intermediates.length;++x){const v=h.intermediates.charCodeAt(x);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=v}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(c[0]>S||S>c[1])throw new Error(`final must be in range ${c[0]} .. ${c[1]}`);return l<<=8,l|=S,l}identToString(h){const c=[];for(;h;)c.push(String.fromCharCode(255&h)),h>>=8;return c.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,c){const l=this._identifier(h,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const S=this._escHandlers[l];return S.push(c),{dispose:()=>{const x=S.indexOf(c);x!==-1&&S.splice(x,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,c){this._executeHandlers[h.charCodeAt(0)]=c}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,c){const l=this._identifier(h);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const S=this._csiHandlers[l];return S.push(c),{dispose:()=>{const x=S.indexOf(c);x!==-1&&S.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,c){return this._dcsParser.registerHandler(this._identifier(h),c)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,c){return this._oscParser.registerHandler(h,c)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,c,l,S,x){this._parseStack.state=h,this._parseStack.handlers=c,this._parseStack.handlerPos=l,this._parseStack.transition=S,this._parseStack.chunkPos=x}parse(h,c,l){let S,x=0,v=0,y=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,y=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&C>-1){for(;C>=0&&(S=m[C](this._params),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 4:if(l===!1&&C>-1){for(;C>=0&&(S=m[C](),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(x!==24&&x!==26,l),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=h[this._parseStack.chunkPos],S=this._oscParser.end(x!==24&&x!==26,l),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,y=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=y;m<c;++m){switch(x=h[m],v=this._transitions.table[this.currentState<<8|(x<160?x:b)],v>>4){case 2:for(let D=m+1;;++D){if(D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,m,D),m=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,m,D),m=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,m,D),m=D-1;break}if(++D>=c||(x=h[D])<32||x>126&&x<b){this._printHandler(h,m,D),m=D-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const C=this._csiHandlers[this._collect<<8|x];let L=C?C.length-1:-1;for(;L>=0&&(S=C[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._preserveStack(3,C,L,v,m),S;L<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++m<c&&(x=h[m])>47&&x<60);m--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const R=this._escHandlers[this._collect<<8|x];let E=R?R.length-1:-1;for(;E>=0&&(S=R[E](),S!==!0);E--)if(S instanceof Promise)return this._preserveStack(4,R,E,v,m),S;E<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let D=m+1;;++D)if(D>=c||(x=h[D])===24||x===26||x===27||x>127&&x<b){this._dcsParser.put(h,m,D),m=D-1;break}break;case 14:if(S=this._dcsParser.unhook(x!==24&&x!==26),S)return this._preserveStack(6,[],0,v,m),S;x===27&&(v|=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 D=m+1;;D++)if(D>=c||(x=h[D])<32||x>127&&x<b){this._oscParser.put(h,m,D),m=D-1;break}break;case 6:if(S=this._oscParser.end(x!==24&&x!==26),S)return this._preserveStack(5,[],0,v,m),S;x===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&v}}}n.EscapeSequenceParser=o},6242:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=u(5770),_=u(482),a=[];n.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,w){this._handlers[p]===void 0&&(this._handlers[p]=[]);const b=this._handlers[p];return b.push(w),{dispose:()=>{const o=b.indexOf(w);o!==-1&&b.splice(o,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,w,b){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(p,w,b);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,w,b))}start(){this.reset(),this._state=1}put(p,w,b){if(this._state!==3){if(this._state===1)for(;w<b;){const o=p[w++];if(o===59){this._state=2,this._start();break}if(o<48||57<o)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+o-48}this._state===2&&b-w>0&&this._put(p,w,b)}}end(p,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,o=this._active.length-1,r=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,b=w,r=this._stack.fallThrough,this._stack.paused=!1),!r&&b===!1){for(;o>=0&&(b=this._active[o].end(p),b!==!0);o--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,b;o--}for(;o>=0;o--)if(b=this._active[o].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",p);this._active=a,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,w,b){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,w,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let w=!1;if(this._hitLimit)w=!1;else if(p&&(w=this._handler(this._data),w instanceof Promise))return w.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,w}}},8742:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class d{static fromArray(a){const p=new d;if(!a.length)return p;for(let w=Array.isArray(a[0])?1:0;w<a.length;++w){const b=a[w];if(Array.isArray(b))for(let o=0;o<b.length;++o)p.addSubParam(b[o]);else p.addParam(b)}return p}constructor(a=32,p=32){if(this.maxLength=a,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new d(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let p=0;p<this.length;++p){a.push(this.params[p]);const w=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];b-w>0&&a.push(Array.prototype.slice.call(this._subParams,w,b))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>u?u:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>u?u:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const p=this._subParamsIdx[a]>>8,w=255&this._subParamsIdx[a];return w-p>0?this._subParams.subarray(p,w):null}getSubParamsAll(){const a={};for(let p=0;p<this.length;++p){const w=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];b-w>0&&(a[p]=this._subParams.slice(w,b))}return a}addDigit(a){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,b=w[p-1];w[p-1]=~b?Math.min(10*b+a,u):a}}n.Params=d},5741:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const _={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(_),d.dispose=()=>this._wrappedAddonDispose(_),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===u){d=_;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=u(3785),_=u(511);n.BufferApiView=class{constructor(a,p){this._buffer=a,this.type=p}init(a){return this._buffer=a,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(a){const p=this._buffer.lines.get(a);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=u(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,a){if(!(_<0||_>=this._line.length))return a?(this._line.loadCell(_,a),a):this._line.loadCell(_,new d.CellData)}translateToString(_,a,p){return this._line.translateToString(_,a,p)}}},8285:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=u(8771),_=u(8460),a=u(844);class p extends a.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}n.BufferNamespaceApi=p},7975:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(_=>d(_.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((_,a)=>d(_,a.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const a=u(8460),p=u(844),w=u(5295),b=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let o=n.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(r,this))}resize(r,h){this.cols=r,this.rows=h,this.buffers.resize(r,h),this._onResize.fire({cols:r,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,h=!1){const c=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===r.fg&&l.getBg(0)===r.bg||(l=c.getBlankLine(r,h),this._cachedBlankLine=l),l.isWrapped=h;const S=c.ybase+c.scrollTop,x=c.ybase+c.scrollBottom;if(c.scrollTop===0){const v=c.lines.isFull;x===c.lines.length-1?v?c.lines.recycle().copyFrom(l):c.lines.push(l.clone()):c.lines.splice(x+1,0,l.clone()),v?this.isUserScrolling&&(c.ydisp=Math.max(c.ydisp-1,0)):(c.ybase++,this.isUserScrolling||c.ydisp++)}else{const v=x-S+1;c.lines.shiftElements(S+1,v-1,-1),c.lines.set(x,l.clone())}this.isUserScrolling||(c.ydisp=c.ybase),this._onScroll.fire(c.ydisp)}scrollLines(r,h,c){const l=this.buffer;if(r<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else r+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const S=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+r,l.ybase),0),S!==l.ydisp&&(h||this._onScroll.fire(l.ydisp))}};n.BufferService=o=d([_(0,b.IOptionsService)],o)},7994:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(F,n,u){var d=this&&this.__decorate||function(l,S,x,v){var y,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,S,x,v);else for(var L=l.length-1;L>=0;L--)(y=l[L])&&(C=(m<3?y(C):m>3?y(S,x,C):y(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(l,S){return function(x,v){S(x,v,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const a=u(2585),p=u(8460),w=u(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function o(l,S){let x=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(x|=64,x|=l.action):(x|=3&l.button,4&l.button&&(x|=64),8&l.button&&(x|=128),l.action===32?x|=32:l.action!==0||S||(x|=3)),x}const r=String.fromCharCode,h={DEFAULT:l=>{const S=[o(l,!1)+32,l.col+32,l.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${r(S[0])}${r(S[1])}${r(S[2])}`},SGR:l=>{const S=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${o(l,!0)};${l.col};${l.row}${S}`},SGR_PIXELS:l=>{const S=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${o(l,!0)};${l.x};${l.y}${S}`}};let c=n.CoreMouseService=class extends w.Disposable{constructor(l,S){super(),this._bufferService=l,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(b))this.addProtocol(x,b[x]);for(const x of Object.keys(h))this.addEncoding(x,h[x]);this.reset()}addProtocol(l,S){this._protocols[l]=S}addEncoding(l,S){this._encodings[l]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const S=this._encodings[this._activeEncoding](l);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,S,x){if(x){if(l.x!==S.x||l.y!==S.y)return!1}else if(l.col!==S.col||l.row!==S.row)return!1;return l.button===S.button&&l.action===S.action&&l.ctrl===S.ctrl&&l.alt===S.alt&&l.shift===S.shift}};n.CoreMouseService=c=d([_(0,a.IBufferService),_(1,a.ICoreService)],c)},6975:function(F,n,u){var d=this&&this.__decorate||function(c,l,S,x){var v,y=arguments.length,m=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(c,l,S,x);else for(var C=c.length-1;C>=0;C--)(v=c[C])&&(m=(y<3?v(m):y>3?v(l,S,m):v(l,S))||m);return y>3&&m&&Object.defineProperty(l,S,m),m},_=this&&this.__param||function(c,l){return function(S,x){l(S,x,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const a=u(1439),p=u(8460),w=u(844),b=u(2585),o=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=n.CoreService=class extends w.Disposable{constructor(c,l,S){super(),this._bufferService=c,this._logService=l,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(o),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(o),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(c,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${c}"`,(()=>c.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(c)}triggerBinaryEvent(c){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${c}"`,(()=>c.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(c))}};n.CoreService=h=d([_(0,b.IBufferService),_(1,b.ILogService),_(2,b.IOptionsService)],h)},9074:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=u(8055),_=u(8460),a=u(844),p=u(6106);let w=0,b=0;class o extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((c=>c==null?void 0:c.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(c){if(c.marker.isDisposed)return;const l=new r(c);if(l){const S=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),S.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const c of this._decorations.values())c.dispose();this._decorations.clear()}*getDecorationsAtCell(c,l,S){let x=0,v=0;for(const y of this._decorations.getKeyIterator(l))x=y.options.x??0,v=x+(y.options.width??1),c>=x&&c<v&&(!S||(y.options.layer??"bottom")===S)&&(yield y)}forEachDecorationAtCell(c,l,S,x){this._decorations.forEachByKey(l,(v=>{w=v.options.x??0,b=w+(v.options.width??1),c>=w&&c<b&&(!S||(v.options.layer??"bottom")===S)&&x(v)}))}}n.DecorationService=o;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(c){super(),this.options=c,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=c.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=u(2585),_=u(8343);class a{constructor(...w){this._entries=new Map;for(const[b,o]of w)this.set(b,o)}set(w,b){const o=this._entries.get(w);return this._entries.set(w,b),o}forEach(w){for(const[b,o]of this._entries.entries())w(b,o)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}n.ServiceCollection=a,n.InstantiationService=class{constructor(){this._services=new a,this._services.set(d.IInstantiationService,this)}setService(p,w){this._services.set(p,w)}getService(p){return this._services.get(p)}createInstance(p,...w){const b=(0,_.getServiceDependencies)(p).sort(((h,c)=>h.index-c.index)),o=[];for(const h of b){const c=this._services.get(h.id);if(!c)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${h.id}.`);o.push(c)}const r=b.length>0?b[0].index:w.length;if(w.length!==r)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${r+1} conflicts with ${w.length} static arguments`);return new p(...w,...o)}}},7866:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(844),p=u(2585),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},7302:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=u(8460),_=u(844),a=u(6114);n.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:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends _.Disposable{constructor(o){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const h in o)if(h in r)try{const c=o[h];r[h]=this._sanitizeAndValidateOption(h,c)}catch(c){console.error(c)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(o,r){return this.onOptionChange((h=>{h===o&&r(this.rawOptions[o])}))}onMultipleOptionChange(o,r){return this.onOptionChange((h=>{o.indexOf(h)!==-1&&r()}))}_setupOptions(){const o=h=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},r=(h,c)=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);c=this._sanitizeAndValidateOption(h,c),this.rawOptions[h]!==c&&(this.rawOptions[h]=c,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const c={get:o.bind(this,h),set:r.bind(this,h)};Object.defineProperty(this.options,h,c)}}_sanitizeAndValidateOption(o,r){switch(o){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[o]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${o}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[o]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=p.includes(r)?r:n.DEFAULT_OPTIONS[o];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${o} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${o} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${o} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${o} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=w},2660:function(F,n,u){var d=this&&this.__decorate||function(w,b,o,r){var h,c=arguments.length,l=c<3?b:r===null?r=Object.getOwnPropertyDescriptor(b,o):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(w,b,o,r);else for(var S=w.length-1;S>=0;S--)(h=w[S])&&(l=(c<3?h(l):c>3?h(b,o,l):h(b,o))||l);return c>3&&l&&Object.defineProperty(b,o,l),l},_=this&&this.__param||function(w,b){return function(o,r){b(o,r,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const a=u(2585);let p=n.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const b=this._bufferService.buffer;if(w.id===void 0){const S=b.addMarker(b.ybase+b.y),x={data:w,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(x,S))),this._dataByLinkId.set(x.id,x),x.id}const o=w,r=this._getEntryIdKey(o),h=this._entriesWithId.get(r);if(h)return this.addLineToLink(h.id,b.ybase+b.y),h.id;const c=b.addMarker(b.ybase+b.y),l={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[c]};return c.onDispose((()=>this._removeMarkerFromLink(l,c))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(w,b){const o=this._dataByLinkId.get(w);if(o&&o.lines.every((r=>r.line!==b))){const r=this._bufferService.buffer.addMarker(b);o.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(o,r)))}}getLinkData(w){var b;return(b=this._dataByLinkId.get(w))==null?void 0:b.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,b){const o=w.lines.indexOf(b);o!==-1&&(w.lines.splice(o,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};n.OscLinkService=p=d([_(0,a.IBufferService)],p)},8343:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},2585:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(8343);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=u(8460),_=u(225);class a{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,b,o=!1){return(16777215&w)<<3|(3&b)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const w=new _.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let b=0,o=0;const r=w.length;for(let h=0;h<r;++h){let c=w.charCodeAt(h);if(55296<=c&&c<=56319){if(++h>=r)return b+this.wcwidth(c);const x=w.charCodeAt(h);56320<=x&&x<=57343?c=1024*(c-55296)+x-56320+65536:b+=this.wcwidth(x)}const l=this.charProperties(c,o);let S=a.extractWidth(l);a.extractShouldJoin(l)&&(S-=a.extractWidth(o)),b+=S,o=l}return b}charProperties(w,b){return this._activeProvider.charProperties(w,b)}}n.UnicodeService=a}},I={};function J(F){var n=I[F];if(n!==void 0)return n.exports;var u=I[F]={exports:{}};return X[F].call(u.exports,u,u.exports,J),u.exports}var ie={};return(()=>{var F=ie;Object.defineProperty(F,"__esModule",{value:!0}),F.Terminal=void 0;const n=J(9042),u=J(3236),d=J(844),_=J(5741),a=J(8285),p=J(7975),w=J(7090),b=["cols","rows"];class o extends d.Disposable{constructor(h){super(),this._core=this.register(new u.Terminal(h)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const c=S=>this._core.options[S],l=(S,x)=>{this._checkReadonlyOptions(S),this._core.options[S]=x};for(const S in this._core.options){const x={get:c.bind(this,S),set:l.bind(this,S)};Object.defineProperty(this._publicOptions,S,x)}}_checkReadonlyOptions(h){if(b.includes(h))throw new Error(`Option "${h}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let c="none";switch(this._core.coreMouseService.activeProtocol){case"X10":c="x10";break;case"VT200":c="vt200";break;case"DRAG":c="drag";break;case"ANY":c="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:c,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const c in h)this._publicOptions[c]=h[c]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,c=!0){this._core.input(h,c)}resize(h,c){this._verifyIntegers(h,c),this._core.resize(h,c)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,c,l){this._verifyIntegers(h,c,l),this._core.select(h,c,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,c){this._verifyIntegers(h,c),this._core.selectLines(h,c)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,c){this._core.write(h,c)}writeln(h,c){this._core.write(h),this._core.write(`\r
57
+ `,c)}paste(h){this._core.paste(h)}refresh(h,c){this._verifyIntegers(h,c),this._core.refresh(h,c)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return n}_verifyIntegers(...h){for(const c of h)if(c===1/0||isNaN(c)||c%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const c of h)if(c&&(c===1/0||isNaN(c)||c%1!=0||c<0))throw new Error("This API only accepts positive integers")}}F.Terminal=o})(),ie})()))})(ko)),ko.exports}var ig=tg(),Ho={exports:{}},Qd;function sg(){return Qd||(Qd=1,(function(P,W){(function(X,I){P.exports=I()})(self,(()=>(()=>{var X={};return(()=>{var I=X;Object.defineProperty(I,"__esModule",{value:!0}),I.FitAddon=void 0,I.FitAddon=class{activate(J){this._terminal=J}dispose(){}fit(){const J=this.proposeDimensions();if(!J||!this._terminal||isNaN(J.cols)||isNaN(J.rows))return;const ie=this._terminal._core;this._terminal.rows===J.rows&&this._terminal.cols===J.cols||(ie._renderService.clear(),this._terminal.resize(J.cols,J.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const J=this._terminal._core,ie=J._renderService.dimensions;if(ie.css.cell.width===0||ie.css.cell.height===0)return;const F=this._terminal.options.scrollback===0?0:J.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(n.getPropertyValue("height")),d=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),a=u-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=d-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-F;return{cols:Math.max(2,Math.floor(p/ie.css.cell.width)),rows:Math.max(1,Math.floor(a/ie.css.cell.height))}}}})(),X})()))})(Ho)),Ho.exports}var rg=sg(),zo={exports:{}},Zd;function ng(){return Zd||(Zd=1,(function(P,W){(function(X,I){P.exports=I()})(self,(()=>(()=>{var X={965:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const d=u(374),_=u(509),a=u(855),p=u(859),w=u(381),b=11,o=b*Float32Array.BYTES_PER_ELEMENT;let r,h=0,c=0,l=0;class S extends p.Disposable{constructor(v,y,m,C){super(),this._terminal=v,this._gl=y,this._dimensions=m,this._optionsService=C,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;_.TextureAtlas.maxAtlasPages===void 0&&(_.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,w.createProgram)(L,`#version 300 es
58
58
  layout (location = 0) in vec2 a_unitquad;
59
59
  layout (location = 1) in vec2 a_cellpos;
60
60
  layout (location = 2) in vec2 a_offset;
@@ -74,21 +74,21 @@ void main() {
74
74
  gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
75
75
  v_texpage = int(a_texpage);
76
76
  v_texcoord = a_texcoord + a_unitquad * a_texsize;
77
- }`,(function(N){let P="";for(let j=1;j<N;j++)P+=` else if (v_texpage == ${j}) { outColor = texture(u_texture[${j}], v_texcoord); }`;return`#version 300 es
77
+ }`,(function(U){let j="";for(let z=1;z<U;z++)j+=` else if (v_texpage == ${z}) { outColor = texture(u_texture[${z}], v_texcoord); }`;return`#version 300 es
78
78
  precision lowp float;
79
79
 
80
80
  in vec2 v_texcoord;
81
81
  flat in int v_texpage;
82
82
 
83
- uniform sampler2D u_texture[${N}];
83
+ uniform sampler2D u_texture[${U}];
84
84
 
85
85
  out vec4 outColor;
86
86
 
87
87
  void main() {
88
88
  if (v_texpage == 0) {
89
89
  outColor = texture(u_texture[0], v_texcoord);
90
- } ${P}
91
- }`})(_.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const A=new Float32Array([0,0,1,0,0,1,1,1]),E=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(E)))),L.bindBuffer(L.ARRAY_BUFFER,E),L.bufferData(L.ARRAY_BUFFER,A,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const R=new Uint8Array([0,1,2,3]),k=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(k)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,k),L.bufferData(L.ELEMENT_ARRAY_BUFFER,R,L.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(L.createBuffer()),this.register((0,p.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,o,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const $=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let N=0;N<_.TextureAtlas.maxAtlasPages;N++)$[N]=N;L.uniform1iv(this._textureLocation,$),L.uniformMatrix4fv(this._projectionLocation,!1,w.PROJECTION_MATRIX),this._atlasTextures=[];for(let N=0;N<_.TextureAtlas.maxAtlasPages;N++){const P=new w.GLTexture((0,d.throwIfFalsy)(L.createTexture()));this.register((0,p.toDisposable)((()=>L.deleteTexture(P.texture)))),L.activeTexture(L.TEXTURE0+N),L.bindTexture(L.TEXTURE_2D,P.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[N]=P}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(v,y,m,C,L,A,E,R,k){this._updateCell(this._vertices.attributes,v,y,m,C,L,A,E,R,k)}_updateCell(v,y,m,C,L,A,E,R,k,$){h=(m*this._terminal.cols+y)*b,C!==a.NULL_CELL_CODE&&C!==void 0?this._atlas&&(r=R&&R.length>1?this._atlas.getRasterizedGlyphCombinedChar(R,L,A,E,!1):this._atlas.getRasterizedGlyph(C,L,A,E,!1),c=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==$&&r.offset.x>c?(l=r.offset.x-c,v[h]=-(r.offset.x-l)+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=(r.size.x-l)/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x+l/this._atlas.pages[r.texturePage].canvas.width,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x-l/this._atlas.pages[r.texturePage].canvas.width,v[h+8]=r.sizeClipSpace.y):(v[h]=-r.offset.x+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=r.size.x/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x,v[h+8]=r.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(C,k,r.size.x,this._dimensions.device.cell.width)&&(v[h+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):v.fill(0,h,h+b-1-2)}clear(){const v=this._terminal,y=v.cols*v.rows*b;this._vertices.count!==y?this._vertices.attributes=new Float32Array(y):this._vertices.attributes.fill(0);let m=0;for(;m<this._vertices.attributesBuffers.length;m++)this._vertices.count!==y?this._vertices.attributesBuffers[m]=new Float32Array(y):this._vertices.attributesBuffers[m].fill(0);this._vertices.count=y,m=0;for(let C=0;C<v.rows;C++)for(let L=0;L<v.cols;L++)this._vertices.attributes[m+9]=L/v.cols,this._vertices.attributes[m+10]=C/v.rows,m+=b}handleResize(){const v=this._gl;v.useProgram(this._program),v.viewport(0,0,v.canvas.width,v.canvas.height),v.uniform2f(this._resolutionLocation,v.canvas.width,v.canvas.height),this.clear()}render(v){if(!this._atlas)return;const y=this._gl;y.useProgram(this._program),y.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const m=this._vertices.attributesBuffers[this._activeBuffer];let C=0;for(let L=0;L<v.lineLengths.length;L++){const A=L*this._terminal.cols*b,E=this._vertices.attributes.subarray(A,A+v.lineLengths[L]*b);m.set(E,C),C+=E.length}y.bindBuffer(y.ARRAY_BUFFER,this._attributesBuffer),y.bufferData(y.ARRAY_BUFFER,m.subarray(0,C),y.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(y,this._atlas,L);y.drawElementsInstanced(y.TRIANGLE_STRIP,4,y.UNSIGNED_BYTE,0,C/b)}setAtlas(v){this._atlas=v;for(const y of this._atlasTextures)y.version=-1}_bindAtlasPageTexture(v,y,m){v.activeTexture(v.TEXTURE0+m),v.bindTexture(v.TEXTURE_2D,this._atlasTextures[m].texture),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,y.pages[m].canvas),v.generateMipmap(v.TEXTURE_2D),this._atlasTextures[m].version=y.pages[m].version}setDimensions(v){this._dimensions=v}}n.GlyphRenderer=S},742:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const d=u(374),_=u(859),a=u(310),p=u(381),w=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let o=0,r=0,h=0,c=0,l=0,S=0,x=0;class v extends _.Disposable{constructor(m,C,L,A){super(),this._terminal=m,this._gl=C,this._dimensions=L,this._themeService=A,this._vertices=new b,this._verticesCursor=new b;const E=this._gl;this._program=(0,d.throwIfFalsy)((0,p.createProgram)(E,`#version 300 es
90
+ } ${j}
91
+ }`})(_.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const R=new Float32Array([0,0,1,0,0,1,1,1]),E=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(E)))),L.bindBuffer(L.ARRAY_BUFFER,E),L.bufferData(L.ARRAY_BUFFER,R,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),O=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(O)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,O),L.bufferData(L.ELEMENT_ARRAY_BUFFER,D,L.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(L.createBuffer()),this.register((0,p.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,o,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const $=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++)$[U]=U;L.uniform1iv(this._textureLocation,$),L.uniformMatrix4fv(this._projectionLocation,!1,w.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++){const j=new w.GLTexture((0,d.throwIfFalsy)(L.createTexture()));this.register((0,p.toDisposable)((()=>L.deleteTexture(j.texture)))),L.activeTexture(L.TEXTURE0+U),L.bindTexture(L.TEXTURE_2D,j.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[U]=j}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(v,y,m,C,L,R,E,D,O){this._updateCell(this._vertices.attributes,v,y,m,C,L,R,E,D,O)}_updateCell(v,y,m,C,L,R,E,D,O,$){h=(m*this._terminal.cols+y)*b,C!==a.NULL_CELL_CODE&&C!==void 0?this._atlas&&(r=D&&D.length>1?this._atlas.getRasterizedGlyphCombinedChar(D,L,R,E,!1):this._atlas.getRasterizedGlyph(C,L,R,E,!1),c=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==$&&r.offset.x>c?(l=r.offset.x-c,v[h]=-(r.offset.x-l)+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=(r.size.x-l)/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x+l/this._atlas.pages[r.texturePage].canvas.width,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x-l/this._atlas.pages[r.texturePage].canvas.width,v[h+8]=r.sizeClipSpace.y):(v[h]=-r.offset.x+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=r.size.x/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x,v[h+8]=r.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(C,O,r.size.x,this._dimensions.device.cell.width)&&(v[h+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):v.fill(0,h,h+b-1-2)}clear(){const v=this._terminal,y=v.cols*v.rows*b;this._vertices.count!==y?this._vertices.attributes=new Float32Array(y):this._vertices.attributes.fill(0);let m=0;for(;m<this._vertices.attributesBuffers.length;m++)this._vertices.count!==y?this._vertices.attributesBuffers[m]=new Float32Array(y):this._vertices.attributesBuffers[m].fill(0);this._vertices.count=y,m=0;for(let C=0;C<v.rows;C++)for(let L=0;L<v.cols;L++)this._vertices.attributes[m+9]=L/v.cols,this._vertices.attributes[m+10]=C/v.rows,m+=b}handleResize(){const v=this._gl;v.useProgram(this._program),v.viewport(0,0,v.canvas.width,v.canvas.height),v.uniform2f(this._resolutionLocation,v.canvas.width,v.canvas.height),this.clear()}render(v){if(!this._atlas)return;const y=this._gl;y.useProgram(this._program),y.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const m=this._vertices.attributesBuffers[this._activeBuffer];let C=0;for(let L=0;L<v.lineLengths.length;L++){const R=L*this._terminal.cols*b,E=this._vertices.attributes.subarray(R,R+v.lineLengths[L]*b);m.set(E,C),C+=E.length}y.bindBuffer(y.ARRAY_BUFFER,this._attributesBuffer),y.bufferData(y.ARRAY_BUFFER,m.subarray(0,C),y.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(y,this._atlas,L);y.drawElementsInstanced(y.TRIANGLE_STRIP,4,y.UNSIGNED_BYTE,0,C/b)}setAtlas(v){this._atlas=v;for(const y of this._atlasTextures)y.version=-1}_bindAtlasPageTexture(v,y,m){v.activeTexture(v.TEXTURE0+m),v.bindTexture(v.TEXTURE_2D,this._atlasTextures[m].texture),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,y.pages[m].canvas),v.generateMipmap(v.TEXTURE_2D),this._atlasTextures[m].version=y.pages[m].version}setDimensions(v){this._dimensions=v}}n.GlyphRenderer=S},742:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const d=u(374),_=u(859),a=u(310),p=u(381),w=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let o=0,r=0,h=0,c=0,l=0,S=0,x=0;class v extends _.Disposable{constructor(m,C,L,R){super(),this._terminal=m,this._gl=C,this._dimensions=L,this._themeService=R,this._vertices=new b,this._verticesCursor=new b;const E=this._gl;this._program=(0,d.throwIfFalsy)((0,p.createProgram)(E,`#version 300 es
92
92
  layout (location = 0) in vec2 a_position;
93
93
  layout (location = 1) in vec2 a_size;
94
94
  layout (location = 2) in vec4 a_color;
@@ -111,7 +111,7 @@ out vec4 outColor;
111
111
 
112
112
  void main() {
113
113
  outColor = v_color;
114
- }`)),this.register((0,_.toDisposable)((()=>E.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const R=new Float32Array([0,0,1,0,0,1,1,1]),k=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(k)))),E.bindBuffer(E.ARRAY_BUFFER,k),E.bufferData(E.ARRAY_BUFFER,R,E.STATIC_DRAW),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const $=new Uint8Array([0,1,2,3]),N=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(N)))),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,N),E.bufferData(E.ELEMENT_ARRAY_BUFFER,$,E.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(E.createBuffer()),this.register((0,_.toDisposable)((()=>E.deleteBuffer(this._attributesBuffer)))),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.enableVertexAttribArray(0),E.vertexAttribPointer(0,2,E.FLOAT,!1,w,0),E.vertexAttribDivisor(0,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,4,E.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(2,1),this._updateCachedColors(A.colors),this.register(this._themeService.onChangeColors((P=>{this._updateCachedColors(P),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(m){const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),C.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,m.attributes,C.DYNAMIC_DRAW),C.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,C.UNSIGNED_BYTE,0,m.count)}handleResize(){this._updateViewportRectangle()}setDimensions(m){this._dimensions=m}_updateCachedColors(m){this._bgFloat=this._colorToFloat32Array(m.background),this._cursorFloat=this._colorToFloat32Array(m.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(m){const C=this._terminal,L=this._vertices;let A,E,R,k,$,N,P,j,D,O,T,B=1;for(A=0;A<C.rows;A++){for(R=-1,k=0,$=0,N=!1,E=0;E<C.cols;E++)P=(A*C.cols+E)*a.RENDER_MODEL_INDICIES_PER_CELL,j=m.cells[P+a.RENDER_MODEL_BG_OFFSET],D=m.cells[P+a.RENDER_MODEL_FG_OFFSET],O=!!(67108864&D),(j!==k||D!==$&&(N||O))&&((k!==0||N&&$!==0)&&(T=8*B++,this._updateRectangle(L,T,$,k,R,E,A)),R=E,k=j,$=D,N=O);(k!==0||N&&$!==0)&&(T=8*B++,this._updateRectangle(L,T,$,k,R,C.cols,A))}L.count=B}updateCursor(m){const C=this._verticesCursor,L=m.cursor;if(!L||L.style==="block")return void(C.count=0);let A,E=0;L.style!=="bar"&&L.style!=="outline"||(A=8*E++,this._addRectangleFloat(C.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(A=8*E++,this._addRectangleFloat(C.attributes,A,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(A=8*E++,this._addRectangleFloat(C.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),A=8*E++,this._addRectangleFloat(C.attributes,A,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),C.count=E}_updateRectangle(m,C,L,A,E,R,k){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:o=(16777215&L)<<8;break;default:o=this._themeService.colors.foreground.rgba}else switch(50331648&A){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&A].rgba;break;case 50331648:o=(16777215&A)<<8;break;default:o=this._themeService.colors.background.rgba}m.attributes.length<C+4&&(m.attributes=(0,p.expandFloat32Array)(m.attributes,this._terminal.rows*this._terminal.cols*8)),r=E*this._dimensions.device.cell.width,h=k*this._dimensions.device.cell.height,c=(o>>24&255)/255,l=(o>>16&255)/255,S=(o>>8&255)/255,x=1,this._addRectangle(m.attributes,C,r,h,(R-E)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,c,l,S,x)}_addRectangle(m,C,L,A,E,R,k,$,N,P){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=A/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=R/this._dimensions.device.canvas.height,m[C+4]=k,m[C+5]=$,m[C+6]=N,m[C+7]=P}_addRectangleFloat(m,C,L,A,E,R,k){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=A/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=R/this._dimensions.device.canvas.height,m[C+4]=k[0],m[C+5]=k[1],m[C+6]=k[2],m[C+7]=k[3]}_colorToFloat32Array(m){return new Float32Array([(m.rgba>>24&255)/255,(m.rgba>>16&255)/255,(m.rgba>>8&255)/255,(255&m.rgba)/255])}}n.RectangleRenderer=v},310:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(_,a){const p=_*a*n.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const d=u(820),_=u(274),a=u(627),p=u(457),w=u(56),b=u(374),o=u(345),r=u(859),h=u(147),c=u(782),l=u(855),S=u(965),x=u(742),v=u(310),y=u(733);class m extends r.Disposable{constructor(E,R,k,$,N,P,j,D,O){super(),this._terminal=E,this._characterJoinerService=R,this._charSizeService=k,this._coreBrowserService=$,this._coreService=N,this._decorationService=P,this._optionsService=j,this._themeService=D,this._cursorBlinkStateManager=new r.MutableDisposable,this._charAtlasDisposable=this.register(new r.MutableDisposable),this._observerDisposable=this.register(new r.MutableDisposable),this._model=new v.RenderModel,this._workCell=new c.CellData,this._workCell2=new c.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new _.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new y.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,j,this._themeService)],this.dimensions=(0,b.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(j.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const T={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",T),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(B=>{console.log("webglcontextlost event received"),B.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(B)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(B=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,a.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,w.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((B,q)=>this._setCanvasDevicePixelDimensions(B,q))),this.register(this._coreBrowserService.onWindowChange((B=>{this._observerDisposable.value=(0,w.observeDevicePixelDimensions)(this._canvas,B,((q,K)=>this._setCanvasDevicePixelDimensions(q,K)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,r.toDisposable)((()=>{var B;for(const q of this._renderLayers)q.dispose();(B=this._canvas.parentElement)==null||B.removeChild(this._canvas),(0,a.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var E;return(E=this._charAtlas)==null?void 0:E.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(E,R){var k,$,N,P;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const j of this._renderLayers)j.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(k=this._rectangleRenderer.value)==null||k.setDimensions(this.dimensions),($=this._rectangleRenderer.value)==null||$.handleResize(),(N=this._glyphRenderer.value)==null||N.setDimensions(this.dimensions),(P=this._glyphRenderer.value)==null||P.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var E;for(const R of this._renderLayers)R.handleBlur(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.pause(),this._requestRedrawViewport()}handleFocus(){var E;for(const R of this._renderLayers)R.handleFocus(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.resume(),this._requestRedrawViewport()}handleSelectionChanged(E,R,k){for(const $ of this._renderLayers)$.handleSelectionChanged(this._terminal,E,R,k);this._model.selection.update(this._core,E,R,k),this._requestRedrawViewport()}handleCursorMove(){var E;for(const R of this._renderLayers)R.handleCursorMove(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var R;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const E=(0,a.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==E&&(this._onChangeTextureAtlas.fire(E.pages[0].canvas),this._charAtlasDisposable.value=(0,r.getDisposeArrayDisposable)([(0,o.forwardEvent)(E.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,o.forwardEvent)(E.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=E,this._charAtlas.warmUp(),(R=this._glyphRenderer.value)==null||R.setAtlas(this._charAtlas)}_clearModel(E){var R;this._model.clear(),E&&((R=this._glyphRenderer.value)==null||R.clear())}clearTextureAtlas(){var E;(E=this._charAtlas)==null||E.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var E;this._clearModel(!0);for(const R of this._renderLayers)R.reset(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(E){return-1}deregisterCharacterJoiner(E){return!1}renderRows(E,R){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const k of this._renderLayers)k.handleGridChanged(this._terminal,E,R);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(E,R),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(E,R){const k=this._core;let $,N,P,j,D,O,T,B,q,K,oe,ce,W,z,re=this._workCell;E=L(E,k.rows-1,0),R=L(R,k.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ve=ee-k.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,k.cols-1);let Me=-1;const _e=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Oe=!1;for(N=E;N<=R;N++)for(P=N+k.buffer.ydisp,j=k.buffer.lines.get(P),this._model.lineLengths[N]=0,D=this._characterJoinerService.getJoinedCharacters(P),W=0;W<k.cols;W++)if($=this._cellColorResolver.result.bg,j.loadCell(W,re),W===0&&($=this._cellColorResolver.result.bg),O=!1,T=W,D.length>0&&W===D[0][0]&&(O=!0,B=D.shift(),re=new C(re,j.translateToString(!0,B[0],B[1]),B[1]-B[0]),T=B[1]-1),q=re.getChars(),K=re.getCode(),ce=(N*k.cols+W)*v.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,W,P,this.dimensions.device.cell.width),_e&&P===ee&&(W===fe&&(this._model.cursor={x:fe,y:ve,width:re.getWidth(),style:this._coreBrowserService.isFocused?k.options.cursorStyle||"block":k.options.cursorInactiveStyle,cursorWidth:k.options.cursorWidth,dpr:this._devicePixelRatio},Me=fe+re.getWidth()-1),W>=fe&&W<=Me&&(this._coreBrowserService.isFocused&&(k.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&k.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),K!==l.NULL_CELL_CODE&&(this._model.lineLengths[N]=W+1),(this._model.cells[ce]!==K||this._model.cells[ce+v.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ce+v.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ce+v.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Oe=!0,q.length>1&&(K|=v.COMBINED_CHAR_BIT_MASK),this._model.cells[ce]=K,this._model.cells[ce+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ce+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ce+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,oe=re.getWidth(),this._glyphRenderer.value.updateCell(W,N,K,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,q,oe,$),O))for(re=this._workCell,W++;W<T;W++)z=(N*k.cols+W)*v.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(W,N,l.NULL_CELL_CODE,0,0,0,l.NULL_CELL_CHAR,0,0),this._model.cells[z]=l.NULL_CELL_CODE,this._model.cells[z+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[z+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[z+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Oe&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(E,R){this._canvas.width===E&&this._canvas.height===R||(this._canvas.width=E,this._canvas.height=R,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const E=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:E,end:E})}}n.WebglRenderer=m;class C extends h.AttributeData{constructor(E,R,k){super(),this.content=0,this.combinedData="",this.fg=E.fg,this.bg=E.bg,this.combinedData=R,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(E){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(A,E,R=0){return Math.max(Math.min(A,E),R)}n.JoinedCellData=C},381:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const d=u(374);function _(a,p,w){const b=(0,d.throwIfFalsy)(a.createShader(p));if(a.shaderSource(b,w),a.compileShader(b),a.getShaderParameter(b,a.COMPILE_STATUS))return b;console.error(a.getShaderInfoLog(b)),a.deleteShader(b)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(a,p,w){const b=(0,d.throwIfFalsy)(a.createProgram());if(a.attachShader(b,(0,d.throwIfFalsy)(_(a,a.VERTEX_SHADER,p))),a.attachShader(b,(0,d.throwIfFalsy)(_(a,a.FRAGMENT_SHADER,w))),a.linkProgram(b),a.getProgramParameter(b,a.LINK_STATUS))return b;console.error(a.getProgramInfoLog(b)),a.deleteProgram(b)},n.createShader=_,n.expandFloat32Array=function(a,p){const w=Math.min(2*a.length,p),b=new Float32Array(w);for(let o=0;o<a.length;o++)b[o]=a[o];return b},n.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(627),_=u(237),a=u(374),p=u(859);class w extends p.Disposable{constructor(o,r,h,c,l,S,x,v){super(),this._container=r,this._alpha=l,this._coreBrowserService=S,this._optionsService=x,this._themeService=v,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=c.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((y=>{this._refreshCharAtlas(o,y),this.reset(o)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(o){}handleFocus(o){}handleCursorMove(o){}handleGridChanged(o,r,h){}handleSelectionChanged(o,r,h,c=!1){}_setTransparency(o,r){if(r===this._alpha)return;const h=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(o,this._themeService.colors),this.handleGridChanged(o,0,o.rows-1)}_refreshCharAtlas(o,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(o,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(o,r){this._deviceCellWidth=r.device.cell.width,this._deviceCellHeight=r.device.cell.height,this._deviceCharWidth=r.device.char.width,this._deviceCharHeight=r.device.char.height,this._deviceCharLeft=r.device.char.left,this._deviceCharTop=r.device.char.top,this._canvas.width=r.device.canvas.width,this._canvas.height=r.device.canvas.height,this._canvas.style.width=`${r.css.canvas.width}px`,this._canvas.style.height=`${r.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(o,this._themeService.colors)}_fillBottomLineAtCells(o,r,h=1){this._ctx.fillRect(o*this._deviceCellWidth,(r+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(o,r,h,c){this._alpha?this._ctx.clearRect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight))}_fillCharTrueColor(o,r,h,c){this._ctx.font=this._getFont(o,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(h,c,r.getWidth()),this._ctx.fillText(r.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,c*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(o,r,h){this._ctx.beginPath(),this._ctx.rect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(o,r,h){return`${h?"italic":""} ${r?o.options.fontWeightBold:o.options.fontWeight} ${o.options.fontSize*this._coreBrowserService.dpr}px ${o.options.fontFamily}`}}n.BaseRenderLayer=w},733:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(592);class p extends a.BaseRenderLayer{constructor(b,o,r,h,c,l,S){super(r,b,"link",o,!0,c,l,S),this.register(h.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(h.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(b,o){super.resize(b,o),this._state=void 0}reset(b){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg!==void 0&&(0,d.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let o=b.y1+1;o<b.y2;o++)this._fillBottomLineAtCells(0,o,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=p},820:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,_,a))}}}},274:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let p,w=0,b=0,o=!1,r=!1,h=!1,c=0;n.CellColorResolver=class{constructor(l,S,x,v,y,m){this._terminal=l,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=y,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(l,S,x,v){if(this.result.bg=l.bg,this.result.fg=l.fg,this.result.ext=268435456&l.bg?l.extended.ext:0,b=0,w=0,r=!1,o=!1,h=!1,p=this._themeService.colors,c=0,l.getCode()!==d.NULL_CELL_CODE&&l.extended.underlineStyle===4){const y=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));c=S*v%(2*Math.round(y))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,p.selectionForeground&&(w=p.selectionForeground.rgba>>8&16777215,o=!0),(0,a.treatGlyphAsBackgroundColor)(l.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}w=_.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(b=h?-16777216&l.bg&-134217729|b|50331648:-16777216&l.bg|b|50331648),o&&(w=-16777216&l.fg&-67108865|w|50331648),67108864&this.result.fg&&(r&&!o&&(w=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!r&&o&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),p=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=o?w:this.result.fg,this.result.ext&=536870911,this.result.ext|=c<<29&3758096384}}},627:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(p,w,b,o,r,h,c,l){const S=(0,_.generateConfig)(o,r,h,c,w,b,l);for(let y=0;y<a.length;y++){const m=a[y],C=m.ownedBy.indexOf(p);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(y,1)):m.ownedBy.splice(C,1);break}}for(let y=0;y<a.length;y++){const m=a[y];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(p),m.atlas}const x=p._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(p){for(let w=0;w<a.length;w++){const b=a[w].ownedBy.indexOf(p);if(b!==-1){a[w].ownedBy.length===1?(a[w].atlas.dispose(),a.splice(w,1)):a[w].ownedBy.splice(b,1);break}}}},197:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,p,w,b,o,r){const h={foreground:o.foreground,background:o.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:w,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let p=0;p<_.colors.ansi.length;p++)if(_.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(o,r,h,c,l,S,x,v){const y=n.blockElementDefinitions[r];if(y)return(function(A,E,R,k,$,N){for(let P=0;P<E.length;P++){const j=E[P],D=$/8,O=N/8;A.fillRect(R+j.x*D,k+j.y*O,j.w*D,j.h*O)}})(o,y,h,c,l,S),!0;const m=_[r];if(m)return(function(A,E,R,k,$,N){let P=a.get(E);P||(P=new Map,a.set(E,P));const j=A.fillStyle;if(typeof j!="string")throw new Error(`Unexpected fillStyle type "${j}"`);let D=P.get(j);if(!D){const O=E[0].length,T=E.length,B=A.canvas.ownerDocument.createElement("canvas");B.width=O,B.height=T;const q=(0,d.throwIfFalsy)(B.getContext("2d")),K=new ImageData(O,T);let oe,ce,W,z;if(j.startsWith("#"))oe=parseInt(j.slice(1,3),16),ce=parseInt(j.slice(3,5),16),W=parseInt(j.slice(5,7),16),z=j.length>7&&parseInt(j.slice(7,9),16)||1;else{if(!j.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${j}" when drawing pattern glyph`);[oe,ce,W,z]=j.substring(5,j.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<T;re++)for(let ee=0;ee<O;ee++)K.data[4*(re*O+ee)]=oe,K.data[4*(re*O+ee)+1]=ce,K.data[4*(re*O+ee)+2]=W,K.data[4*(re*O+ee)+3]=E[re][ee]*(255*z);q.putImageData(K,0,0),D=(0,d.throwIfFalsy)(A.createPattern(B,null)),P.set(j,D)}A.fillStyle=D,A.fillRect(R,k,$,N)})(o,m,h,c,l,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(A,E,R,k,$,N,P){A.strokeStyle=A.fillStyle;for(const[j,D]of Object.entries(E)){let O;A.beginPath(),A.lineWidth=P*Number.parseInt(j),O=typeof D=="function"?D(.15,.15/N*$):D;for(const T of O.split(" ")){const B=T[0],q=w[B];if(!q){console.error(`Could not find drawing instructions for "${B}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&q(A,b(K,$,N,R,k,!0,P))}A.stroke(),A.closePath()}})(o,C,h,c,l,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(A,E,R,k,$,N,P,j){const D=new Path2D;D.rect(R,k,$,N),A.clip(D),A.beginPath();const O=P/12;A.lineWidth=j*O;for(const T of E.d.split(" ")){const B=T[0],q=w[B];if(!q){console.error(`Could not find drawing instructions for "${B}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&q(A,b(K,$,N,R,k,!1,j,(E.leftPadding??0)*(O/2),(E.rightPadding??0)*(O/2)))}E.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()})(o,L,h,c,l,S,x,v),!0)};const a=new Map;function p(o,r,h=0){return Math.max(Math.min(o,r),h)}const w={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function b(o,r,h,c,l,S,x,v=0,y=0){const m=o.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-y*x,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,r,0)),m[C]+=c+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,h,0)),m[C]+=l;return m}},56:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,p){let w=new a.ResizeObserver((b=>{const o=b.find((c=>c.target===_));if(!o)return;if(!("devicePixelContentBoxSize"in o))return w==null||w.disconnect(),void(w=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,h=o.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&p(r,h)}));try{w.observe(_,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)((()=>w==null?void 0:w.disconnect()))}},374:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),p=u(160),w=u(345),b=u(485),o=u(385),r=u(147),h=u(855),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let l;class S{get pages(){return this._pages}constructor(C,L,A){this._document=C,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new w.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new w.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=y(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new o.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const A=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,A)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(S.maxTextureSize||4096))).sort(((P,j)=>j.canvas.width!==P.canvas.width?j.canvas.width-P.canvas.width:j.percentageUsed-P.percentageUsed));let A=-1,E=0;for(let P=0;P<L.length;P++)if(L[P].canvas.width!==E)A=P,E=L[P].canvas.width;else if(P-A==3)break;const R=L.slice(A,A+4),k=R.map((P=>P.glyphs[0].texturePage)).sort(((P,j)=>P>j?1:-1)),$=this.pages.length-R.length,N=this._mergePages(R,$);N.version++;for(let P=k.length-1;P>=0;P--)this._deletePage(k[P]);this.pages.push(N),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(N.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const A=2*C[0].canvas.width,E=new x(this._document,A,C);for(const[R,k]of C.entries()){const $=R*k.canvas.width%A,N=Math.floor(R/2)*k.canvas.height;E.ctx.drawImage(k.canvas,$,N);for(const j of k.glyphs)j.texturePage=L,j.sizeClipSpace.x=j.size.x/A,j.sizeClipSpace.y=j.size.y/A,j.texturePosition.x+=$,j.texturePosition.y+=N,j.texturePositionClipSpace.x=j.texturePosition.x/A,j.texturePositionClipSpace.y=j.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(k.canvas);const P=this._activePages.indexOf(k);P!==-1&&this._activePages.splice(P,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const A=this._pages[L];for(const E of A.glyphs)E.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(C,L,A,E,R){return this._getFromCacheMap(this._cacheMapCombined,C,L,A,E,R)}getRasterizedGlyph(C,L,A,E,R){return this._getFromCacheMap(this._cacheMap,C,L,A,E,R)}_getFromCacheMap(C,L,A,E,R,k=!1){return l=C.get(L,A,E,R),l||(l=this._drawToCache(L,A,E,R,k),C.set(L,A,E,R,l)),l}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,A,E){if(this._config.allowTransparency)return p.NULL_COLOR;let R;switch(C){case 16777216:case 33554432:R=this._getColorFromAnsiIndex(L);break;case 50331648:const k=r.AttributeData.toColorRGB(L);R=p.channels.toColor(k[0],k[1],k[2]);break;default:R=A?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return R}_getForegroundColor(C,L,A,E,R,k,$,N,P,j){const D=this._getMinimumContrastColor(C,L,A,E,R,k,$,P,N,j);if(D)return D;let O;switch(R){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&k<8&&(k+=8),O=this._getColorFromAnsiIndex(k);break;case 50331648:const T=r.AttributeData.toColorRGB(k);O=p.channels.toColor(T[0],T[1],T[2]);break;default:O=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=p.color.opaque(O)),N&&(O=p.color.multiplyOpacity(O,d.DIM_OPACITY)),O}_resolveBackgroundRgba(C,L,A){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,A,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,A,E,R,k,$,N,P,j){if(this._config.minimumContrastRatio===1||j)return;const D=this._getContrastCache(P),O=D.getColor(C,E);if(O!==void 0)return O||void 0;const T=this._resolveBackgroundRgba(L,A,$),B=this._resolveForegroundRgba(R,k,$,N),q=p.rgba.ensureContrastRatio(T,B,this._config.minimumContrastRatio/(P?2:1));if(!q)return void D.setColor(C,E,null);const K=p.channels.toColor(q>>24&255,q>>16&255,q>>8&255);return D.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,A,E,R=!1){const k=typeof C=="number"?String.fromCharCode(C):C,$=Math.min(this._config.deviceCellWidth*Math.max(k.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const N=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<N&&(this._tmpCanvas.height=N),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return c;const P=!!this._workAttributeData.isBold(),j=!!this._workAttributeData.isInverse(),D=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),B=!!this._workAttributeData.isStrikethrough(),q=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),oe=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(j){const ue=K;K=ce,ce=ue;const ge=oe;oe=W,W=ge}const z=this._getBackgroundColor(W,ce,j,D);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=P?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=k.length===1&&(0,a.isPowerlineGlyph)(k.charCodeAt(0)),fe=k.length===1&&(0,a.isRestrictedPowerlineGlyph)(k.charCodeAt(0)),Me=this._getForegroundColor(L,W,ce,A,oe,K,j,D,P,(0,a.treatGlyphAsBackgroundColor)(k.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,k,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,be=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ue%2==1?.5:0;if(this._tmpCtx.lineWidth=ue,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const ze=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(R?2*ue:0),_t=Re+ue,Qe=Re+2*ue;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=ze+Ie*this._config.deviceCellWidth,Le=ze+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=ue<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-ue/2)-ge,vt=ue<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+ue/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=ue?2*ue-it:ue-it;it>=ue||Zt===0?(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+ue,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,ue,it);break;case 5:const tr=.6,ir=.3,jt=Le-Ae,si=Math.floor(tr*jt),ri=Math.floor(ir*jt),Jt=jt-si-ri;this._tmpCtx.setLineDash([si,ri,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&k!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(k);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(ze,Re-Math.ceil(ue/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(ue/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(k,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(q){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ue%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight),k==="_"&&!this._config.allowTransparency){let ue=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,be);if(ue)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight-ge),ue=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,be),ue);ge++);}if(B){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(ue){for(let ge=0;ge<ue.data.length;ge+=4)if(ue.data[ge+3]>0)return!1;return!0})(ft):v(ft,z,Me,be),Ot)return c;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,$,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const ue=this._createNewPage();pe=ue,me=ue.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const ue of this._activePages)Se.size.y<=ue.currentRow.height&&(pe=ue,me=ue.currentRow);for(let ue=this._activePages.length-1;ue>=0;ue--)for(const ge of this._activePages[ue].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[ue],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let ue=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const ze of this._activePages)if(ze.currentRow.y+ze.currentRow.height+Se.size.y<ze.canvas.height){ge=ze;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)ue=!0;else{const ze=this._createNewPage();pe=ze,me=ze.currentRow,me.height=Se.size.y,ue=!0}}ue||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,A,E,R,k){L.top=0;const $=E?this._config.deviceCellHeight:this._tmpCanvas.height,N=E?this._config.deviceCellWidth:A;let P=!1;for(let j=0;j<$;j++){for(let D=0;D<N;D++){const O=j*this._tmpCanvas.width*4+4*D+3;if(C.data[O]!==0){L.top=j,P=!0;break}}if(P)break}L.left=0,P=!1;for(let j=0;j<k+N;j++){for(let D=0;D<$;D++){const O=D*this._tmpCanvas.width*4+4*j+3;if(C.data[O]!==0){L.left=j,P=!0;break}}if(P)break}L.right=N,P=!1;for(let j=k+N-1;j>=k;j--){for(let D=0;D<$;D++){const O=D*this._tmpCanvas.width*4+4*j+3;if(C.data[O]!==0){L.right=j,P=!0;break}}if(P)break}L.bottom=$,P=!1;for(let j=$-1;j>=0;j--){for(let D=0;D<N;D++){const O=j*this._tmpCanvas.width*4+4*D+3;if(C.data[O]!==0){L.bottom=j,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+k+(E||R?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+k+(E||R?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const E of A)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=y(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(m,C,L,A){const E=C.rgba>>>24,R=C.rgba>>>16&255,k=C.rgba>>>8&255,$=L.rgba>>>24,N=L.rgba>>>16&255,P=L.rgba>>>8&255,j=Math.floor((Math.abs(E-$)+Math.abs(R-N)+Math.abs(k-P))/12);let D=!0;for(let O=0;O<m.data.length;O+=4)m.data[O]===E&&m.data[O+1]===R&&m.data[O+2]===k||A&&Math.abs(m.data[O]-E)+Math.abs(m.data[O+1]-R)+Math.abs(m.data[O+2]-k)<j?m.data[O+3]=0:D=!1;return D}function y(m,C,L){const A=m.createElement("canvas");return A.width=C,A.height=L,A}},160:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,A=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=A+Math.round((m-A)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E>0||R>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),R-=Math.max(0,Math.ceil(.1*R)),k-=Math.max(0,Math.ceil(.1*k)),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E<255||R<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),R=Math.min(255,R+Math.ceil(.1*(255-R))),k=Math.min(255,k+Math.ceil(.1*(255-k))),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,A=v>>24&255,E=v>>16&255,R=v>>8&255;return u=A+Math.round((m-A)*a),d=E+Math.round((C-E)*a),_=R+Math.round((L-R)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const R=S(v,y,m),k=c(C,o.relativeLuminance(R>>8));if(k<m){const $=x(v,y,m);return k>c(C,o.relativeLuminance($>>8))?R:$}return R}const A=x(v,y,m),E=c(C,o.relativeLuminance(A>>8));if(E<m){const R=S(v,y,m);return E>c(C,o.relativeLuminance(R>>8))?A:R}return A}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},345:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},399:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},855:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},776:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),p=u(97),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},726:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},U={};function J(F){var n=U[F];if(n!==void 0)return n.exports;var u=U[F]={exports:{}};return V[F].call(u.exports,u,u.exports,J),u.exports}var se={};return(()=>{var F=se;Object.defineProperty(F,"__esModule",{value:!0}),F.WebglAddon=void 0;const n=J(345),u=J(859),d=J(399),_=J(666),a=J(776);class p extends u.Disposable{constructor(b){if(d.isSafari&&(0,d.getSafariVersion)()<16){const o={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",o))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=b,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(b){const o=b._core;if(!b.element)return void this.register(o.onWillOpen((()=>this.activate(b))));this._terminal=b;const r=o.coreService,h=o.optionsService,c=o,l=c._renderService,S=c._characterJoinerService,x=c._charSizeService,v=c._coreBrowserService,y=c._decorationService,m=c._logService,C=c._themeService;(0,a.setTraceLogger)(m),this._renderer=this.register(new _.WebglRenderer(b,S,x,v,r,y,h,C,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),l.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(b.cols,b.rows)})))}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}F.WebglAddon=p})(),se})()))})(zo)),zo.exports}var ag=ng(),No={exports:{}},Jd;function lg(){return Jd||(Jd=1,(function(I,G){(function(V,U){I.exports=U()})(self,(()=>(()=>{var V={903:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(274),_=u(627),a=u(237),p=u(860),w=u(374),b=u(296),o=u(345),r=u(859),h=u(399),c=u(855);class l extends r.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var v;return(v=this._charAtlas)==null?void 0:v.pages[0].canvas}constructor(v,y,m,C,L,A,E,R,k,$){super(),this._terminal=v,this._container=y,this._alpha=L,this._themeService=A,this._bufferService=E,this._optionsService=R,this._decorationService=k,this._coreBrowserService=$,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,b.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new r.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${m}-layer`),this._canvas.style.zIndex=C.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((N=>{this._refreshCharAtlas(N),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,r.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,w.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(v,y){}handleSelectionChanged(v,y,m=!1){this._selectionModel.update(this._terminal._core,v,y,m)}_setTransparency(v){if(v===this._alpha)return;const y=this._canvas;this._alpha=v,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,y),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(v){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,_.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,v,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,o.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let y=0;y<this._charAtlas.pages.length;y++)this._bitmapGenerator[y]=new S(this._charAtlas.pages[y].canvas)}}resize(v){this._deviceCellWidth=v.device.cell.width,this._deviceCellHeight=v.device.cell.height,this._deviceCharWidth=v.device.char.width,this._deviceCharHeight=v.device.char.height,this._deviceCharLeft=v.device.char.left,this._deviceCharTop=v.device.char.top,this._canvas.width=v.device.canvas.width,this._canvas.height=v.device.canvas.height,this._canvas.style.width=`${v.css.canvas.width}px`,this._canvas.style.height=`${v.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var v;(v=this._charAtlas)==null||v.clearTexture()}_fillCells(v,y,m,C){this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(v,y,m=1){const C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(v*this._deviceCellWidth,(y+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(v,y,m=1,C=0){this._ctx.fillRect(v*this._deviceCellWidth,(y+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C;for(let L=0;L<m;L++){const A=(v+L)*this._deviceCellWidth,E=(v+L+.5)*this._deviceCellWidth,R=(v+L+1)*this._deviceCellWidth,k=(y+1)*this._deviceCellHeight-C-1,$=k-C,N=k+C;this._ctx.moveTo(A,k),this._ctx.bezierCurveTo(A,$,E,$,E,k),this._ctx.bezierCurveTo(E,N,R,N,R,k)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([2*C,C]);const L=v*this._deviceCellWidth,A=(y+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,A);for(let E=0;E<m;E++){const R=(v+m+E)*this._deviceCellWidth;this._ctx.lineTo(R,A)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([4*C,3*C]);const L=v*this._deviceCellWidth,A=(v+m)*this._deviceCellWidth,E=(y+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,E),this._ctx.lineTo(A,E),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(v,y,m){this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,this._coreBrowserService.dpr*m,this._deviceCellHeight)}_strokeRectAtCell(v,y,m,C){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(v*this._deviceCellWidth+L/2,y*this._deviceCellHeight+L/2,m*this._deviceCellWidth-L,C*this._deviceCellHeight-L)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,y,m,C){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(v,y,m){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(m);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,p.tryDrawCustomChar)(this._ctx,v.getChars(),y*this._deviceCellWidth,m*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(v.getChars(),y*this._deviceCellWidth+this._deviceCharLeft,m*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(v,y,m){var k,$,N,P;const C=v.getChars(),L=v.getCode(),A=v.getWidth();if(this._cellColorResolver.resolve(v,y,this._bufferService.buffer.ydisp+m,this._deviceCellWidth),!this._charAtlas)return;let E;if(E=C&&C.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(C,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(v.getCode()||c.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!E.size.x||!E.size.y)return;this._ctx.save(),this._clipRow(m),this._bitmapGenerator[E.texturePage]&&this._charAtlas.pages[E.texturePage].canvas!==this._bitmapGenerator[E.texturePage].canvas&&(($=(k=this._bitmapGenerator[E.texturePage])==null?void 0:k.bitmap)==null||$.close(),delete this._bitmapGenerator[E.texturePage]),this._charAtlas.pages[E.texturePage].version!==((N=this._bitmapGenerator[E.texturePage])==null?void 0:N.version)&&(this._bitmapGenerator[E.texturePage]||(this._bitmapGenerator[E.texturePage]=new S(this._charAtlas.pages[E.texturePage].canvas)),this._bitmapGenerator[E.texturePage].refresh(),this._bitmapGenerator[E.texturePage].version=this._charAtlas.pages[E.texturePage].version);let R=E.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,w.allowRescaling)(L,A,E.size.x,this._deviceCellWidth)&&(R=this._deviceCellWidth-1),this._ctx.drawImage(((P=this._bitmapGenerator[E.texturePage])==null?void 0:P.bitmap)||this._charAtlas.pages[E.texturePage].canvas,E.texturePosition.x,E.texturePosition.y,E.size.x,E.size.y,y*this._deviceCellWidth+this._deviceCharLeft-E.offset.x,m*this._deviceCellHeight+this._deviceCharTop-E.offset.y,R,E.size.y),this._ctx.restore()}_clipRow(v){this._ctx.beginPath(),this._ctx.rect(0,v*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,y){return`${y?"italic":""} ${v?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}n.BaseRenderLayer=l;class S{get bitmap(){return this._bitmap}constructor(v){this.canvas=v,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var v;(v=this._bitmap)==null||v.close(),this._bitmap=void 0,h.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var v;this._state===0&&((v=this._bitmap)==null||v.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((y=>{this._state===2?this.refresh():this._bitmap=y,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasRenderer=void 0;const d=u(627),_=u(56),a=u(374),p=u(345),w=u(859),b=u(873),o=u(43),r=u(630),h=u(744);class c extends w.Disposable{constructor(S,x,v,y,m,C,L,A,E,R,k){super(),this._terminal=S,this._screenElement=x,this._bufferService=y,this._charSizeService=m,this._optionsService=C,this._coreBrowserService=E,this._themeService=k,this._observerDisposable=this.register(new w.MutableDisposable),this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const $=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new h.TextRenderLayer(this._terminal,this._screenElement,0,$,this._bufferService,this._optionsService,L,R,this._coreBrowserService,k),new r.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,R,this._optionsService,k),new o.LinkRenderLayer(this._terminal,this._screenElement,2,v,this._bufferService,this._optionsService,R,this._coreBrowserService,k),new b.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,A,this._coreBrowserService,R,k)];for(const N of this._renderLayers)(0,p.forwardEvent)(N.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((N,P)=>this._setCanvasDevicePixelDimensions(N,P))),this.register(this._coreBrowserService.onWindowChange((N=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,N,((P,j)=>this._setCanvasDevicePixelDimensions(P,j)))}))),this.register((0,w.toDisposable)((()=>{for(const N of this._renderLayers)N.dispose();(0,d.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(S,x){this._updateDimensions();for(const v of this._renderLayers)v.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((S=>S.handleBlur()))}handleFocus(){this._runOperation((S=>S.handleFocus()))}handleSelectionChanged(S,x,v=!1){this._runOperation((y=>y.handleSelectionChanged(S,x,v))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((S=>S.handleCursorMove()))}clear(){this._runOperation((S=>S.reset()))}_runOperation(S){for(const x of this._renderLayers)S(x)}renderRows(S,x){for(const v of this._renderLayers)v.handleGridChanged(S,x)}clearTextureAtlas(){for(const S of this._renderLayers)S.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*S),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/S),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(S,x){this.dimensions.device.canvas.height=x,this.dimensions.device.canvas.width=S;for(const v of this._renderLayers)v.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}n.CanvasRenderer=c},873:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorRenderLayer=void 0;const d=u(457),_=u(859),a=u(399),p=u(782),w=u(903);class b extends w.BaseRenderLayer{constructor(r,h,c,l,S,x,v,y,m,C){super(r,h,"cursor",c,!0,C,S,x,m,y),this._onRequestRedraw=l,this._coreService=v,this._cursorBlinkStateManager=this.register(new _.MutableDisposable),this._cell=new p.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(r){super.resize(r),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var r;this._clearCursor(),(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var r;(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var r;(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var r;(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}handleGridChanged(r,h){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(r){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const h=this._bufferService.buffer.ybase+this._bufferService.buffer.y,c=h-this._bufferService.buffer.ydisp;if(c<0||c>=this._bufferService.rows)return void this._clearCursor();const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(h).loadCell(l,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;return x&&x!=="none"&&this._cursorRenderers[x](l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===l&&this._state.y===c&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(a.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(r,h,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(r,h,c.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(c,r,h),this._ctx.restore()}_renderUnderlineCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(r,h),this._ctx.restore()}_renderOutlineCursor(r,h,c){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(r,h,c.getWidth(),1),this._ctx.restore()}}n.CursorRenderLayer=b},574:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GridCache=void 0,n.GridCache=class{constructor(){this.cache=[]}resize(u,d){for(let _=0;_<u;_++){this.cache.length<=_&&this.cache.push([]);for(let a=this.cache[_].length;a<d;a++)this.cache[_].push(void 0);this.cache[_].length=d}this.cache.length=u}clear(){for(let u=0;u<this.cache.length;u++)for(let d=0;d<this.cache[u].length;d++)this.cache[u][d]=void 0}}},43:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(903);class p extends a.BaseRenderLayer{constructor(b,o,r,h,c,l,S,x,v){super(b,o,"link",r,!0,v,c,l,S,x),this.register(h.onShowLinkUnderline((y=>this._handleShowLinkUnderline(y)))),this.register(h.onHideLinkUnderline((y=>this._handleHideLinkUnderline(y))))}resize(b){super.resize(b),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg&&(0,d.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let o=b.y1+1;o<b.y2;o++)this._fillBottomLineAtCells(0,o,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=p},630:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionRenderLayer=void 0;const d=u(903);class _ extends d.BaseRenderLayer{constructor(p,w,b,o,r,h,c,l){super(p,w,"selection",b,!0,l,o,c,h,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(p){super.resize(p),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(p,w,b){super.handleSelectionChanged(p,w,b),this._redrawSelection(p,w,b)}_redrawSelection(p,w,b){if(!this._didStateChange(p,w,b,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!p||!w)return void this._clearState();const o=p[1]-this._bufferService.buffer.ydisp,r=w[1]-this._bufferService.buffer.ydisp,h=Math.max(o,0),c=Math.min(r,this._bufferService.rows-1);if(h>=this._bufferService.rows||c<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,b){const l=p[0],S=w[0]-l,x=c-h+1;this._fillCells(l,h,S,x)}else{const l=o===h?p[0]:0,S=h===r?w[0]:this._bufferService.cols;this._fillCells(l,h,S-l,1);const x=Math.max(c-h-1,0);if(this._fillCells(0,h+1,this._bufferService.cols,x),h!==c){const v=r===c?w[0]:this._bufferService.cols;this._fillCells(0,c,v,1)}}this._state.start=[p[0],p[1]],this._state.end=[w[0],w[1]],this._state.columnSelectMode=b,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(p,w,b,o){return!this._areCoordinatesEqual(p,this._state.start)||!this._areCoordinatesEqual(w,this._state.end)||b!==this._state.columnSelectMode||o!==this._state.ydisp}_areCoordinatesEqual(p,w){return!(!p||!w)&&p[0]===w[0]&&p[1]===w[1]}}n.SelectionRenderLayer=_},744:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextRenderLayer=void 0;const d=u(577),_=u(147),a=u(782),p=u(855),w=u(903),b=u(574);class o extends w.BaseRenderLayer{constructor(h,c,l,S,x,v,y,m,C,L){super(h,c,"text",l,S,L,x,v,m,C),this._characterJoinerService=y,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new b.GridCache,this.register(v.onSpecificOptionChange("allowTransparency",(A=>this._setTransparency(A))))}resize(h){super.resize(h);const c=this._getFont(!1,!1);this._characterWidth===h.device.char.width&&this._characterFont===c||(this._characterWidth=h.device.char.width,this._characterFont=c,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(h,c,l){for(let S=h;S<=c;S++){const x=S+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(x),y=this._characterJoinerService.getJoinedCharacters(x);for(let m=0;m<this._bufferService.cols;m++){v.loadCell(m,this._workCell);let C=this._workCell,L=!1,A=m;if(C.getWidth()!==0){if(y.length>0&&m===y[0][0]){L=!0;const E=y.shift();C=new d.JoinedCellData(this._workCell,v.translateToString(!0,E[0],E[1]),E[1]-E[0]),A=E[1]-1}!L&&this._isOverlapping(C)&&A<v.length-1&&v.getCodePoint(A+1)===p.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),l(C,m,S),m=A}}}}_drawBackground(h,c){const l=this._ctx,S=this._bufferService.cols;let x=0,v=0,y=null;l.save(),this._forEachCell(h,c,((m,C,L)=>{let A=null;m.isInverse()?A=m.isFgDefault()?this._themeService.colors.foreground.css:m.isFgRGB()?`rgb(${_.AttributeData.toColorRGB(m.getFgColor()).join(",")})`:this._themeService.colors.ansi[m.getFgColor()].css:m.isBgRGB()?A=`rgb(${_.AttributeData.toColorRGB(m.getBgColor()).join(",")})`:m.isBgPalette()&&(A=this._themeService.colors.ansi[m.getBgColor()].css);let E=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+L,void 0,(R=>{R.options.layer!=="top"&&E||(R.backgroundColorRGB&&(A=R.backgroundColorRGB.css),E=R.options.layer==="top")})),y===null&&(x=C,v=L),L!==v?(l.fillStyle=y||"",this._fillCells(x,v,S-x,1),x=C,v=L):y!==A&&(l.fillStyle=y||"",this._fillCells(x,v,C-x,1),x=C,v=L),y=A})),y!==null&&(l.fillStyle=y,this._fillCells(x,v,S-x,1)),l.restore()}_drawForeground(h,c){this._forEachCell(h,c,((l,S,x)=>this._drawChars(l,S,x)))}handleGridChanged(h,c){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,h,this._bufferService.cols,c-h+1),this._drawBackground(h,c),this._drawForeground(h,c))}_isOverlapping(h){if(h.getWidth()!==1||h.getCode()<256)return!1;const c=h.getChars();if(this._characterOverlapCache.hasOwnProperty(c))return this._characterOverlapCache[c];this._ctx.save(),this._ctx.font=this._characterFont;const l=Math.floor(this._ctx.measureText(c).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[c]=l,l}}n.TextRenderLayer=o},274:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let p,w=0,b=0,o=!1,r=!1,h=!1,c=0;n.CellColorResolver=class{constructor(l,S,x,v,y,m){this._terminal=l,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=y,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(l,S,x,v){if(this.result.bg=l.bg,this.result.fg=l.fg,this.result.ext=268435456&l.bg?l.extended.ext:0,b=0,w=0,r=!1,o=!1,h=!1,p=this._themeService.colors,c=0,l.getCode()!==d.NULL_CELL_CODE&&l.extended.underlineStyle===4){const y=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));c=S*v%(2*Math.round(y))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,p.selectionForeground&&(w=p.selectionForeground.rgba>>8&16777215,o=!0),(0,a.treatGlyphAsBackgroundColor)(l.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}w=_.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(b=h?-16777216&l.bg&-134217729|b|50331648:-16777216&l.bg|b|50331648),o&&(w=-16777216&l.fg&-67108865|w|50331648),67108864&this.result.fg&&(r&&!o&&(w=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!r&&o&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),p=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=o?w:this.result.fg,this.result.ext&=536870911,this.result.ext|=c<<29&3758096384}}},627:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(p,w,b,o,r,h,c,l){const S=(0,_.generateConfig)(o,r,h,c,w,b,l);for(let y=0;y<a.length;y++){const m=a[y],C=m.ownedBy.indexOf(p);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(y,1)):m.ownedBy.splice(C,1);break}}for(let y=0;y<a.length;y++){const m=a[y];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(p),m.atlas}const x=p._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(p){for(let w=0;w<a.length;w++){const b=a[w].ownedBy.indexOf(p);if(b!==-1){a[w].ownedBy.length===1?(a[w].atlas.dispose(),a.splice(w,1)):a[w].ownedBy.splice(b,1);break}}}},197:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,p,w,b,o,r){const h={foreground:o.foreground,background:o.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:w,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let p=0;p<_.colors.ansi.length;p++)if(_.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(o,r,h,c,l,S,x,v){const y=n.blockElementDefinitions[r];if(y)return(function(A,E,R,k,$,N){for(let P=0;P<E.length;P++){const j=E[P],D=$/8,O=N/8;A.fillRect(R+j.x*D,k+j.y*O,j.w*D,j.h*O)}})(o,y,h,c,l,S),!0;const m=_[r];if(m)return(function(A,E,R,k,$,N){let P=a.get(E);P||(P=new Map,a.set(E,P));const j=A.fillStyle;if(typeof j!="string")throw new Error(`Unexpected fillStyle type "${j}"`);let D=P.get(j);if(!D){const O=E[0].length,T=E.length,B=A.canvas.ownerDocument.createElement("canvas");B.width=O,B.height=T;const q=(0,d.throwIfFalsy)(B.getContext("2d")),K=new ImageData(O,T);let oe,ce,W,z;if(j.startsWith("#"))oe=parseInt(j.slice(1,3),16),ce=parseInt(j.slice(3,5),16),W=parseInt(j.slice(5,7),16),z=j.length>7&&parseInt(j.slice(7,9),16)||1;else{if(!j.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${j}" when drawing pattern glyph`);[oe,ce,W,z]=j.substring(5,j.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<T;re++)for(let ee=0;ee<O;ee++)K.data[4*(re*O+ee)]=oe,K.data[4*(re*O+ee)+1]=ce,K.data[4*(re*O+ee)+2]=W,K.data[4*(re*O+ee)+3]=E[re][ee]*(255*z);q.putImageData(K,0,0),D=(0,d.throwIfFalsy)(A.createPattern(B,null)),P.set(j,D)}A.fillStyle=D,A.fillRect(R,k,$,N)})(o,m,h,c,l,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(A,E,R,k,$,N,P){A.strokeStyle=A.fillStyle;for(const[j,D]of Object.entries(E)){let O;A.beginPath(),A.lineWidth=P*Number.parseInt(j),O=typeof D=="function"?D(.15,.15/N*$):D;for(const T of O.split(" ")){const B=T[0],q=w[B];if(!q){console.error(`Could not find drawing instructions for "${B}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&q(A,b(K,$,N,R,k,!0,P))}A.stroke(),A.closePath()}})(o,C,h,c,l,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(A,E,R,k,$,N,P,j){const D=new Path2D;D.rect(R,k,$,N),A.clip(D),A.beginPath();const O=P/12;A.lineWidth=j*O;for(const T of E.d.split(" ")){const B=T[0],q=w[B];if(!q){console.error(`Could not find drawing instructions for "${B}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&q(A,b(K,$,N,R,k,!1,j,(E.leftPadding??0)*(O/2),(E.rightPadding??0)*(O/2)))}E.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()})(o,L,h,c,l,S,x,v),!0)};const a=new Map;function p(o,r,h=0){return Math.max(Math.min(o,r),h)}const w={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function b(o,r,h,c,l,S,x,v=0,y=0){const m=o.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-y*x,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,r,0)),m[C]+=c+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,h,0)),m[C]+=l;return m}},56:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,p){let w=new a.ResizeObserver((b=>{const o=b.find((c=>c.target===_));if(!o)return;if(!("devicePixelContentBoxSize"in o))return w==null||w.disconnect(),void(w=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,h=o.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&p(r,h)}));try{w.observe(_,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)((()=>w==null?void 0:w.disconnect()))}},374:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),p=u(160),w=u(345),b=u(485),o=u(385),r=u(147),h=u(855),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let l;class S{get pages(){return this._pages}constructor(C,L,A){this._document=C,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new w.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new w.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=y(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new o.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const A=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,A)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(S.maxTextureSize||4096))).sort(((P,j)=>j.canvas.width!==P.canvas.width?j.canvas.width-P.canvas.width:j.percentageUsed-P.percentageUsed));let A=-1,E=0;for(let P=0;P<L.length;P++)if(L[P].canvas.width!==E)A=P,E=L[P].canvas.width;else if(P-A==3)break;const R=L.slice(A,A+4),k=R.map((P=>P.glyphs[0].texturePage)).sort(((P,j)=>P>j?1:-1)),$=this.pages.length-R.length,N=this._mergePages(R,$);N.version++;for(let P=k.length-1;P>=0;P--)this._deletePage(k[P]);this.pages.push(N),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(N.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const A=2*C[0].canvas.width,E=new x(this._document,A,C);for(const[R,k]of C.entries()){const $=R*k.canvas.width%A,N=Math.floor(R/2)*k.canvas.height;E.ctx.drawImage(k.canvas,$,N);for(const j of k.glyphs)j.texturePage=L,j.sizeClipSpace.x=j.size.x/A,j.sizeClipSpace.y=j.size.y/A,j.texturePosition.x+=$,j.texturePosition.y+=N,j.texturePositionClipSpace.x=j.texturePosition.x/A,j.texturePositionClipSpace.y=j.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(k.canvas);const P=this._activePages.indexOf(k);P!==-1&&this._activePages.splice(P,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const A=this._pages[L];for(const E of A.glyphs)E.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(C,L,A,E,R){return this._getFromCacheMap(this._cacheMapCombined,C,L,A,E,R)}getRasterizedGlyph(C,L,A,E,R){return this._getFromCacheMap(this._cacheMap,C,L,A,E,R)}_getFromCacheMap(C,L,A,E,R,k=!1){return l=C.get(L,A,E,R),l||(l=this._drawToCache(L,A,E,R,k),C.set(L,A,E,R,l)),l}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,A,E){if(this._config.allowTransparency)return p.NULL_COLOR;let R;switch(C){case 16777216:case 33554432:R=this._getColorFromAnsiIndex(L);break;case 50331648:const k=r.AttributeData.toColorRGB(L);R=p.channels.toColor(k[0],k[1],k[2]);break;default:R=A?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return R}_getForegroundColor(C,L,A,E,R,k,$,N,P,j){const D=this._getMinimumContrastColor(C,L,A,E,R,k,$,P,N,j);if(D)return D;let O;switch(R){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&k<8&&(k+=8),O=this._getColorFromAnsiIndex(k);break;case 50331648:const T=r.AttributeData.toColorRGB(k);O=p.channels.toColor(T[0],T[1],T[2]);break;default:O=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=p.color.opaque(O)),N&&(O=p.color.multiplyOpacity(O,d.DIM_OPACITY)),O}_resolveBackgroundRgba(C,L,A){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,A,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,A,E,R,k,$,N,P,j){if(this._config.minimumContrastRatio===1||j)return;const D=this._getContrastCache(P),O=D.getColor(C,E);if(O!==void 0)return O||void 0;const T=this._resolveBackgroundRgba(L,A,$),B=this._resolveForegroundRgba(R,k,$,N),q=p.rgba.ensureContrastRatio(T,B,this._config.minimumContrastRatio/(P?2:1));if(!q)return void D.setColor(C,E,null);const K=p.channels.toColor(q>>24&255,q>>16&255,q>>8&255);return D.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,A,E,R=!1){const k=typeof C=="number"?String.fromCharCode(C):C,$=Math.min(this._config.deviceCellWidth*Math.max(k.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const N=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<N&&(this._tmpCanvas.height=N),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return c;const P=!!this._workAttributeData.isBold(),j=!!this._workAttributeData.isInverse(),D=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),B=!!this._workAttributeData.isStrikethrough(),q=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),oe=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(j){const ue=K;K=ce,ce=ue;const ge=oe;oe=W,W=ge}const z=this._getBackgroundColor(W,ce,j,D);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=P?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=k.length===1&&(0,a.isPowerlineGlyph)(k.charCodeAt(0)),fe=k.length===1&&(0,a.isRestrictedPowerlineGlyph)(k.charCodeAt(0)),Me=this._getForegroundColor(L,W,ce,A,oe,K,j,D,P,(0,a.treatGlyphAsBackgroundColor)(k.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,k,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,be=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ue%2==1?.5:0;if(this._tmpCtx.lineWidth=ue,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const ze=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(R?2*ue:0),_t=Re+ue,Qe=Re+2*ue;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=ze+Ie*this._config.deviceCellWidth,Le=ze+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=ue<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-ue/2)-ge,vt=ue<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+ue/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=ue?2*ue-it:ue-it;it>=ue||Zt===0?(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+ue,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,ue,it);break;case 5:const tr=.6,ir=.3,jt=Le-Ae,si=Math.floor(tr*jt),ri=Math.floor(ir*jt),Jt=jt-si-ri;this._tmpCtx.setLineDash([si,ri,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&k!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(k);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(ze,Re-Math.ceil(ue/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(ue/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(k,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(q){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ue%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight),k==="_"&&!this._config.allowTransparency){let ue=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,be);if(ue)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight-ge),ue=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,be),ue);ge++);}if(B){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(ue){for(let ge=0;ge<ue.data.length;ge+=4)if(ue.data[ge+3]>0)return!1;return!0})(ft):v(ft,z,Me,be),Ot)return c;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,$,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const ue=this._createNewPage();pe=ue,me=ue.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const ue of this._activePages)Se.size.y<=ue.currentRow.height&&(pe=ue,me=ue.currentRow);for(let ue=this._activePages.length-1;ue>=0;ue--)for(const ge of this._activePages[ue].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[ue],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let ue=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const ze of this._activePages)if(ze.currentRow.y+ze.currentRow.height+Se.size.y<ze.canvas.height){ge=ze;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)ue=!0;else{const ze=this._createNewPage();pe=ze,me=ze.currentRow,me.height=Se.size.y,ue=!0}}ue||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,A,E,R,k){L.top=0;const $=E?this._config.deviceCellHeight:this._tmpCanvas.height,N=E?this._config.deviceCellWidth:A;let P=!1;for(let j=0;j<$;j++){for(let D=0;D<N;D++){const O=j*this._tmpCanvas.width*4+4*D+3;if(C.data[O]!==0){L.top=j,P=!0;break}}if(P)break}L.left=0,P=!1;for(let j=0;j<k+N;j++){for(let D=0;D<$;D++){const O=D*this._tmpCanvas.width*4+4*j+3;if(C.data[O]!==0){L.left=j,P=!0;break}}if(P)break}L.right=N,P=!1;for(let j=k+N-1;j>=k;j--){for(let D=0;D<$;D++){const O=D*this._tmpCanvas.width*4+4*j+3;if(C.data[O]!==0){L.right=j,P=!0;break}}if(P)break}L.bottom=$,P=!1;for(let j=$-1;j>=0;j--){for(let D=0;D<N;D++){const O=j*this._tmpCanvas.width*4+4*D+3;if(C.data[O]!==0){L.bottom=j,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+k+(E||R?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+k+(E||R?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const E of A)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=y(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(m,C,L,A){const E=C.rgba>>>24,R=C.rgba>>>16&255,k=C.rgba>>>8&255,$=L.rgba>>>24,N=L.rgba>>>16&255,P=L.rgba>>>8&255,j=Math.floor((Math.abs(E-$)+Math.abs(R-N)+Math.abs(k-P))/12);let D=!0;for(let O=0;O<m.data.length;O+=4)m.data[O]===E&&m.data[O+1]===R&&m.data[O+2]===k||A&&Math.abs(m.data[O]-E)+Math.abs(m.data[O+1]-R)+Math.abs(m.data[O+2]-k)<j?m.data[O+3]=0:D=!1;return D}function y(m,C,L){const A=m.createElement("canvas");return A.width=C,A.height=L,A}},577:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(147),p=u(855),w=u(782),b=u(97);class o extends a.AttributeData{constructor(c,l,S){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=l,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=o;let r=n.CharacterJoinerService=class df{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(c){const l={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(l),l.id}deregister(c){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===c)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(c);if(!l||l.length===0)return[];const S=[],x=l.translateToString(!0);let v=0,y=0,m=0,C=l.getFg(0),L=l.getBg(0);for(let A=0;A<l.getTrimmedLength();A++)if(l.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(A-v>1){const E=this._getJoinedRanges(x,m,y,l,v);for(let R=0;R<E.length;R++)S.push(E[R])}v=A,m=y,C=this._workCell.fg,L=this._workCell.bg}y+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const A=this._getJoinedRanges(x,m,y,l,v);for(let E=0;E<A.length;E++)S.push(A[E])}return S}_getJoinedRanges(c,l,S,x,v){const y=c.substring(l,S);let m=[];try{m=this._characterJoiners[0].handler(y)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(y);for(let A=0;A<L.length;A++)df._mergeRanges(m,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(c,l,S){let x=0,v=!1,y=0,m=c[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=l.getWidth(C),A=l.getString(C).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=y&&(m[0]=C,v=!0),m[1]<=y){if(m[1]=C,m=c[++x],!m)break;m[0]<=y?(m[0]=C,v=!0):v=!1}y+=A}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(c,l){let S=!1;for(let x=0;x<c.length;x++){const v=c[x];if(S){if(l[1]<=v[0])return c[x-1][1]=l[1],c;if(l[1]<=v[1])return c[x-1][1]=Math.max(l[1],v[1]),c.splice(x,1),c;c.splice(x,1),x--}else{if(l[1]<=v[0])return c.splice(x,0,l),c;if(l[1]<=v[1])return v[0]=Math.min(l[0],v[0]),c;l[0]<v[1]&&(v[0]=Math.min(l[0],v[0]),S=!0)}}return S?c[c.length-1][1]=l[1]:c.push(l),c}};n.CharacterJoinerService=r=d([_(0,b.IBufferService)],r)},160:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,A=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=A+Math.round((m-A)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E>0||R>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),R-=Math.max(0,Math.ceil(.1*R)),k-=Math.max(0,Math.ceil(.1*k)),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=y>>24&255,R=y>>16&255,k=y>>8&255,$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));for(;$<m&&(E<255||R<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),R=Math.min(255,R+Math.ceil(.1*(255-R))),k=Math.min(255,k+Math.ceil(.1*(255-k))),$=c(o.relativeLuminance2(E,R,k),o.relativeLuminance2(C,L,A));return(E<<24|R<<16|k<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,A=v>>24&255,E=v>>16&255,R=v>>8&255;return u=A+Math.round((m-A)*a),d=E+Math.round((C-E)*a),_=R+Math.round((L-R)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const R=S(v,y,m),k=c(C,o.relativeLuminance(R>>8));if(k<m){const $=x(v,y,m);return k>c(C,o.relativeLuminance($>>8))?R:$}return R}const A=x(v,y,m),E=c(C,o.relativeLuminance(A>>8));if(E<m){const R=S(v,y,m);return E>c(C,o.relativeLuminance(R>>8))?A:R}return A}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},345:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},399:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},855:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},776:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),p=u(97),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},726:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},U={};function J(F){var n=U[F];if(n!==void 0)return n.exports;var u=U[F]={exports:{}};return V[F].call(u.exports,u,u.exports,J),u.exports}var se={};return(()=>{var F=se;Object.defineProperty(F,"__esModule",{value:!0}),F.CanvasAddon=void 0;const n=J(345),u=J(859),d=J(776),_=J(949);class a extends u.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}activate(w){const b=w._core;if(!w.element)return void this.register(b.onWillOpen((()=>this.activate(w))));this._terminal=w;const o=b.coreService,r=b.optionsService,h=b.screenElement,c=b.linkifier,l=b,S=l._bufferService,x=l._renderService,v=l._characterJoinerService,y=l._charSizeService,m=l._coreBrowserService,C=l._decorationService,L=l._logService,A=l._themeService;(0,d.setTraceLogger)(L),this._renderer=new _.CanvasRenderer(w,h,c,S,y,r,v,o,m,C,A),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),x.setRenderer(this._renderer),x.handleResize(S.cols,S.rows),this.register((0,u.toDisposable)((()=>{var E;x.setRenderer(this._terminal._core._createRenderer()),x.handleResize(w.cols,w.rows),(E=this._renderer)==null||E.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}F.CanvasAddon=a})(),se})()))})(No)),No.exports}var og=lg();/**
114
+ }`)),this.register((0,_.toDisposable)((()=>E.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),O=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(O)))),E.bindBuffer(E.ARRAY_BUFFER,O),E.bufferData(E.ARRAY_BUFFER,D,E.STATIC_DRAW),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const $=new Uint8Array([0,1,2,3]),U=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(U)))),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,U),E.bufferData(E.ELEMENT_ARRAY_BUFFER,$,E.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(E.createBuffer()),this.register((0,_.toDisposable)((()=>E.deleteBuffer(this._attributesBuffer)))),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.enableVertexAttribArray(0),E.vertexAttribPointer(0,2,E.FLOAT,!1,w,0),E.vertexAttribDivisor(0,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,4,E.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(2,1),this._updateCachedColors(R.colors),this.register(this._themeService.onChangeColors((j=>{this._updateCachedColors(j),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(m){const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),C.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,m.attributes,C.DYNAMIC_DRAW),C.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,C.UNSIGNED_BYTE,0,m.count)}handleResize(){this._updateViewportRectangle()}setDimensions(m){this._dimensions=m}_updateCachedColors(m){this._bgFloat=this._colorToFloat32Array(m.background),this._cursorFloat=this._colorToFloat32Array(m.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(m){const C=this._terminal,L=this._vertices;let R,E,D,O,$,U,j,z,M,B,T,k=1;for(R=0;R<C.rows;R++){for(D=-1,O=0,$=0,U=!1,E=0;E<C.cols;E++)j=(R*C.cols+E)*a.RENDER_MODEL_INDICIES_PER_CELL,z=m.cells[j+a.RENDER_MODEL_BG_OFFSET],M=m.cells[j+a.RENDER_MODEL_FG_OFFSET],B=!!(67108864&M),(z!==O||M!==$&&(U||B))&&((O!==0||U&&$!==0)&&(T=8*k++,this._updateRectangle(L,T,$,O,D,E,R)),D=E,O=z,$=M,U=B);(O!==0||U&&$!==0)&&(T=8*k++,this._updateRectangle(L,T,$,O,D,C.cols,R))}L.count=k}updateCursor(m){const C=this._verticesCursor,L=m.cursor;if(!L||L.style==="block")return void(C.count=0);let R,E=0;L.style!=="bar"&&L.style!=="outline"||(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),R=8*E++,this._addRectangleFloat(C.attributes,R,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),C.count=E}_updateRectangle(m,C,L,R,E,D,O){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:o=(16777215&L)<<8;break;default:o=this._themeService.colors.foreground.rgba}else switch(50331648&R){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&R].rgba;break;case 50331648:o=(16777215&R)<<8;break;default:o=this._themeService.colors.background.rgba}m.attributes.length<C+4&&(m.attributes=(0,p.expandFloat32Array)(m.attributes,this._terminal.rows*this._terminal.cols*8)),r=E*this._dimensions.device.cell.width,h=O*this._dimensions.device.cell.height,c=(o>>24&255)/255,l=(o>>16&255)/255,S=(o>>8&255)/255,x=1,this._addRectangle(m.attributes,C,r,h,(D-E)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,c,l,S,x)}_addRectangle(m,C,L,R,E,D,O,$,U,j){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=R/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=D/this._dimensions.device.canvas.height,m[C+4]=O,m[C+5]=$,m[C+6]=U,m[C+7]=j}_addRectangleFloat(m,C,L,R,E,D,O){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=R/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=D/this._dimensions.device.canvas.height,m[C+4]=O[0],m[C+5]=O[1],m[C+6]=O[2],m[C+7]=O[3]}_colorToFloat32Array(m){return new Float32Array([(m.rgba>>24&255)/255,(m.rgba>>16&255)/255,(m.rgba>>8&255)/255,(255&m.rgba)/255])}}n.RectangleRenderer=v},310:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(_,a){const p=_*a*n.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const d=u(820),_=u(274),a=u(627),p=u(457),w=u(56),b=u(374),o=u(345),r=u(859),h=u(147),c=u(782),l=u(855),S=u(965),x=u(742),v=u(310),y=u(733);class m extends r.Disposable{constructor(E,D,O,$,U,j,z,M,B){super(),this._terminal=E,this._characterJoinerService=D,this._charSizeService=O,this._coreBrowserService=$,this._coreService=U,this._decorationService=j,this._optionsService=z,this._themeService=M,this._cursorBlinkStateManager=new r.MutableDisposable,this._charAtlasDisposable=this.register(new r.MutableDisposable),this._observerDisposable=this.register(new r.MutableDisposable),this._model=new v.RenderModel,this._workCell=new c.CellData,this._workCell2=new c.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new _.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new y.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,z,this._themeService)],this.dimensions=(0,b.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(z.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const T={antialias:!1,depth:!1,preserveDrawingBuffer:B};if(this._gl=this._canvas.getContext("webgl2",T),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(k=>{console.log("webglcontextlost event received"),k.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(k)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(k=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,a.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,w.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((k,V)=>this._setCanvasDevicePixelDimensions(k,V))),this.register(this._coreBrowserService.onWindowChange((k=>{this._observerDisposable.value=(0,w.observeDevicePixelDimensions)(this._canvas,k,((V,K)=>this._setCanvasDevicePixelDimensions(V,K)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,r.toDisposable)((()=>{var k;for(const V of this._renderLayers)V.dispose();(k=this._canvas.parentElement)==null||k.removeChild(this._canvas),(0,a.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var E;return(E=this._charAtlas)==null?void 0:E.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(E,D){var O,$,U,j;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const z of this._renderLayers)z.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(O=this._rectangleRenderer.value)==null||O.setDimensions(this.dimensions),($=this._rectangleRenderer.value)==null||$.handleResize(),(U=this._glyphRenderer.value)==null||U.setDimensions(this.dimensions),(j=this._glyphRenderer.value)==null||j.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var E;for(const D of this._renderLayers)D.handleBlur(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.pause(),this._requestRedrawViewport()}handleFocus(){var E;for(const D of this._renderLayers)D.handleFocus(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.resume(),this._requestRedrawViewport()}handleSelectionChanged(E,D,O){for(const $ of this._renderLayers)$.handleSelectionChanged(this._terminal,E,D,O);this._model.selection.update(this._core,E,D,O),this._requestRedrawViewport()}handleCursorMove(){var E;for(const D of this._renderLayers)D.handleCursorMove(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var D;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const E=(0,a.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==E&&(this._onChangeTextureAtlas.fire(E.pages[0].canvas),this._charAtlasDisposable.value=(0,r.getDisposeArrayDisposable)([(0,o.forwardEvent)(E.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,o.forwardEvent)(E.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=E,this._charAtlas.warmUp(),(D=this._glyphRenderer.value)==null||D.setAtlas(this._charAtlas)}_clearModel(E){var D;this._model.clear(),E&&((D=this._glyphRenderer.value)==null||D.clear())}clearTextureAtlas(){var E;(E=this._charAtlas)==null||E.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var E;this._clearModel(!0);for(const D of this._renderLayers)D.reset(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(E){return-1}deregisterCharacterJoiner(E){return!1}renderRows(E,D){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const O of this._renderLayers)O.handleGridChanged(this._terminal,E,D);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(E,D),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(E,D){const O=this._core;let $,U,j,z,M,B,T,k,V,K,ue,le,q,N,re=this._workCell;E=L(E,O.rows-1,0),D=L(D,O.rows-1,0);const se=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ve=se-O.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,O.cols-1);let Me=-1;const _e=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Oe=!1;for(U=E;U<=D;U++)for(j=U+O.buffer.ydisp,z=O.buffer.lines.get(j),this._model.lineLengths[U]=0,M=this._characterJoinerService.getJoinedCharacters(j),q=0;q<O.cols;q++)if($=this._cellColorResolver.result.bg,z.loadCell(q,re),q===0&&($=this._cellColorResolver.result.bg),B=!1,T=q,M.length>0&&q===M[0][0]&&(B=!0,k=M.shift(),re=new C(re,z.translateToString(!0,k[0],k[1]),k[1]-k[0]),T=k[1]-1),V=re.getChars(),K=re.getCode(),le=(U*O.cols+q)*v.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,q,j,this.dimensions.device.cell.width),_e&&j===se&&(q===fe&&(this._model.cursor={x:fe,y:ve,width:re.getWidth(),style:this._coreBrowserService.isFocused?O.options.cursorStyle||"block":O.options.cursorInactiveStyle,cursorWidth:O.options.cursorWidth,dpr:this._devicePixelRatio},Me=fe+re.getWidth()-1),q>=fe&&q<=Me&&(this._coreBrowserService.isFocused&&(O.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&O.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),K!==l.NULL_CELL_CODE&&(this._model.lineLengths[U]=q+1),(this._model.cells[le]!==K||this._model.cells[le+v.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[le+v.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[le+v.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Oe=!0,V.length>1&&(K|=v.COMBINED_CHAR_BIT_MASK),this._model.cells[le]=K,this._model.cells[le+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[le+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[le+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ue=re.getWidth(),this._glyphRenderer.value.updateCell(q,U,K,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,V,ue,$),B))for(re=this._workCell,q++;q<T;q++)N=(U*O.cols+q)*v.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(q,U,l.NULL_CELL_CODE,0,0,0,l.NULL_CELL_CHAR,0,0),this._model.cells[N]=l.NULL_CELL_CODE,this._model.cells[N+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[N+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[N+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Oe&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(E,D){this._canvas.width===E&&this._canvas.height===D||(this._canvas.width=E,this._canvas.height=D,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const E=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:E,end:E})}}n.WebglRenderer=m;class C extends h.AttributeData{constructor(E,D,O){super(),this.content=0,this.combinedData="",this.fg=E.fg,this.bg=E.bg,this.combinedData=D,this._width=O}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(E){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(R,E,D=0){return Math.max(Math.min(R,E),D)}n.JoinedCellData=C},381:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const d=u(374);function _(a,p,w){const b=(0,d.throwIfFalsy)(a.createShader(p));if(a.shaderSource(b,w),a.compileShader(b),a.getShaderParameter(b,a.COMPILE_STATUS))return b;console.error(a.getShaderInfoLog(b)),a.deleteShader(b)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(a,p,w){const b=(0,d.throwIfFalsy)(a.createProgram());if(a.attachShader(b,(0,d.throwIfFalsy)(_(a,a.VERTEX_SHADER,p))),a.attachShader(b,(0,d.throwIfFalsy)(_(a,a.FRAGMENT_SHADER,w))),a.linkProgram(b),a.getProgramParameter(b,a.LINK_STATUS))return b;console.error(a.getProgramInfoLog(b)),a.deleteProgram(b)},n.createShader=_,n.expandFloat32Array=function(a,p){const w=Math.min(2*a.length,p),b=new Float32Array(w);for(let o=0;o<a.length;o++)b[o]=a[o];return b},n.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(627),_=u(237),a=u(374),p=u(859);class w extends p.Disposable{constructor(o,r,h,c,l,S,x,v){super(),this._container=r,this._alpha=l,this._coreBrowserService=S,this._optionsService=x,this._themeService=v,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=c.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((y=>{this._refreshCharAtlas(o,y),this.reset(o)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(o){}handleFocus(o){}handleCursorMove(o){}handleGridChanged(o,r,h){}handleSelectionChanged(o,r,h,c=!1){}_setTransparency(o,r){if(r===this._alpha)return;const h=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(o,this._themeService.colors),this.handleGridChanged(o,0,o.rows-1)}_refreshCharAtlas(o,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(o,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(o,r){this._deviceCellWidth=r.device.cell.width,this._deviceCellHeight=r.device.cell.height,this._deviceCharWidth=r.device.char.width,this._deviceCharHeight=r.device.char.height,this._deviceCharLeft=r.device.char.left,this._deviceCharTop=r.device.char.top,this._canvas.width=r.device.canvas.width,this._canvas.height=r.device.canvas.height,this._canvas.style.width=`${r.css.canvas.width}px`,this._canvas.style.height=`${r.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(o,this._themeService.colors)}_fillBottomLineAtCells(o,r,h=1){this._ctx.fillRect(o*this._deviceCellWidth,(r+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(o,r,h,c){this._alpha?this._ctx.clearRect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,c*this._deviceCellHeight))}_fillCharTrueColor(o,r,h,c){this._ctx.font=this._getFont(o,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(h,c,r.getWidth()),this._ctx.fillText(r.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,c*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(o,r,h){this._ctx.beginPath(),this._ctx.rect(o*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(o,r,h){return`${h?"italic":""} ${r?o.options.fontWeightBold:o.options.fontWeight} ${o.options.fontSize*this._coreBrowserService.dpr}px ${o.options.fontFamily}`}}n.BaseRenderLayer=w},733:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(592);class p extends a.BaseRenderLayer{constructor(b,o,r,h,c,l,S){super(r,b,"link",o,!0,c,l,S),this.register(h.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(h.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(b,o){super.resize(b,o),this._state=void 0}reset(b){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg!==void 0&&(0,d.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let o=b.y1+1;o<b.y2;o++)this._fillBottomLineAtCells(0,o,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=p},820:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,_,a))}}}},274:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let p,w=0,b=0,o=!1,r=!1,h=!1,c=0;n.CellColorResolver=class{constructor(l,S,x,v,y,m){this._terminal=l,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=y,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(l,S,x,v){if(this.result.bg=l.bg,this.result.fg=l.fg,this.result.ext=268435456&l.bg?l.extended.ext:0,b=0,w=0,r=!1,o=!1,h=!1,p=this._themeService.colors,c=0,l.getCode()!==d.NULL_CELL_CODE&&l.extended.underlineStyle===4){const y=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));c=S*v%(2*Math.round(y))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,p.selectionForeground&&(w=p.selectionForeground.rgba>>8&16777215,o=!0),(0,a.treatGlyphAsBackgroundColor)(l.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}w=_.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(b=h?-16777216&l.bg&-134217729|b|50331648:-16777216&l.bg|b|50331648),o&&(w=-16777216&l.fg&-67108865|w|50331648),67108864&this.result.fg&&(r&&!o&&(w=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!r&&o&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),p=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=o?w:this.result.fg,this.result.ext&=536870911,this.result.ext|=c<<29&3758096384}}},627:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(p,w,b,o,r,h,c,l){const S=(0,_.generateConfig)(o,r,h,c,w,b,l);for(let y=0;y<a.length;y++){const m=a[y],C=m.ownedBy.indexOf(p);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(y,1)):m.ownedBy.splice(C,1);break}}for(let y=0;y<a.length;y++){const m=a[y];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(p),m.atlas}const x=p._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(p){for(let w=0;w<a.length;w++){const b=a[w].ownedBy.indexOf(p);if(b!==-1){a[w].ownedBy.length===1?(a[w].atlas.dispose(),a.splice(w,1)):a[w].ownedBy.splice(b,1);break}}}},197:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,p,w,b,o,r){const h={foreground:o.foreground,background:o.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:w,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let p=0;p<_.colors.ansi.length;p++)if(_.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(o,r,h,c,l,S,x,v){const y=n.blockElementDefinitions[r];if(y)return(function(R,E,D,O,$,U){for(let j=0;j<E.length;j++){const z=E[j],M=$/8,B=U/8;R.fillRect(D+z.x*M,O+z.y*B,z.w*M,z.h*B)}})(o,y,h,c,l,S),!0;const m=_[r];if(m)return(function(R,E,D,O,$,U){let j=a.get(E);j||(j=new Map,a.set(E,j));const z=R.fillStyle;if(typeof z!="string")throw new Error(`Unexpected fillStyle type "${z}"`);let M=j.get(z);if(!M){const B=E[0].length,T=E.length,k=R.canvas.ownerDocument.createElement("canvas");k.width=B,k.height=T;const V=(0,d.throwIfFalsy)(k.getContext("2d")),K=new ImageData(B,T);let ue,le,q,N;if(z.startsWith("#"))ue=parseInt(z.slice(1,3),16),le=parseInt(z.slice(3,5),16),q=parseInt(z.slice(5,7),16),N=z.length>7&&parseInt(z.slice(7,9),16)||1;else{if(!z.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${z}" when drawing pattern glyph`);[ue,le,q,N]=z.substring(5,z.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<T;re++)for(let se=0;se<B;se++)K.data[4*(re*B+se)]=ue,K.data[4*(re*B+se)+1]=le,K.data[4*(re*B+se)+2]=q,K.data[4*(re*B+se)+3]=E[re][se]*(255*N);V.putImageData(K,0,0),M=(0,d.throwIfFalsy)(R.createPattern(k,null)),j.set(z,M)}R.fillStyle=M,R.fillRect(D,O,$,U)})(o,m,h,c,l,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(R,E,D,O,$,U,j){R.strokeStyle=R.fillStyle;for(const[z,M]of Object.entries(E)){let B;R.beginPath(),R.lineWidth=j*Number.parseInt(z),B=typeof M=="function"?M(.15,.15/U*$):M;for(const T of B.split(" ")){const k=T[0],V=w[k];if(!V){console.error(`Could not find drawing instructions for "${k}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&V(R,b(K,$,U,D,O,!0,j))}R.stroke(),R.closePath()}})(o,C,h,c,l,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(R,E,D,O,$,U,j,z){const M=new Path2D;M.rect(D,O,$,U),R.clip(M),R.beginPath();const B=j/12;R.lineWidth=z*B;for(const T of E.d.split(" ")){const k=T[0],V=w[k];if(!V){console.error(`Could not find drawing instructions for "${k}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&V(R,b(K,$,U,D,O,!1,z,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(R.strokeStyle=R.fillStyle,R.stroke()):R.fill(),R.closePath()})(o,L,h,c,l,S,x,v),!0)};const a=new Map;function p(o,r,h=0){return Math.max(Math.min(o,r),h)}const w={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function b(o,r,h,c,l,S,x,v=0,y=0){const m=o.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-y*x,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,r,0)),m[C]+=c+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,h,0)),m[C]+=l;return m}},56:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,p){let w=new a.ResizeObserver((b=>{const o=b.find((c=>c.target===_));if(!o)return;if(!("devicePixelContentBoxSize"in o))return w==null||w.disconnect(),void(w=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,h=o.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&p(r,h)}));try{w.observe(_,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)((()=>w==null?void 0:w.disconnect()))}},374:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),p=u(160),w=u(345),b=u(485),o=u(385),r=u(147),h=u(855),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let l;class S{get pages(){return this._pages}constructor(C,L,R){this._document=C,this._config=L,this._unicodeService=R,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new w.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new w.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=y(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new o.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const R=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,R)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((j=>2*j.canvas.width<=(S.maxTextureSize||4096))).sort(((j,z)=>z.canvas.width!==j.canvas.width?z.canvas.width-j.canvas.width:z.percentageUsed-j.percentageUsed));let R=-1,E=0;for(let j=0;j<L.length;j++)if(L[j].canvas.width!==E)R=j,E=L[j].canvas.width;else if(j-R==3)break;const D=L.slice(R,R+4),O=D.map((j=>j.glyphs[0].texturePage)).sort(((j,z)=>j>z?1:-1)),$=this.pages.length-D.length,U=this._mergePages(D,$);U.version++;for(let j=O.length-1;j>=0;j--)this._deletePage(O[j]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const R=2*C[0].canvas.width,E=new x(this._document,R,C);for(const[D,O]of C.entries()){const $=D*O.canvas.width%R,U=Math.floor(D/2)*O.canvas.height;E.ctx.drawImage(O.canvas,$,U);for(const z of O.glyphs)z.texturePage=L,z.sizeClipSpace.x=z.size.x/R,z.sizeClipSpace.y=z.size.y/R,z.texturePosition.x+=$,z.texturePosition.y+=U,z.texturePositionClipSpace.x=z.texturePosition.x/R,z.texturePositionClipSpace.y=z.texturePosition.y/R;this._onRemoveTextureAtlasCanvas.fire(O.canvas);const j=this._activePages.indexOf(O);j!==-1&&this._activePages.splice(j,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const R=this._pages[L];for(const E of R.glyphs)E.texturePage--;R.version++}}getRasterizedGlyphCombinedChar(C,L,R,E,D){return this._getFromCacheMap(this._cacheMapCombined,C,L,R,E,D)}getRasterizedGlyph(C,L,R,E,D){return this._getFromCacheMap(this._cacheMap,C,L,R,E,D)}_getFromCacheMap(C,L,R,E,D,O=!1){return l=C.get(L,R,E,D),l||(l=this._drawToCache(L,R,E,D,O),C.set(L,R,E,D,l)),l}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,R,E){if(this._config.allowTransparency)return p.NULL_COLOR;let D;switch(C){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const O=r.AttributeData.toColorRGB(L);D=p.channels.toColor(O[0],O[1],O[2]);break;default:D=R?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(C,L,R,E,D,O,$,U,j,z){const M=this._getMinimumContrastColor(C,L,R,E,D,O,$,j,U,z);if(M)return M;let B;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&j&&O<8&&(O+=8),B=this._getColorFromAnsiIndex(O);break;case 50331648:const T=r.AttributeData.toColorRGB(O);B=p.channels.toColor(T[0],T[1],T[2]);break;default:B=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=p.color.opaque(B)),U&&(B=p.color.multiplyOpacity(B,d.DIM_OPACITY)),B}_resolveBackgroundRgba(C,L,R){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,R,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,R,E,D,O,$,U,j,z){if(this._config.minimumContrastRatio===1||z)return;const M=this._getContrastCache(j),B=M.getColor(C,E);if(B!==void 0)return B||void 0;const T=this._resolveBackgroundRgba(L,R,$),k=this._resolveForegroundRgba(D,O,$,U),V=p.rgba.ensureContrastRatio(T,k,this._config.minimumContrastRatio/(j?2:1));if(!V)return void M.setColor(C,E,null);const K=p.channels.toColor(V>>24&255,V>>16&255,V>>8&255);return M.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,R,E,D=!1){const O=typeof C=="number"?String.fromCharCode(C):C,$=Math.min(this._config.deviceCellWidth*Math.max(O.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=R,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return c;const j=!!this._workAttributeData.isBold(),z=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),V=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),ue=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(z){const he=K;K=le,le=he;const ge=ue;ue=q,q=ge}const N=this._getBackgroundColor(q,le,z,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=j?this._config.fontWeightBold:this._config.fontWeight,se=B?"italic":"";this._tmpCtx.font=`${se} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=O.length===1&&(0,a.isPowerlineGlyph)(O.charCodeAt(0)),fe=O.length===1&&(0,a.isRestrictedPowerlineGlyph)(O.charCodeAt(0)),Me=this._getForegroundColor(L,q,le,R,ue,K,z,M,j,(0,a.treatGlyphAsBackgroundColor)(O.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,O,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,be=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;if(this._tmpCtx.lineWidth=he,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const ze=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(D?2*he:0),_t=Re+he,Qe=Re+2*he;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=ze+Ie*this._config.deviceCellWidth,Le=ze+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=he<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-he/2)-ge,vt=he<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+he/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=he?2*he-it:he-it;it>=he||Zt===0?(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+he,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,he,it);break;case 5:const tr=.6,ir=.3,jt=Le-Ae,si=Math.floor(tr*jt),ri=Math.floor(ir*jt),Jt=jt-si-ri;this._tmpCtx.setLineDash([si,ri,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&O!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(O);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(ze,Re-Math.ceil(he/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(he/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=N.css,this._tmpCtx.strokeText(O,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(V){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(O,_e,_e+this._config.deviceCharHeight),O==="_"&&!this._config.allowTransparency){let he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,be);if(he)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(O,_e,_e+this._config.deviceCharHeight-ge),he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,be),he);ge++);}if(k){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(he){for(let ge=0;ge<he.data.length;ge+=4)if(he.data[ge+3]>0)return!1;return!0})(ft):v(ft,N,Me,be),Ot)return c;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,$,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const he=this._createNewPage();pe=he,me=he.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const he of this._activePages)Se.size.y<=he.currentRow.height&&(pe=he,me=he.currentRow);for(let he=this._activePages.length-1;he>=0;he--)for(const ge of this._activePages[he].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[he],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let he=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const ze of this._activePages)if(ze.currentRow.y+ze.currentRow.height+Se.size.y<ze.canvas.height){ge=ze;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)he=!0;else{const ze=this._createNewPage();pe=ze,me=ze.currentRow,me.height=Se.size.y,he=!0}}he||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,R,E,D,O){L.top=0;const $=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:R;let j=!1;for(let z=0;z<$;z++){for(let M=0;M<U;M++){const B=z*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.top=z,j=!0;break}}if(j)break}L.left=0,j=!1;for(let z=0;z<O+U;z++){for(let M=0;M<$;M++){const B=M*this._tmpCanvas.width*4+4*z+3;if(C.data[B]!==0){L.left=z,j=!0;break}}if(j)break}L.right=U,j=!1;for(let z=O+U-1;z>=O;z--){for(let M=0;M<$;M++){const B=M*this._tmpCanvas.width*4+4*z+3;if(C.data[B]!==0){L.right=z,j=!0;break}}if(j)break}L.bottom=$,j=!1;for(let z=$-1;z>=0;z--){for(let M=0;M<U;M++){const B=z*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.bottom=z,j=!0;break}}if(j)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+O+(E||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+O+(E||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,R){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],R)for(const E of R)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=y(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(m,C,L,R){const E=C.rgba>>>24,D=C.rgba>>>16&255,O=C.rgba>>>8&255,$=L.rgba>>>24,U=L.rgba>>>16&255,j=L.rgba>>>8&255,z=Math.floor((Math.abs(E-$)+Math.abs(D-U)+Math.abs(O-j))/12);let M=!0;for(let B=0;B<m.data.length;B+=4)m.data[B]===E&&m.data[B+1]===D&&m.data[B+2]===O||R&&Math.abs(m.data[B]-E)+Math.abs(m.data[B+1]-D)+Math.abs(m.data[B+2]-O)<z?m.data[B+3]=0:M=!1;return M}function y(m,C,L){const R=m.createElement("canvas");return R.width=C,R.height=L,R}},160:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E>0||D>0||O>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E<255||D<255||O<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const D=S(v,y,m),O=c(C,o.relativeLuminance(D>>8));if(O<m){const $=x(v,y,m);return O>c(C,o.relativeLuminance($>>8))?D:$}return D}const R=x(v,y,m),E=c(C,o.relativeLuminance(R>>8));if(E<m){const D=S(v,y,m);return E>c(C,o.relativeLuminance(D>>8))?R:D}return R}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},345:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},399:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},855:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},776:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),p=u(97),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},726:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},I={};function J(F){var n=I[F];if(n!==void 0)return n.exports;var u=I[F]={exports:{}};return X[F].call(u.exports,u,u.exports,J),u.exports}var ie={};return(()=>{var F=ie;Object.defineProperty(F,"__esModule",{value:!0}),F.WebglAddon=void 0;const n=J(345),u=J(859),d=J(399),_=J(666),a=J(776);class p extends u.Disposable{constructor(b){if(d.isSafari&&(0,d.getSafariVersion)()<16){const o={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",o))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=b,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(b){const o=b._core;if(!b.element)return void this.register(o.onWillOpen((()=>this.activate(b))));this._terminal=b;const r=o.coreService,h=o.optionsService,c=o,l=c._renderService,S=c._characterJoinerService,x=c._charSizeService,v=c._coreBrowserService,y=c._decorationService,m=c._logService,C=c._themeService;(0,a.setTraceLogger)(m),this._renderer=this.register(new _.WebglRenderer(b,S,x,v,r,y,h,C,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),l.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(b.cols,b.rows)})))}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}F.WebglAddon=p})(),ie})()))})(zo)),zo.exports}var ag=ng(),No={exports:{}},Jd;function lg(){return Jd||(Jd=1,(function(P,W){(function(X,I){P.exports=I()})(self,(()=>(()=>{var X={903:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(274),_=u(627),a=u(237),p=u(860),w=u(374),b=u(296),o=u(345),r=u(859),h=u(399),c=u(855);class l extends r.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var v;return(v=this._charAtlas)==null?void 0:v.pages[0].canvas}constructor(v,y,m,C,L,R,E,D,O,$){super(),this._terminal=v,this._container=y,this._alpha=L,this._themeService=R,this._bufferService=E,this._optionsService=D,this._decorationService=O,this._coreBrowserService=$,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,b.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new r.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${m}-layer`),this._canvas.style.zIndex=C.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((U=>{this._refreshCharAtlas(U),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,r.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,w.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(v,y){}handleSelectionChanged(v,y,m=!1){this._selectionModel.update(this._terminal._core,v,y,m)}_setTransparency(v){if(v===this._alpha)return;const y=this._canvas;this._alpha=v,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,y),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(v){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,_.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,v,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,o.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let y=0;y<this._charAtlas.pages.length;y++)this._bitmapGenerator[y]=new S(this._charAtlas.pages[y].canvas)}}resize(v){this._deviceCellWidth=v.device.cell.width,this._deviceCellHeight=v.device.cell.height,this._deviceCharWidth=v.device.char.width,this._deviceCharHeight=v.device.char.height,this._deviceCharLeft=v.device.char.left,this._deviceCharTop=v.device.char.top,this._canvas.width=v.device.canvas.width,this._canvas.height=v.device.canvas.height,this._canvas.style.width=`${v.css.canvas.width}px`,this._canvas.style.height=`${v.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var v;(v=this._charAtlas)==null||v.clearTexture()}_fillCells(v,y,m,C){this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(v,y,m=1){const C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(v*this._deviceCellWidth,(y+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(v,y,m=1,C=0){this._ctx.fillRect(v*this._deviceCellWidth,(y+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C;for(let L=0;L<m;L++){const R=(v+L)*this._deviceCellWidth,E=(v+L+.5)*this._deviceCellWidth,D=(v+L+1)*this._deviceCellWidth,O=(y+1)*this._deviceCellHeight-C-1,$=O-C,U=O+C;this._ctx.moveTo(R,O),this._ctx.bezierCurveTo(R,$,E,$,E,O),this._ctx.bezierCurveTo(E,U,D,U,D,O)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([2*C,C]);const L=v*this._deviceCellWidth,R=(y+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,R);for(let E=0;E<m;E++){const D=(v+m+E)*this._deviceCellWidth;this._ctx.lineTo(D,R)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(v,y,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([4*C,3*C]);const L=v*this._deviceCellWidth,R=(v+m)*this._deviceCellWidth,E=(y+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,E),this._ctx.lineTo(R,E),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(v,y,m){this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,this._coreBrowserService.dpr*m,this._deviceCellHeight)}_strokeRectAtCell(v,y,m,C){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(v*this._deviceCellWidth+L/2,y*this._deviceCellHeight+L/2,m*this._deviceCellWidth-L,C*this._deviceCellHeight-L)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,y,m,C){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,y*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(v,y,m){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(m);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,p.tryDrawCustomChar)(this._ctx,v.getChars(),y*this._deviceCellWidth,m*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(v.getChars(),y*this._deviceCellWidth+this._deviceCharLeft,m*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(v,y,m){var O,$,U,j;const C=v.getChars(),L=v.getCode(),R=v.getWidth();if(this._cellColorResolver.resolve(v,y,this._bufferService.buffer.ydisp+m,this._deviceCellWidth),!this._charAtlas)return;let E;if(E=C&&C.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(C,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(v.getCode()||c.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!E.size.x||!E.size.y)return;this._ctx.save(),this._clipRow(m),this._bitmapGenerator[E.texturePage]&&this._charAtlas.pages[E.texturePage].canvas!==this._bitmapGenerator[E.texturePage].canvas&&(($=(O=this._bitmapGenerator[E.texturePage])==null?void 0:O.bitmap)==null||$.close(),delete this._bitmapGenerator[E.texturePage]),this._charAtlas.pages[E.texturePage].version!==((U=this._bitmapGenerator[E.texturePage])==null?void 0:U.version)&&(this._bitmapGenerator[E.texturePage]||(this._bitmapGenerator[E.texturePage]=new S(this._charAtlas.pages[E.texturePage].canvas)),this._bitmapGenerator[E.texturePage].refresh(),this._bitmapGenerator[E.texturePage].version=this._charAtlas.pages[E.texturePage].version);let D=E.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,w.allowRescaling)(L,R,E.size.x,this._deviceCellWidth)&&(D=this._deviceCellWidth-1),this._ctx.drawImage(((j=this._bitmapGenerator[E.texturePage])==null?void 0:j.bitmap)||this._charAtlas.pages[E.texturePage].canvas,E.texturePosition.x,E.texturePosition.y,E.size.x,E.size.y,y*this._deviceCellWidth+this._deviceCharLeft-E.offset.x,m*this._deviceCellHeight+this._deviceCharTop-E.offset.y,D,E.size.y),this._ctx.restore()}_clipRow(v){this._ctx.beginPath(),this._ctx.rect(0,v*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,y){return`${y?"italic":""} ${v?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}n.BaseRenderLayer=l;class S{get bitmap(){return this._bitmap}constructor(v){this.canvas=v,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var v;(v=this._bitmap)==null||v.close(),this._bitmap=void 0,h.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var v;this._state===0&&((v=this._bitmap)==null||v.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((y=>{this._state===2?this.refresh():this._bitmap=y,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasRenderer=void 0;const d=u(627),_=u(56),a=u(374),p=u(345),w=u(859),b=u(873),o=u(43),r=u(630),h=u(744);class c extends w.Disposable{constructor(S,x,v,y,m,C,L,R,E,D,O){super(),this._terminal=S,this._screenElement=x,this._bufferService=y,this._charSizeService=m,this._optionsService=C,this._coreBrowserService=E,this._themeService=O,this._observerDisposable=this.register(new w.MutableDisposable),this._onRequestRedraw=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new p.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const $=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new h.TextRenderLayer(this._terminal,this._screenElement,0,$,this._bufferService,this._optionsService,L,D,this._coreBrowserService,O),new r.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,D,this._optionsService,O),new o.LinkRenderLayer(this._terminal,this._screenElement,2,v,this._bufferService,this._optionsService,D,this._coreBrowserService,O),new b.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,R,this._coreBrowserService,D,O)];for(const U of this._renderLayers)(0,p.forwardEvent)(U.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((U,j)=>this._setCanvasDevicePixelDimensions(U,j))),this.register(this._coreBrowserService.onWindowChange((U=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,U,((j,z)=>this._setCanvasDevicePixelDimensions(j,z)))}))),this.register((0,w.toDisposable)((()=>{for(const U of this._renderLayers)U.dispose();(0,d.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(S,x){this._updateDimensions();for(const v of this._renderLayers)v.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((S=>S.handleBlur()))}handleFocus(){this._runOperation((S=>S.handleFocus()))}handleSelectionChanged(S,x,v=!1){this._runOperation((y=>y.handleSelectionChanged(S,x,v))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((S=>S.handleCursorMove()))}clear(){this._runOperation((S=>S.reset()))}_runOperation(S){for(const x of this._renderLayers)S(x)}renderRows(S,x){for(const v of this._renderLayers)v.handleGridChanged(S,x)}clearTextureAtlas(){for(const S of this._renderLayers)S.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*S),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/S),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(S,x){this.dimensions.device.canvas.height=x,this.dimensions.device.canvas.width=S;for(const v of this._renderLayers)v.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}n.CanvasRenderer=c},873:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorRenderLayer=void 0;const d=u(457),_=u(859),a=u(399),p=u(782),w=u(903);class b extends w.BaseRenderLayer{constructor(r,h,c,l,S,x,v,y,m,C){super(r,h,"cursor",c,!0,C,S,x,m,y),this._onRequestRedraw=l,this._coreService=v,this._cursorBlinkStateManager=this.register(new _.MutableDisposable),this._cell=new p.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(r){super.resize(r),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var r;this._clearCursor(),(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var r;(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var r;(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var r;(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}handleGridChanged(r,h){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(r){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const h=this._bufferService.buffer.ybase+this._bufferService.buffer.y,c=h-this._bufferService.buffer.ydisp;if(c<0||c>=this._bufferService.rows)return void this._clearCursor();const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(h).loadCell(l,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;return x&&x!=="none"&&this._cursorRenderers[x](l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===l&&this._state.y===c&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(a.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(r,h,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(r,h,c.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(c,r,h),this._ctx.restore()}_renderUnderlineCursor(r,h,c){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(r,h),this._ctx.restore()}_renderOutlineCursor(r,h,c){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(r,h,c.getWidth(),1),this._ctx.restore()}}n.CursorRenderLayer=b},574:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GridCache=void 0,n.GridCache=class{constructor(){this.cache=[]}resize(u,d){for(let _=0;_<u;_++){this.cache.length<=_&&this.cache.push([]);for(let a=this.cache[_].length;a<d;a++)this.cache[_].push(void 0);this.cache[_].length=d}this.cache.length=u}clear(){for(let u=0;u<this.cache.length;u++)for(let d=0;d<this.cache[u].length;d++)this.cache[u][d]=void 0}}},43:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(903);class p extends a.BaseRenderLayer{constructor(b,o,r,h,c,l,S,x,v){super(b,o,"link",r,!0,v,c,l,S,x),this.register(h.onShowLinkUnderline((y=>this._handleShowLinkUnderline(y)))),this.register(h.onHideLinkUnderline((y=>this._handleHideLinkUnderline(y))))}resize(b){super.resize(b),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg&&(0,d.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let o=b.y1+1;o<b.y2;o++)this._fillBottomLineAtCells(0,o,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=p},630:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionRenderLayer=void 0;const d=u(903);class _ extends d.BaseRenderLayer{constructor(p,w,b,o,r,h,c,l){super(p,w,"selection",b,!0,l,o,c,h,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(p){super.resize(p),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(p,w,b){super.handleSelectionChanged(p,w,b),this._redrawSelection(p,w,b)}_redrawSelection(p,w,b){if(!this._didStateChange(p,w,b,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!p||!w)return void this._clearState();const o=p[1]-this._bufferService.buffer.ydisp,r=w[1]-this._bufferService.buffer.ydisp,h=Math.max(o,0),c=Math.min(r,this._bufferService.rows-1);if(h>=this._bufferService.rows||c<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,b){const l=p[0],S=w[0]-l,x=c-h+1;this._fillCells(l,h,S,x)}else{const l=o===h?p[0]:0,S=h===r?w[0]:this._bufferService.cols;this._fillCells(l,h,S-l,1);const x=Math.max(c-h-1,0);if(this._fillCells(0,h+1,this._bufferService.cols,x),h!==c){const v=r===c?w[0]:this._bufferService.cols;this._fillCells(0,c,v,1)}}this._state.start=[p[0],p[1]],this._state.end=[w[0],w[1]],this._state.columnSelectMode=b,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(p,w,b,o){return!this._areCoordinatesEqual(p,this._state.start)||!this._areCoordinatesEqual(w,this._state.end)||b!==this._state.columnSelectMode||o!==this._state.ydisp}_areCoordinatesEqual(p,w){return!(!p||!w)&&p[0]===w[0]&&p[1]===w[1]}}n.SelectionRenderLayer=_},744:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextRenderLayer=void 0;const d=u(577),_=u(147),a=u(782),p=u(855),w=u(903),b=u(574);class o extends w.BaseRenderLayer{constructor(h,c,l,S,x,v,y,m,C,L){super(h,c,"text",l,S,L,x,v,m,C),this._characterJoinerService=y,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new b.GridCache,this.register(v.onSpecificOptionChange("allowTransparency",(R=>this._setTransparency(R))))}resize(h){super.resize(h);const c=this._getFont(!1,!1);this._characterWidth===h.device.char.width&&this._characterFont===c||(this._characterWidth=h.device.char.width,this._characterFont=c,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(h,c,l){for(let S=h;S<=c;S++){const x=S+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(x),y=this._characterJoinerService.getJoinedCharacters(x);for(let m=0;m<this._bufferService.cols;m++){v.loadCell(m,this._workCell);let C=this._workCell,L=!1,R=m;if(C.getWidth()!==0){if(y.length>0&&m===y[0][0]){L=!0;const E=y.shift();C=new d.JoinedCellData(this._workCell,v.translateToString(!0,E[0],E[1]),E[1]-E[0]),R=E[1]-1}!L&&this._isOverlapping(C)&&R<v.length-1&&v.getCodePoint(R+1)===p.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),l(C,m,S),m=R}}}}_drawBackground(h,c){const l=this._ctx,S=this._bufferService.cols;let x=0,v=0,y=null;l.save(),this._forEachCell(h,c,((m,C,L)=>{let R=null;m.isInverse()?R=m.isFgDefault()?this._themeService.colors.foreground.css:m.isFgRGB()?`rgb(${_.AttributeData.toColorRGB(m.getFgColor()).join(",")})`:this._themeService.colors.ansi[m.getFgColor()].css:m.isBgRGB()?R=`rgb(${_.AttributeData.toColorRGB(m.getBgColor()).join(",")})`:m.isBgPalette()&&(R=this._themeService.colors.ansi[m.getBgColor()].css);let E=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+L,void 0,(D=>{D.options.layer!=="top"&&E||(D.backgroundColorRGB&&(R=D.backgroundColorRGB.css),E=D.options.layer==="top")})),y===null&&(x=C,v=L),L!==v?(l.fillStyle=y||"",this._fillCells(x,v,S-x,1),x=C,v=L):y!==R&&(l.fillStyle=y||"",this._fillCells(x,v,C-x,1),x=C,v=L),y=R})),y!==null&&(l.fillStyle=y,this._fillCells(x,v,S-x,1)),l.restore()}_drawForeground(h,c){this._forEachCell(h,c,((l,S,x)=>this._drawChars(l,S,x)))}handleGridChanged(h,c){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,h,this._bufferService.cols,c-h+1),this._drawBackground(h,c),this._drawForeground(h,c))}_isOverlapping(h){if(h.getWidth()!==1||h.getCode()<256)return!1;const c=h.getChars();if(this._characterOverlapCache.hasOwnProperty(c))return this._characterOverlapCache[c];this._ctx.save(),this._ctx.font=this._characterFont;const l=Math.floor(this._ctx.measureText(c).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[c]=l,l}}n.TextRenderLayer=o},274:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let p,w=0,b=0,o=!1,r=!1,h=!1,c=0;n.CellColorResolver=class{constructor(l,S,x,v,y,m){this._terminal=l,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=y,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(l,S,x,v){if(this.result.bg=l.bg,this.result.fg=l.fg,this.result.ext=268435456&l.bg?l.extended.ext:0,b=0,w=0,r=!1,o=!1,h=!1,p=this._themeService.colors,c=0,l.getCode()!==d.NULL_CELL_CODE&&l.extended.underlineStyle===4){const y=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));c=S*v%(2*Math.round(y))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,p.selectionForeground&&(w=p.selectionForeground.rgba>>8&16777215,o=!0),(0,a.treatGlyphAsBackgroundColor)(l.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}w=_.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(y=>{y.backgroundColorRGB&&(b=y.backgroundColorRGB.rgba>>8&16777215,r=!0),y.foregroundColorRGB&&(w=y.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(b=h?-16777216&l.bg&-134217729|b|50331648:-16777216&l.bg|b|50331648),o&&(w=-16777216&l.fg&-67108865|w|50331648),67108864&this.result.fg&&(r&&!o&&(w=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!r&&o&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),p=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=o?w:this.result.fg,this.result.ext&=536870911,this.result.ext|=c<<29&3758096384}}},627:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(p,w,b,o,r,h,c,l){const S=(0,_.generateConfig)(o,r,h,c,w,b,l);for(let y=0;y<a.length;y++){const m=a[y],C=m.ownedBy.indexOf(p);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(y,1)):m.ownedBy.splice(C,1);break}}for(let y=0;y<a.length;y++){const m=a[y];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(p),m.atlas}const x=p._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(p){for(let w=0;w<a.length;w++){const b=a[w].ownedBy.indexOf(p);if(b!==-1){a[w].ownedBy.length===1?(a[w].atlas.dispose(),a.splice(w,1)):a[w].ownedBy.splice(b,1);break}}}},197:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,p,w,b,o,r){const h={foreground:o.foreground,background:o.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:w,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let p=0;p<_.colors.ansi.length;p++)if(_.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(o,r,h,c,l,S,x,v){const y=n.blockElementDefinitions[r];if(y)return(function(R,E,D,O,$,U){for(let j=0;j<E.length;j++){const z=E[j],M=$/8,B=U/8;R.fillRect(D+z.x*M,O+z.y*B,z.w*M,z.h*B)}})(o,y,h,c,l,S),!0;const m=_[r];if(m)return(function(R,E,D,O,$,U){let j=a.get(E);j||(j=new Map,a.set(E,j));const z=R.fillStyle;if(typeof z!="string")throw new Error(`Unexpected fillStyle type "${z}"`);let M=j.get(z);if(!M){const B=E[0].length,T=E.length,k=R.canvas.ownerDocument.createElement("canvas");k.width=B,k.height=T;const V=(0,d.throwIfFalsy)(k.getContext("2d")),K=new ImageData(B,T);let ue,le,q,N;if(z.startsWith("#"))ue=parseInt(z.slice(1,3),16),le=parseInt(z.slice(3,5),16),q=parseInt(z.slice(5,7),16),N=z.length>7&&parseInt(z.slice(7,9),16)||1;else{if(!z.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${z}" when drawing pattern glyph`);[ue,le,q,N]=z.substring(5,z.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<T;re++)for(let se=0;se<B;se++)K.data[4*(re*B+se)]=ue,K.data[4*(re*B+se)+1]=le,K.data[4*(re*B+se)+2]=q,K.data[4*(re*B+se)+3]=E[re][se]*(255*N);V.putImageData(K,0,0),M=(0,d.throwIfFalsy)(R.createPattern(k,null)),j.set(z,M)}R.fillStyle=M,R.fillRect(D,O,$,U)})(o,m,h,c,l,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(R,E,D,O,$,U,j){R.strokeStyle=R.fillStyle;for(const[z,M]of Object.entries(E)){let B;R.beginPath(),R.lineWidth=j*Number.parseInt(z),B=typeof M=="function"?M(.15,.15/U*$):M;for(const T of B.split(" ")){const k=T[0],V=w[k];if(!V){console.error(`Could not find drawing instructions for "${k}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&V(R,b(K,$,U,D,O,!0,j))}R.stroke(),R.closePath()}})(o,C,h,c,l,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(R,E,D,O,$,U,j,z){const M=new Path2D;M.rect(D,O,$,U),R.clip(M),R.beginPath();const B=j/12;R.lineWidth=z*B;for(const T of E.d.split(" ")){const k=T[0],V=w[k];if(!V){console.error(`Could not find drawing instructions for "${k}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&V(R,b(K,$,U,D,O,!1,z,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(R.strokeStyle=R.fillStyle,R.stroke()):R.fill(),R.closePath()})(o,L,h,c,l,S,x,v),!0)};const a=new Map;function p(o,r,h=0){return Math.max(Math.min(o,r),h)}const w={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function b(o,r,h,c,l,S,x,v=0,y=0){const m=o.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-y*x,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,r,0)),m[C]+=c+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=p(Math.round(m[C]+.5)-.5,h,0)),m[C]+=l;return m}},56:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,p){let w=new a.ResizeObserver((b=>{const o=b.find((c=>c.target===_));if(!o)return;if(!("devicePixelContentBoxSize"in o))return w==null||w.disconnect(),void(w=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,h=o.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&p(r,h)}));try{w.observe(_,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)((()=>w==null?void 0:w.disconnect()))}},374:(F,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,p,w){return a===1&&p>Math.ceil(1.5*w)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(b){return 57344<=b&&b<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,p=0){return(_-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class u{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(_,a,p,w=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const b=_.buffers.active.ydisp,o=a[1]-b,r=p[1]-b,h=Math.max(o,0),c=Math.min(r,_.rows-1);h>=_.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=c,this.startCol=a[0],this.endCol=p[0])}isCellSelected(_,a,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),p=u(160),w=u(345),b=u(485),o=u(385),r=u(147),h=u(855),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let l;class S{get pages(){return this._pages}constructor(C,L,R){this._document=C,this._config=L,this._unicodeService=R,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new w.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new w.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=y(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new o.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const R=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,R)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((j=>2*j.canvas.width<=(S.maxTextureSize||4096))).sort(((j,z)=>z.canvas.width!==j.canvas.width?z.canvas.width-j.canvas.width:z.percentageUsed-j.percentageUsed));let R=-1,E=0;for(let j=0;j<L.length;j++)if(L[j].canvas.width!==E)R=j,E=L[j].canvas.width;else if(j-R==3)break;const D=L.slice(R,R+4),O=D.map((j=>j.glyphs[0].texturePage)).sort(((j,z)=>j>z?1:-1)),$=this.pages.length-D.length,U=this._mergePages(D,$);U.version++;for(let j=O.length-1;j>=0;j--)this._deletePage(O[j]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const R=2*C[0].canvas.width,E=new x(this._document,R,C);for(const[D,O]of C.entries()){const $=D*O.canvas.width%R,U=Math.floor(D/2)*O.canvas.height;E.ctx.drawImage(O.canvas,$,U);for(const z of O.glyphs)z.texturePage=L,z.sizeClipSpace.x=z.size.x/R,z.sizeClipSpace.y=z.size.y/R,z.texturePosition.x+=$,z.texturePosition.y+=U,z.texturePositionClipSpace.x=z.texturePosition.x/R,z.texturePositionClipSpace.y=z.texturePosition.y/R;this._onRemoveTextureAtlasCanvas.fire(O.canvas);const j=this._activePages.indexOf(O);j!==-1&&this._activePages.splice(j,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const R=this._pages[L];for(const E of R.glyphs)E.texturePage--;R.version++}}getRasterizedGlyphCombinedChar(C,L,R,E,D){return this._getFromCacheMap(this._cacheMapCombined,C,L,R,E,D)}getRasterizedGlyph(C,L,R,E,D){return this._getFromCacheMap(this._cacheMap,C,L,R,E,D)}_getFromCacheMap(C,L,R,E,D,O=!1){return l=C.get(L,R,E,D),l||(l=this._drawToCache(L,R,E,D,O),C.set(L,R,E,D,l)),l}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,R,E){if(this._config.allowTransparency)return p.NULL_COLOR;let D;switch(C){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const O=r.AttributeData.toColorRGB(L);D=p.channels.toColor(O[0],O[1],O[2]);break;default:D=R?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(C,L,R,E,D,O,$,U,j,z){const M=this._getMinimumContrastColor(C,L,R,E,D,O,$,j,U,z);if(M)return M;let B;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&j&&O<8&&(O+=8),B=this._getColorFromAnsiIndex(O);break;case 50331648:const T=r.AttributeData.toColorRGB(O);B=p.channels.toColor(T[0],T[1],T[2]);break;default:B=$?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=p.color.opaque(B)),U&&(B=p.color.multiplyOpacity(B,d.DIM_OPACITY)),B}_resolveBackgroundRgba(C,L,R){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,R,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,R,E,D,O,$,U,j,z){if(this._config.minimumContrastRatio===1||z)return;const M=this._getContrastCache(j),B=M.getColor(C,E);if(B!==void 0)return B||void 0;const T=this._resolveBackgroundRgba(L,R,$),k=this._resolveForegroundRgba(D,O,$,U),V=p.rgba.ensureContrastRatio(T,k,this._config.minimumContrastRatio/(j?2:1));if(!V)return void M.setColor(C,E,null);const K=p.channels.toColor(V>>24&255,V>>16&255,V>>8&255);return M.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,R,E,D=!1){const O=typeof C=="number"?String.fromCharCode(C):C,$=Math.min(this._config.deviceCellWidth*Math.max(O.length,2)+4,this._textureSize);this._tmpCanvas.width<$&&(this._tmpCanvas.width=$);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=R,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return c;const j=!!this._workAttributeData.isBold(),z=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),V=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),ue=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(z){const he=K;K=le,le=he;const ge=ue;ue=q,q=ge}const N=this._getBackgroundColor(q,le,z,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=j?this._config.fontWeightBold:this._config.fontWeight,se=B?"italic":"";this._tmpCtx.font=`${se} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=O.length===1&&(0,a.isPowerlineGlyph)(O.charCodeAt(0)),fe=O.length===1&&(0,a.isRestrictedPowerlineGlyph)(O.charCodeAt(0)),Me=this._getForegroundColor(L,q,le,R,ue,K,z,M,j,(0,a.treatGlyphAsBackgroundColor)(O.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,O,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,be=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;if(this._tmpCtx.lineWidth=he,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const ze=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(D?2*he:0),_t=Re+he,Qe=Re+2*he;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=ze+Ie*this._config.deviceCellWidth,Le=ze+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=he<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-he/2)-ge,vt=he<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+he/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=he?2*he-it:he-it;it>=he||Zt===0?(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+he,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,he,it);break;case 5:const tr=.6,ir=.3,jt=Le-Ae,si=Math.floor(tr*jt),ri=Math.floor(ir*jt),Jt=jt-si-ri;this._tmpCtx.setLineDash([si,ri,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&O!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(O);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(ze,Re-Math.ceil(he/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(he/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=N.css,this._tmpCtx.strokeText(O,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(V){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(O,_e,_e+this._config.deviceCharHeight),O==="_"&&!this._config.allowTransparency){let he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,be);if(he)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(O,_e,_e+this._config.deviceCharHeight-ge),he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,be),he);ge++);}if(k){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(he){for(let ge=0;ge<he.data.length;ge+=4)if(he.data[ge+3]>0)return!1;return!0})(ft):v(ft,N,Me,be),Ot)return c;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,$,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const he=this._createNewPage();pe=he,me=he.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const he of this._activePages)Se.size.y<=he.currentRow.height&&(pe=he,me=he.currentRow);for(let he=this._activePages.length-1;he>=0;he--)for(const ge of this._activePages[he].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[he],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let he=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const ze of this._activePages)if(ze.currentRow.y+ze.currentRow.height+Se.size.y<ze.canvas.height){ge=ze;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)he=!0;else{const ze=this._createNewPage();pe=ze,me=ze.currentRow,me.height=Se.size.y,he=!0}}he||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,R,E,D,O){L.top=0;const $=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:R;let j=!1;for(let z=0;z<$;z++){for(let M=0;M<U;M++){const B=z*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.top=z,j=!0;break}}if(j)break}L.left=0,j=!1;for(let z=0;z<O+U;z++){for(let M=0;M<$;M++){const B=M*this._tmpCanvas.width*4+4*z+3;if(C.data[B]!==0){L.left=z,j=!0;break}}if(j)break}L.right=U,j=!1;for(let z=O+U-1;z>=O;z--){for(let M=0;M<$;M++){const B=M*this._tmpCanvas.width*4+4*z+3;if(C.data[B]!==0){L.right=z,j=!0;break}}if(j)break}L.bottom=$,j=!1;for(let z=$-1;z>=0;z--){for(let M=0;M<U;M++){const B=z*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.bottom=z,j=!0;break}}if(j)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+O+(E||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+O+(E||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,R){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],R)for(const E of R)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=y(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(m,C,L,R){const E=C.rgba>>>24,D=C.rgba>>>16&255,O=C.rgba>>>8&255,$=L.rgba>>>24,U=L.rgba>>>16&255,j=L.rgba>>>8&255,z=Math.floor((Math.abs(E-$)+Math.abs(D-U)+Math.abs(O-j))/12);let M=!0;for(let B=0;B<m.data.length;B+=4)m.data[B]===E&&m.data[B+1]===D&&m.data[B+2]===O||R&&Math.abs(m.data[B]-E)+Math.abs(m.data[B+1]-D)+Math.abs(m.data[B+2]-O)<z?m.data[B+3]=0:M=!1;return M}function y(m,C,L){const R=m.createElement("canvas");return R.width=C,R.height=L,R}},577:function(F,n,u){var d=this&&this.__decorate||function(h,c,l,S){var x,v=arguments.length,y=v<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(h,c,l,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(y=(v<3?x(y):v>3?x(c,l,y):x(c,l))||y);return v>3&&y&&Object.defineProperty(c,l,y),y},_=this&&this.__param||function(h,c){return function(l,S){c(l,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(147),p=u(855),w=u(782),b=u(97);class o extends a.AttributeData{constructor(c,l,S){super(),this.content=0,this.combinedData="",this.fg=c.fg,this.bg=c.bg,this.combinedData=l,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(c){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=o;let r=n.CharacterJoinerService=class df{constructor(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(c){const l={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(l),l.id}deregister(c){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===c)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(c){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(c);if(!l||l.length===0)return[];const S=[],x=l.translateToString(!0);let v=0,y=0,m=0,C=l.getFg(0),L=l.getBg(0);for(let R=0;R<l.getTrimmedLength();R++)if(l.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(R-v>1){const E=this._getJoinedRanges(x,m,y,l,v);for(let D=0;D<E.length;D++)S.push(E[D])}v=R,m=y,C=this._workCell.fg,L=this._workCell.bg}y+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const R=this._getJoinedRanges(x,m,y,l,v);for(let E=0;E<R.length;E++)S.push(R[E])}return S}_getJoinedRanges(c,l,S,x,v){const y=c.substring(l,S);let m=[];try{m=this._characterJoiners[0].handler(y)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(y);for(let R=0;R<L.length;R++)df._mergeRanges(m,L[R])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(c,l,S){let x=0,v=!1,y=0,m=c[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=l.getWidth(C),R=l.getString(C).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=y&&(m[0]=C,v=!0),m[1]<=y){if(m[1]=C,m=c[++x],!m)break;m[0]<=y?(m[0]=C,v=!0):v=!1}y+=R}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(c,l){let S=!1;for(let x=0;x<c.length;x++){const v=c[x];if(S){if(l[1]<=v[0])return c[x-1][1]=l[1],c;if(l[1]<=v[1])return c[x-1][1]=Math.max(l[1],v[1]),c.splice(x,1),c;c.splice(x,1),x--}else{if(l[1]<=v[0])return c.splice(x,0,l),c;if(l[1]<=v[1])return v[0]=Math.min(l[0],v[0]),c;l[0]<v[1]&&(v[0]=Math.min(l[0],v[0]),S=!0)}}return S?c[c.length-1][1]=l[1]:c.push(l),c}};n.CharacterJoinerService=r=d([_(0,b.IBufferService)],r)},160:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var p,w,b,o,r;function h(l){const S=l.toString(16);return S.length<2?"0"+S:S}function c(l,S){return l<S?(S+.05)/(l+.05):(l+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(S,x,v,y){return y!==void 0?`#${h(S)}${h(x)}${h(v)}${h(y)}`:`#${h(S)}${h(x)}${h(v)}`},l.toRgba=function(S,x,v,y=255){return(S<<24|x<<16|v<<8|y)>>>0},l.toColor=function(S,x,v,y){return{css:l.toCss(S,x,v,y),rgba:l.toRgba(S,x,v,y)}}})(p||(n.channels=p={})),(function(l){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:p.toCss(u,d,_,a),rgba:p.toRgba(u,d,_,a)}}l.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const y=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((y-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:p.toCss(u,d,_),rgba:p.toRgba(u,d,_)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,v,y){const m=r.ensureContrastRatio(x.rgba,v.rgba,y);if(m)return p.toColor(m>>24&255,m>>16&255,m>>8&255)},l.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:p.toCss(u,d,_),rgba:v}},l.opacity=S,l.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(w||(n.color=w={})),(function(l){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const y=v.getContext("2d",{willReadFrequently:!0});y&&(S=y,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),p.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const y=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return u=parseInt(y[1]),d=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),p.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,_,a),css:v}}})(b||(n.css=b={})),(function(l){function S(x,v,y){const m=x/255,C=v/255,L=y/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}l.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=S})(o||(n.rgb=o={})),(function(l){function S(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E>0||D>0||O>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}function x(v,y,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=y>>24&255,D=y>>16&255,O=y>>8&255,$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));for(;$<m&&(E<255||D<255||O<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),$=c(o.relativeLuminance2(E,D,O),o.relativeLuminance2(C,L,R));return(E<<24|D<<16|O<<8|255)>>>0}l.blend=function(v,y){if(a=(255&y)/255,a===1)return y;const m=y>>24&255,C=y>>16&255,L=y>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),p.toRgba(u,d,_)},l.ensureContrastRatio=function(v,y,m){const C=o.relativeLuminance(v>>8),L=o.relativeLuminance(y>>8);if(c(C,L)<m){if(L<C){const D=S(v,y,m),O=c(C,o.relativeLuminance(D>>8));if(O<m){const $=x(v,y,m);return O>c(C,o.relativeLuminance($>>8))?D:$}return D}const R=x(v,y,m),E=c(C,o.relativeLuminance(R>>8));if(E<m){const D=S(v,y,m);return E>c(C,o.relativeLuminance(D>>8))?R:D}return R}},l.reduceLuminance=S,l.increaseLuminance=x,l.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=c},345:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(F,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,p){this._data[_]||(this._data[_]={}),this._data[_][a]=p}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,p,w){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,p,w)}get(d,_,a,p){var w;return(w=this._data.get(d,_))==null?void 0:w.get(a,p)}clear(){this._data.clear()}}},399:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let b=0,o=0,r=w.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),o=Math.max(b,o),h=w.timeRemaining(),1.5*o>h)return r-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-b))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const b=Date.now()+w;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const o=new p;return o.setFromCharData(b),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(b[_.CHAR_DATA_CHAR_INDEX].length===2){const r=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|b[_.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=b[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},855:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let p=d;p<_;++p){let w=u[p];w>65535?(w-=65536,a+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):a+=String.fromCharCode(w)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,p=0;if(this._interim){const w=u.charCodeAt(p++);56320<=w&&w<=57343?d[a++]=1024*(this._interim-55296)+w-56320+65536:(d[a++]=this._interim,d[a++]=w),this._interim=0}for(let w=p;w<_;++w){const b=u.charCodeAt(w);if(55296<=b&&b<=56319){if(++w>=_)return this._interim=b,a;const o=u.charCodeAt(w);56320<=o&&o<=57343?d[a++]=1024*(b-55296)+o-56320+65536:(d[a++]=b,d[a++]=o)}else b!==65279&&(d[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,p,w,b,o=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,y=0;for(;(v=63&this.interim[++y])&&y<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-y;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[y++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[o++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[o++]=x):x<65536||x>1114111||(d[o++]=x)),this.interim.fill(0)}const c=_-4;let l=h;for(;l<_;){for(;!(!(l<c)||128&(a=u[l])||128&(p=u[l+1])||128&(w=u[l+2])||128&(b=u[l+3]));)d[o++]=a,d[o++]=p,d[o++]=w,d[o++]=b,l+=4;if(a=u[l++],a<128)d[o++]=a;else if((224&a)==192){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(r=(31&a)<<6|63&p,r<128){l--;continue}d[o++]=r}else if((240&a)==224){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(r=(15&a)<<12|(63&p)<<6|63&w,r<2048||r>=55296&&r<=57343||r===65279)continue;d[o++]=r}else if((248&a)==240){if(l>=_)return this.interim[0]=a,o;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,o;if(w=u[l++],(192&w)!=128){l--;continue}if(l>=_)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=w,o;if(b=u[l++],(192&b)!=128){l--;continue}if(r=(7&a)<<18|(63&p)<<12|(63&w)<<6|63&b,r<65536||r>1114111)continue;d[o++]=r}}return o}}},776:function(F,n,u){var d=this&&this.__decorate||function(r,h,c,l){var S,x=arguments.length,v=x<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,c,l);else for(var y=r.length-1;y>=0;y--)(S=r[y])&&(v=(x<3?S(v):x>3?S(h,c,v):S(h,c))||v);return x>3&&v&&Object.defineProperty(h,c,v),v},_=this&&this.__param||function(r,h){return function(c,l){h(c,l,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),p=u(97),w={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let b,o=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,c){this._evalLazyOptionalParams(c),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...c)}trace(r,...h){var c;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var c;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var c;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var c;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var c;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((c=this._optionsService.options.logger)==null?void 0:c.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=o=d([_(0,p.IOptionsService)],o),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,c){if(typeof c.value!="function")throw new Error("not supported");const l=c.value;c.value=function(...S){if(b.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,S);b.trace(`GlyphRenderer#${l.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=l.apply(this,S);return b.trace(`GlyphRenderer#${l.name} return`,x),x}}},726:(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(p,w,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,h){r[u]===r?r[d].push({id:o,index:h}):(r[d]=[{id:o,index:h}],r[u]=r)})(a,p,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(F,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},I={};function J(F){var n=I[F];if(n!==void 0)return n.exports;var u=I[F]={exports:{}};return X[F].call(u.exports,u,u.exports,J),u.exports}var ie={};return(()=>{var F=ie;Object.defineProperty(F,"__esModule",{value:!0}),F.CanvasAddon=void 0;const n=J(345),u=J(859),d=J(776),_=J(949);class a extends u.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}activate(w){const b=w._core;if(!w.element)return void this.register(b.onWillOpen((()=>this.activate(w))));this._terminal=w;const o=b.coreService,r=b.optionsService,h=b.screenElement,c=b.linkifier,l=b,S=l._bufferService,x=l._renderService,v=l._characterJoinerService,y=l._charSizeService,m=l._coreBrowserService,C=l._decorationService,L=l._logService,R=l._themeService;(0,d.setTraceLogger)(L),this._renderer=new _.CanvasRenderer(w,h,c,S,y,r,v,o,m,C,R),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),x.setRenderer(this._renderer),x.handleResize(S.cols,S.rows),this.register((0,u.toDisposable)((()=>{var E;x.setRenderer(this._terminal._core._createRenderer()),x.handleResize(w.cols,w.rows),(E=this._renderer)==null||E.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}F.CanvasAddon=a})(),ie})()))})(No)),No.exports}var og=lg();/**
115
115
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
116
116
  * @license MIT
117
117
  *
@@ -122,15 +122,15 @@ void main() {
122
122
  * Fabrice Bellard's javascript vt100 for jslinux:
123
123
  * http://bellard.org/jslinux/
124
124
  * Copyright (c) 2011 Fabrice Bellard
125
- */var cg=class{constructor(I,G,V,U={}){this._terminal=I,this._regex=G,this._handler=V,this._options=U}provideLinks(I,G){let V=ug.computeLink(I,this._regex,this._terminal,this._handler);G(this._addCallbacks(V))}_addCallbacks(I){return I.map(G=>(G.leave=this._options.leave,G.hover=(V,U)=>{if(this._options.hover){let{range:J}=G;this._options.hover(V,U,J)}},G))}};function hg(I){try{let G=new URL(I),V=G.password&&G.username?`${G.protocol}//${G.username}:${G.password}@${G.host}`:G.username?`${G.protocol}//${G.username}@${G.host}`:`${G.protocol}//${G.host}`;return I.toLocaleLowerCase().startsWith(V.toLocaleLowerCase())}catch{return!1}}var ug=class ua{static computeLink(G,V,U,J){let se=new RegExp(V.source,(V.flags||"")+"g"),[F,n]=ua._getWindowedLineStrings(G-1,U),u=F.join(""),d,_=[];for(;d=se.exec(u);){let a=d[0];if(!hg(a))continue;let[p,w]=ua._mapStrIdx(U,n,0,d.index),[b,o]=ua._mapStrIdx(U,p,w,a.length);if(p===-1||w===-1||b===-1||o===-1)continue;let r={start:{x:w+1,y:p+1},end:{x:o,y:b+1}};_.push({range:r,text:a,activate:J})}return _}static _getWindowedLineStrings(G,V){let U,J=G,se=G,F=0,n="",u=[];if(U=V.buffer.active.getLine(G)){let d=U.translateToString(!0);if(U.isWrapped&&d[0]!==" "){for(F=0;(U=V.buffer.active.getLine(--J))&&F<2048&&(n=U.translateToString(!0),F+=n.length,u.push(n),!(!U.isWrapped||n.indexOf(" ")!==-1)););u.reverse()}for(u.push(d),F=0;(U=V.buffer.active.getLine(++se))&&U.isWrapped&&F<2048&&(n=U.translateToString(!0),F+=n.length,u.push(n),n.indexOf(" ")===-1););}return[u,J]}static _mapStrIdx(G,V,U,J){let se=G.buffer.active,F=se.getNullCell(),n=U;for(;J;){let u=se.getLine(V);if(!u)return[-1,-1];for(let d=n;d<u.length;++d){u.getCell(d,F);let _=F.getChars();if(F.getWidth()&&(J-=_.length||1,d===u.length-1&&_==="")){let a=se.getLine(V+1);a&&a.isWrapped&&(a.getCell(0,F),F.getWidth()===2&&(J+=1))}if(J<0)return[V,d]}V++,n=0}return[V,n]}},dg=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function fg(I,G){let V=window.open();if(V){try{V.opener=null}catch{}V.location.href=G}else console.warn("Opening link blocked as opener could not be cleared")}var _g=class{constructor(I=fg,G={}){this._handler=I,this._options=G}activate(I){this._terminal=I;let G=this._options,V=G.urlRegex||dg;this._linkProvider=this._terminal.registerLinkProvider(new cg(this._terminal,V,this._handler,G))}dispose(){var I;(I=this._linkProvider)==null||I.dispose()}};const da=new RegExp("(?<![a-zA-Z]:\\/\\/)(?:^|[\\s\"'`(\\[{])([./]?[\\w./-]+\\.[a-zA-Z]{1,10})(?::(\\d+)(?::(\\d+))?|\\((\\d+),(\\d+)\\))?","g");function ff(I){return!(!/\.[a-zA-Z]{1,10}(?::\d+(?::\d+)?|\(\d+,\d+\))?$/.test(I)||/^https?:\/\//i.test(I)||/^[a-z0-9-]+\.(com|org|net|io|dev|app|co)$/i.test(I))}const vg=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC");class gg{constructor(G,V,U,J){this.terminal=G,this.onFileOpen=V,this.terminalId=U,this.decorationManager=J}provideLinks(G,V){const U=this.terminal.buffer.active.getLine(G-1);if(!U){V(void 0);return}const J=U.translateToString(),se=new RegExp(da.source,da.flags),F=[];let n;for(;(n=se.exec(J))!==null;){const u=n[1];if(!u||!ff(u))continue;const d=n[2]?parseInt(n[2],10):n[4]?parseInt(n[4],10):void 0,_=n[3]?parseInt(n[3],10):n[5]?parseInt(n[5],10):void 0,a=n[0],p=a.indexOf(u),w=n.index+p,b=n.index+a.length,o=w,r=G-1;F.push({range:{start:{x:w+1,y:G},end:{x:b,y:G}},text:a.substring(p),decorations:{pointerCursor:!0,underline:!0},activate:(h,c)=>{(vg?!h.metaKey:!h.ctrlKey)||this.onFileOpen(u,d,_,this.terminalId)},hover:()=>{var h;(h=this.decorationManager)==null||h.highlightAt(r,o)},leave:()=>{var h;(h=this.decorationManager)==null||h.unhighlightAll()}})}V(F.length>0?F:void 0)}}class pg{constructor(G){ha(this,"disposables",[]);ha(this,"entries",[]);ha(this,"lastScannedLine",-1);this.terminal=G,this.disposables.push(G.onWriteParsed(()=>this.scanNewLines()))}highlightAt(G,V){for(const U of this.entries)U.marker.line===G&&U.x===V&&U.element&&U.element.classList.add("file-path-decoration-hover")}unhighlightAll(){var G;for(const V of this.entries)(G=V.element)==null||G.classList.remove("file-path-decoration-hover")}scanNewLines(){const G=this.terminal.buffer.active,V=G.baseY+G.cursorY;for(let U=this.lastScannedLine+1;U<=V;U++)this.decorateLine(U);this.lastScannedLine=V}decorateLine(G){const V=this.terminal.buffer.active,U=V.getLine(G);if(!U)return;const J=U.translateToString(),se=new RegExp(da.source,da.flags);let F;for(;(F=se.exec(J))!==null;){const n=F[1];if(!n||!ff(n))continue;const u=F[0],d=u.indexOf(n),_=F.index+d,a=u.length-d,p=V.baseY+V.cursorY,w=G-p,b=this.terminal.registerMarker(w);if(!b||b.line===-1)continue;const o={marker:b,x:_},r=this.terminal.registerDecoration({marker:b,x:_,width:a});r&&(r.onRender(h=>{h.classList.add("file-path-decoration"),o.element=h}),this.disposables.push(r)),this.entries.push(o),this.disposables.push(b)}}dispose(){for(const G of this.disposables)G.dispose();this.disposables=[],this.entries=[],this.lastScannedLine=-1}}const mg=1;function ef(I,G){if(!I||I.readyState!==WebSocket.OPEN)return;const V=new TextEncoder().encode(G),U=new Uint8Array(1+V.length);U[0]=mg,U.set(V,1),I.send(U.buffer)}function Sg({wsRef:I,modifierRef:G}){const[V,U]=we.useState(null);we.useEffect(()=>(G.current.clearCallback=()=>U(null),()=>{G.current.clearCallback=null}),[G]);const J=we.useCallback(u=>{u.preventDefault(),ef(I.current,"\x1B")},[I]),se=we.useCallback(u=>{u.preventDefault(),ef(I.current," ")},[I]),F=we.useCallback(u=>{u.preventDefault();const d=V==="ctrl"?null:"ctrl";U(d),G.current.ctrl=d==="ctrl",G.current.cmd=!1},[V,G]),n=we.useCallback(u=>{u.preventDefault();const d=V==="cmd"?null:"cmd";U(d),G.current.cmd=d==="cmd",G.current.ctrl=!1},[V,G]);return Q.jsxs("div",{className:"virtual-keyboard",role:"toolbar","aria-label":"Virtual modifier keys",children:[Q.jsx("button",{className:"virtual-key",onPointerDown:J,tabIndex:-1,children:"Esc"}),Q.jsx("button",{className:"virtual-key",onPointerDown:se,tabIndex:-1,children:"Tab"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${V==="ctrl"?" virtual-key-active":""}`,onPointerDown:F,tabIndex:-1,"aria-pressed":V==="ctrl",children:"Ctrl"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${V==="cmd"?" virtual-key-active":""}`,onPointerDown:n,tabIndex:-1,"aria-pressed":V==="cmd",children:"Cmd"})]})}const Cg=0,_f=1,vf=["image/png","image/jpeg","image/gif","image/webp","image/bmp"];async function yg(I){var V;if(!((V=navigator.clipboard)!=null&&V.read))return!1;let G=!1;try{const U=await navigator.clipboard.read();for(const J of U){const se=J.types.find(F=>vf.includes(F));if(se){G=!0;const F=await J.getType(se);I.write(`\r
126
- \x1B[90m[Uploading image...]\x1B[0m`);const{path:n}=await of(F);return I.write("\r\x1B[2K"),I.paste(n),!0}}}catch{if(G)return I.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
127
- `),!0}return!1}async function bg(I){var G;if(!await yg(I))try{const V=await((G=navigator.clipboard)==null?void 0:G.readText());V&&I.paste(V)}catch{}}function wg(I,G){var U;const V=(U=I.clipboardData)==null?void 0:U.items;if(V){for(const J of Array.from(V))if(vf.includes(J.type)){const se=J.getAsFile();if(!se)continue;I.preventDefault(),G.write(`\r
128
- \x1B[90m[Uploading image...]\x1B[0m`),of(se).then(({path:F})=>{G.write("\r\x1B[2K"),G.paste(F)}).catch(()=>{G.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
129
- `)});return}}}function tf({wsPath:I,onFileOpen:G,persistent:V}){const U=we.useRef(null),J=we.useRef(null),se=we.useRef(null),F=we.useRef(null),n=we.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=cf(`(max-width: ${af}px)`);return we.useEffect(()=>{if(!U.current)return;const d=new ig.Terminal({cursorBlink:!0,fontSize:13,lineHeight:1,fontFamily:'Menlo, Monaco, "Courier New", monospace',customGlyphs:!0,scrollback:5e4,theme:{background:"#1a1a1a",foreground:"#e0e0e0",cursor:"#ffffff"},allowProposedApi:!0});J.current=d;const _=new rg.FitAddon;F.current=_,d.loadAddon(_),d.open(U.current);const a=()=>{try{d.loadAddon(new og.CanvasAddon)}catch{}};try{const B=new ag.WebglAddon;B.onContextLoss(()=>{B.dispose(),a()}),d.loadAddon(B)}catch{a()}const p=new _g((B,q)=>{B.preventDefault(),window.open(q,"_blank")});d.loadAddon(p);const w=I.split("/").pop();let b=null,o=null;if(G){o=new pg(d);const B=new gg(d,(q,K,oe,ce)=>{G(q,K,oe,ce)},w,o);b=d.registerLinkProvider(B)}const r=navigator.platform.toUpperCase().includes("MAC");d.attachCustomKeyEventHandler(B=>{if(B.type!=="keydown")return!0;if(B.key==="Enter"&&B.shiftKey)return B.preventDefault(),d.paste(`\\
130
- `),!1;if(!(r?B.metaKey:B.ctrlKey&&B.shiftKey))return!0;if(B.key==="c"||B.key==="C"){const K=d.getSelection();return K?(B.preventDefault(),navigator.clipboard.writeText(K).catch(()=>{}),!1):!0}return B.key==="v"||B.key==="V"?(B.preventDefault(),bg(d),!1):!0});const h=B=>wg(B,d);U.current.addEventListener("paste",h);let c=null;const l=()=>{c&&clearTimeout(c),c=setTimeout(()=>{c=null,_.fit()},150)};_.fit();const S=setTimeout(l,300),v=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${I}`,y=new WebSocket(v);y.binaryType="arraybuffer",se.current=y;let m="",C=!0,L=null;const A=B=>(B=B.replace(/\x1b\[[\?>][\d;]*c/g,""),B=B.replace(/\[[\?>][\d;]*c/g,""),B),E=()=>{if(C=!1,L=null,m){const B=A(m);B&&d.write(B),m=""}l()};y.onopen=()=>{sf(y,"resize",{cols:d.cols,rows:d.rows})},y.onmessage=B=>{const q=new Uint8Array(B.data);if(q.length===0)return;const K=q[0],oe=q.subarray(1);if(K===_f){const ce=new TextDecoder().decode(oe);if(C)m+=ce,L||(L=setTimeout(E,500));else{const W=A(ce);W&&d.write(W)}}},y.onclose=()=>{d.write(`\r
125
+ */var cg=class{constructor(P,W,X,I={}){this._terminal=P,this._regex=W,this._handler=X,this._options=I}provideLinks(P,W){let X=ug.computeLink(P,this._regex,this._terminal,this._handler);W(this._addCallbacks(X))}_addCallbacks(P){return P.map(W=>(W.leave=this._options.leave,W.hover=(X,I)=>{if(this._options.hover){let{range:J}=W;this._options.hover(X,I,J)}},W))}};function hg(P){try{let W=new URL(P),X=W.password&&W.username?`${W.protocol}//${W.username}:${W.password}@${W.host}`:W.username?`${W.protocol}//${W.username}@${W.host}`:`${W.protocol}//${W.host}`;return P.toLocaleLowerCase().startsWith(X.toLocaleLowerCase())}catch{return!1}}var ug=class ua{static computeLink(W,X,I,J){let ie=new RegExp(X.source,(X.flags||"")+"g"),[F,n]=ua._getWindowedLineStrings(W-1,I),u=F.join(""),d,_=[];for(;d=ie.exec(u);){let a=d[0];if(!hg(a))continue;let[p,w]=ua._mapStrIdx(I,n,0,d.index),[b,o]=ua._mapStrIdx(I,p,w,a.length);if(p===-1||w===-1||b===-1||o===-1)continue;let r={start:{x:w+1,y:p+1},end:{x:o,y:b+1}};_.push({range:r,text:a,activate:J})}return _}static _getWindowedLineStrings(W,X){let I,J=W,ie=W,F=0,n="",u=[];if(I=X.buffer.active.getLine(W)){let d=I.translateToString(!0);if(I.isWrapped&&d[0]!==" "){for(F=0;(I=X.buffer.active.getLine(--J))&&F<2048&&(n=I.translateToString(!0),F+=n.length,u.push(n),!(!I.isWrapped||n.indexOf(" ")!==-1)););u.reverse()}for(u.push(d),F=0;(I=X.buffer.active.getLine(++ie))&&I.isWrapped&&F<2048&&(n=I.translateToString(!0),F+=n.length,u.push(n),n.indexOf(" ")===-1););}return[u,J]}static _mapStrIdx(W,X,I,J){let ie=W.buffer.active,F=ie.getNullCell(),n=I;for(;J;){let u=ie.getLine(X);if(!u)return[-1,-1];for(let d=n;d<u.length;++d){u.getCell(d,F);let _=F.getChars();if(F.getWidth()&&(J-=_.length||1,d===u.length-1&&_==="")){let a=ie.getLine(X+1);a&&a.isWrapped&&(a.getCell(0,F),F.getWidth()===2&&(J+=1))}if(J<0)return[X,d]}X++,n=0}return[X,n]}},dg=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function fg(P,W){let X=window.open();if(X){try{X.opener=null}catch{}X.location.href=W}else console.warn("Opening link blocked as opener could not be cleared")}var _g=class{constructor(P=fg,W={}){this._handler=P,this._options=W}activate(P){this._terminal=P;let W=this._options,X=W.urlRegex||dg;this._linkProvider=this._terminal.registerLinkProvider(new cg(this._terminal,X,this._handler,W))}dispose(){var P;(P=this._linkProvider)==null||P.dispose()}};const da=new RegExp("(?<![a-zA-Z]:\\/\\/)(?:^|[\\s\"'`(\\[{])([./]?[\\w./-]+\\.[a-zA-Z]{1,10})(?::(\\d+)(?::(\\d+))?|\\((\\d+),(\\d+)\\))?","g");function ff(P){return!(!/\.[a-zA-Z]{1,10}(?::\d+(?::\d+)?|\(\d+,\d+\))?$/.test(P)||/^https?:\/\//i.test(P)||/^[a-z0-9-]+\.(com|org|net|io|dev|app|co)$/i.test(P))}const vg=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC");class gg{constructor(W,X,I,J){this.terminal=W,this.onFileOpen=X,this.terminalId=I,this.decorationManager=J}provideLinks(W,X){const I=this.terminal.buffer.active.getLine(W-1);if(!I){X(void 0);return}const J=I.translateToString(),ie=new RegExp(da.source,da.flags),F=[];let n;for(;(n=ie.exec(J))!==null;){const u=n[1];if(!u||!ff(u))continue;const d=n[2]?parseInt(n[2],10):n[4]?parseInt(n[4],10):void 0,_=n[3]?parseInt(n[3],10):n[5]?parseInt(n[5],10):void 0,a=n[0],p=a.indexOf(u),w=n.index+p,b=n.index+a.length,o=w,r=W-1;F.push({range:{start:{x:w+1,y:W},end:{x:b,y:W}},text:a.substring(p),decorations:{pointerCursor:!0,underline:!0},activate:(h,c)=>{(vg?!h.metaKey:!h.ctrlKey)||this.onFileOpen(u,d,_,this.terminalId)},hover:()=>{var h;(h=this.decorationManager)==null||h.highlightAt(r,o)},leave:()=>{var h;(h=this.decorationManager)==null||h.unhighlightAll()}})}X(F.length>0?F:void 0)}}class pg{constructor(W){ha(this,"disposables",[]);ha(this,"entries",[]);ha(this,"lastScannedLine",-1);this.terminal=W,this.disposables.push(W.onWriteParsed(()=>this.scanNewLines()))}highlightAt(W,X){for(const I of this.entries)I.marker.line===W&&I.x===X&&I.element&&I.element.classList.add("file-path-decoration-hover")}unhighlightAll(){var W;for(const X of this.entries)(W=X.element)==null||W.classList.remove("file-path-decoration-hover")}scanNewLines(){const W=this.terminal.buffer.active,X=W.baseY+W.cursorY;for(let I=this.lastScannedLine+1;I<=X;I++)this.decorateLine(I);this.lastScannedLine=X}decorateLine(W){const X=this.terminal.buffer.active,I=X.getLine(W);if(!I)return;const J=I.translateToString(),ie=new RegExp(da.source,da.flags);let F;for(;(F=ie.exec(J))!==null;){const n=F[1];if(!n||!ff(n))continue;const u=F[0],d=u.indexOf(n),_=F.index+d,a=u.length-d,p=X.baseY+X.cursorY,w=W-p,b=this.terminal.registerMarker(w);if(!b||b.line===-1)continue;const o={marker:b,x:_},r=this.terminal.registerDecoration({marker:b,x:_,width:a});r&&(r.onRender(h=>{h.classList.add("file-path-decoration"),o.element=h}),this.disposables.push(r)),this.entries.push(o),this.disposables.push(b)}}dispose(){for(const W of this.disposables)W.dispose();this.disposables=[],this.entries=[],this.lastScannedLine=-1}}const mg=1;function ef(P,W){if(!P||P.readyState!==WebSocket.OPEN)return;const X=new TextEncoder().encode(W),I=new Uint8Array(1+X.length);I[0]=mg,I.set(X,1),P.send(I.buffer)}function Sg({wsRef:P,modifierRef:W}){const[X,I]=we.useState(null);we.useEffect(()=>(W.current.clearCallback=()=>I(null),()=>{W.current.clearCallback=null}),[W]);const J=we.useCallback(u=>{u.preventDefault(),ef(P.current,"\x1B")},[P]),ie=we.useCallback(u=>{u.preventDefault(),ef(P.current," ")},[P]),F=we.useCallback(u=>{u.preventDefault();const d=X==="ctrl"?null:"ctrl";I(d),W.current.ctrl=d==="ctrl",W.current.cmd=!1},[X,W]),n=we.useCallback(u=>{u.preventDefault();const d=X==="cmd"?null:"cmd";I(d),W.current.cmd=d==="cmd",W.current.ctrl=!1},[X,W]);return Q.jsxs("div",{className:"virtual-keyboard",role:"toolbar","aria-label":"Virtual modifier keys",children:[Q.jsx("button",{className:"virtual-key",onPointerDown:J,tabIndex:-1,children:"Esc"}),Q.jsx("button",{className:"virtual-key",onPointerDown:ie,tabIndex:-1,children:"Tab"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${X==="ctrl"?" virtual-key-active":""}`,onPointerDown:F,tabIndex:-1,"aria-pressed":X==="ctrl",children:"Ctrl"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${X==="cmd"?" virtual-key-active":""}`,onPointerDown:n,tabIndex:-1,"aria-pressed":X==="cmd",children:"Cmd"})]})}const Cg=0,_f=1,vf=["image/png","image/jpeg","image/gif","image/webp","image/bmp"];async function yg(P){var X;if(!((X=navigator.clipboard)!=null&&X.read))return!1;let W=!1;try{const I=await navigator.clipboard.read();for(const J of I){const ie=J.types.find(F=>vf.includes(F));if(ie){W=!0;const F=await J.getType(ie);P.write(`\r
126
+ \x1B[90m[Uploading image...]\x1B[0m`);const{path:n}=await of(F);return P.write("\r\x1B[2K"),P.paste(n),!0}}}catch{if(W)return P.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
127
+ `),!0}return!1}async function bg(P){var W;if(!await yg(P))try{const X=await((W=navigator.clipboard)==null?void 0:W.readText());X&&P.paste(X)}catch{}}function wg(P,W){var I;const X=(I=P.clipboardData)==null?void 0:I.items;if(X){for(const J of Array.from(X))if(vf.includes(J.type)){const ie=J.getAsFile();if(!ie)continue;P.preventDefault(),W.write(`\r
128
+ \x1B[90m[Uploading image...]\x1B[0m`),of(ie).then(({path:F})=>{W.write("\r\x1B[2K"),W.paste(F)}).catch(()=>{W.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
129
+ `)});return}}}function tf({wsPath:P,onFileOpen:W,persistent:X}){const I=we.useRef(null),J=we.useRef(null),ie=we.useRef(null),F=we.useRef(null),n=we.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=cf(`(max-width: ${af}px)`);return we.useEffect(()=>{if(!I.current)return;const d=new ig.Terminal({cursorBlink:!0,fontSize:13,lineHeight:1,fontFamily:'Menlo, Monaco, "Courier New", monospace',customGlyphs:!0,scrollback:5e4,theme:{background:"#1a1a1a",foreground:"#e0e0e0",cursor:"#ffffff"},allowProposedApi:!0});J.current=d;const _=new rg.FitAddon;F.current=_,d.loadAddon(_),d.open(I.current);const a=()=>{try{d.loadAddon(new og.CanvasAddon)}catch{}};try{const z=new ag.WebglAddon;z.onContextLoss(()=>{z.dispose(),a()}),d.loadAddon(z)}catch{a()}const p=new _g((z,M)=>{z.preventDefault(),window.open(M,"_blank")});d.loadAddon(p);const w=P.split("/").pop();let b=null,o=null;if(W){o=new pg(d);const z=new gg(d,(M,B,T,k)=>{W(M,B,T,k)},w,o);b=d.registerLinkProvider(z)}const r=navigator.platform.toUpperCase().includes("MAC");d.attachCustomKeyEventHandler(z=>{if(z.type!=="keydown")return!0;if(z.key==="Enter"&&z.shiftKey)return z.preventDefault(),d.paste(`\\
130
+ `),!1;if(!(r?z.metaKey:z.ctrlKey&&z.shiftKey))return!0;if(z.key==="c"||z.key==="C"){const B=d.getSelection();return B?(z.preventDefault(),navigator.clipboard.writeText(B).catch(()=>{}),!1):!0}return z.key==="v"||z.key==="V"?(z.preventDefault(),bg(d),!1):!0});const h=z=>wg(z,d);I.current.addEventListener("paste",h);let c=null;const l=()=>{c&&clearTimeout(c),c=setTimeout(()=>{c=null,_.fit()},150)};_.fit();const S=setTimeout(l,300),v=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${P}`,y=new WebSocket(v);y.binaryType="arraybuffer",ie.current=y;let m="",C=!0,L=null;const R=z=>(z=z.replace(/\x1b\[[\?>][\d;]*c/g,""),z=z.replace(/\[[\?>][\d;]*c/g,""),z),E=()=>{if(C=!1,L=null,m){const z=R(m);z&&d.write(z),m=""}l()};y.onopen=()=>{sf(y,"resize",{cols:d.cols,rows:d.rows})},y.onmessage=z=>{const M=new Uint8Array(z.data);if(M.length===0)return;const B=M[0],T=M.subarray(1);if(B===_f){const k=new TextDecoder().decode(T);if(C)m+=k,L||(L=setTimeout(E,500));else{const V=R(k);V&&d.write(V)}}},y.onclose=()=>{d.write(`\r
131
131
  \x1B[90m[Terminal disconnected]\x1B[0m\r
132
132
  `)},y.onerror=()=>{d.write(`\r
133
133
  \x1B[31m[WebSocket error]\x1B[0m\r
134
- `)};const R=d.textarea;let k=!1,$=null,N="",P=0;const j=()=>{k=!0},D=()=>{$&&clearTimeout($),$=setTimeout(()=>{k=!1},100)};R&&(R.addEventListener("compositionstart",j),R.addEventListener("compositionend",D)),d.onData(B=>{var K,oe,ce,W,z,re;if(y.readyState!==WebSocket.OPEN)return;if(k){const ee=Date.now();if(B===N&&ee-P<100)return;N=B,P=ee}if(C){const ee=B.replace(/\x1b\[[\?>][\d;]*c/g,"").replace(/\x1b\[\d+;\d+R/g,"").replace(/\x1b\[\?[\d;]*\$y/g,"");if(!ee)return;B=ee}const q=n.current;if((q.ctrl||q.cmd)&&B.length===1){const ee=B.charCodeAt(0);if(q.ctrl)ee>=97&&ee<=122?B=String.fromCharCode(ee-96):ee>=65&&ee<=90&&(B=String.fromCharCode(ee-64)),q.ctrl=!1,q.cmd=!1,(K=q.clearCallback)==null||K.call(q);else if(q.cmd){const ve=B.toLowerCase();if(ve==="v"){(oe=navigator.clipboard)==null||oe.readText().then(fe=>{fe&&d.paste(fe)}).catch(()=>{}),q.ctrl=!1,q.cmd=!1,(ce=q.clearCallback)==null||ce.call(q);return}if(ve==="c"){const fe=d.getSelection();fe&&((W=navigator.clipboard)==null||W.writeText(fe).catch(()=>{})),q.ctrl=!1,q.cmd=!1,(z=q.clearCallback)==null||z.call(q);return}q.ctrl=!1,q.cmd=!1,(re=q.clearCallback)==null||re.call(q)}}xg(y,B)}),d.onResize(({cols:B,rows:q})=>{y.readyState===WebSocket.OPEN&&sf(y,"resize",{cols:B,rows:q})});const O=new ResizeObserver(l);O.observe(U.current);const T=()=>{document.hidden||l()};return document.addEventListener("visibilitychange",T),()=>{var B;clearTimeout(S),c&&clearTimeout(c),L&&clearTimeout(L),$&&clearTimeout($),R&&(R.removeEventListener("compositionstart",j),R.removeEventListener("compositionend",D)),o==null||o.dispose(),b==null||b.dispose(),(B=U.current)==null||B.removeEventListener("paste",h),O.disconnect(),document.removeEventListener("visibilitychange",T),y.close(),d.dispose(),J.current=null,se.current=null,F.current=null}},[I]),Q.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[V===!1&&Q.jsx("div",{style:{backgroundColor:"#3a2a00",color:"#ffcc00",padding:"4px 12px",fontSize:"12px",flexShrink:0},children:"Session persistence unavailable — this terminal will not survive a restart"}),u&&Q.jsx(Sg,{wsRef:se,modifierRef:n}),Q.jsx("div",{ref:U,className:"terminal-container",style:{width:"100%",flex:1,backgroundColor:"#1a1a1a"}})]})}function xg(I,G){const V=new TextEncoder().encode(G),U=new Uint8Array(1+V.length);U[0]=_f,U.set(V,1),I.send(U.buffer)}function sf(I,G,V){const U=JSON.stringify({type:G,payload:V}),J=new TextEncoder().encode(U),se=new Uint8Array(1+J.length);se[0]=Cg,se.set(J,1),I.send(se.buffer)}function Lg(I,G){const V=I.replace(/^\//,"");return G.staged.some(U=>V.endsWith(U)||U.endsWith(V))?{indicator:"A",className:"git-staged"}:G.modified.some(U=>V.endsWith(U)||U.endsWith(V))?{indicator:"M",className:"git-modified"}:G.untracked.some(U=>V.endsWith(U)||U.endsWith(V))?{indicator:"?",className:"git-untracked"}:null}function gf({entry:I,expanded:G,gitStatus:V,onToggle:U,onOpen:J,depth:se=0}){var d;const F=I.type==="directory",n=G.has(I.path),u=F?null:Lg(I.path,V);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{className:`file-node ${F?"directory":"file"}`,style:{paddingLeft:`${se*16+8}px`},onClick:()=>F?U(I.path):J(I.path),role:"treeitem","aria-expanded":F?n:void 0,tabIndex:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),F?U(I.path):J(I.path))},children:[Q.jsx("span",{className:"file-icon",children:F?n?"📂":"📁":"📄"}),Q.jsx("span",{className:"file-name",children:I.name}),u&&Q.jsx("span",{className:`git-indicator ${u.className}`,children:u.indicator})]}),F&&n&&((d=I.children)==null?void 0:d.map(_=>Q.jsx(gf,{entry:_,expanded:G,gitStatus:V,onToggle:U,onOpen:J,depth:se+1},_.path)))]})}function pf(I,G=[]){for(const V of I)V.type==="file"&&G.push(V),V.children&&pf(V.children,G);return G}function Eg({onRefresh:I}){const[G,V]=we.useState([]),[U,J]=we.useState(new Set),[se,F]=we.useState(null),[n,u]=we.useState(!1),[d,_]=we.useState({modified:[],staged:[],untracked:[]}),[a,p]=we.useState([]),[w,b]=we.useState(""),[o,r]=we.useState(!1),h=we.useRef(null),c=we.useCallback(async()=>{try{const E=await Vv();V(E),F(null),u(!0)}catch(E){F(E.message)}},[]),l=we.useCallback(async()=>{try{const E=await Yv();_(E)}catch(E){console.error("Failed to load git status:",E)}},[]),S=we.useCallback(async()=>{try{const E=await Kv();p(E)}catch(E){console.error("Failed to load recent files:",E)}},[]);we.useEffect(()=>{n||(c(),l(),S())},[n,c,l,S]),we.useEffect(()=>{const E=setInterval(()=>{c(),l()},5e3);return()=>clearInterval(E)},[c,l]);const x=E=>{J(R=>{const k=new Set(R);return k.has(E)?k.delete(E):k.add(E),k})},v=async E=>{try{await lf(E),I(),S()}catch(R){console.error("Failed to open file:",R)}},y=we.useMemo(()=>pf(G),[G]),m=we.useMemo(()=>{if(!w.trim())return[];const E=w.toLowerCase();return y.filter(R=>R.name.toLowerCase().includes(E)||R.path.toLowerCase().includes(E)).slice(0,10)},[y,w]),C=E=>{b(E.target.value),r(!0)},L=E=>{E.key==="Escape"?(r(!1),b("")):E.key==="Enter"&&m.length>0&&(v(m[0].path),b(""),r(!1))},A=E=>{v(E),b(""),r(!1)};return se?Q.jsxs("div",{className:"file-tree-error",children:["Error: ",se]}):n?Q.jsxs("div",{className:"file-tree-container",children:[Q.jsxs("div",{className:"file-search",children:[Q.jsx("input",{ref:h,type:"text",className:"file-search-input",placeholder:"Search files...",value:w,onChange:C,onKeyDown:L,onFocus:()=>r(!0),onBlur:()=>setTimeout(()=>r(!1),200)}),o&&m.length>0&&Q.jsx("div",{className:"file-search-suggestions",children:m.map(E=>Q.jsxs("div",{className:"file-search-suggestion",onMouseDown:()=>A(E.path),children:[Q.jsx("span",{className:"suggestion-name",children:E.name}),Q.jsx("span",{className:"suggestion-path",children:E.path})]},E.path))})]}),a.length>0&&Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Recent"}),a.map(E=>Q.jsxs("div",{className:"file-node file recent-file",style:{paddingLeft:"8px"},onClick:()=>v(E.path),role:"treeitem",tabIndex:0,onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(E.path))},children:[Q.jsx("span",{className:"file-icon",children:"🕐"}),Q.jsx("span",{className:"file-name",children:E.name}),Q.jsx("span",{className:"file-path-hint",children:E.relativePath})]},E.id))]}),Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Files"}),Q.jsx("div",{className:"file-tree",role:"tree","aria-label":"Project files",children:G.map(E=>Q.jsx(gf,{entry:E,expanded:U,gitStatus:d,onToggle:x,onOpen:v},E.path))})]})]}):Q.jsx("div",{className:"file-tree-loading",children:"Loading files..."})}function Uo({title:I,className:G,defaultOpen:V=!0,actions:U,children:J}){const[se,F]=we.useState(V);return Q.jsxs("div",{className:`dashboard-section${se?"":" collapsed"}${G?" "+G:""}`,children:[Q.jsxs("div",{className:"dashboard-section-header",onClick:()=>F(!se),children:[Q.jsxs("h3",{children:[Q.jsx("span",{className:"collapse-icon",children:"▼"})," ",I]}),U&&Q.jsx("div",{className:"header-actions",onClick:n=>n.stopPropagation(),children:U})]}),se&&Q.jsx("div",{className:"dashboard-section-content",children:J})]})}function Mg(I){const G={},V=I.split(`
135
- `);for(const U of V){const J=U.match(/^\s*-?\s*(\w+):\s*(.*)$/);if(!J)continue;const[,se,F]=J;let n=F.trim();if((n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1)),se==="files"){G.files={};continue}if(se==="spec"||se==="plan"||se==="review"){G.files||(G.files={}),G.files[se]=n==="null"?null:n;continue}if(se==="timestamps"){G.timestamps={};continue}if(["conceived_at","specified_at","planned_at","implementing_at","implemented_at","committed_at","integrated_at"].includes(se)){G.timestamps||(G.timestamps={}),G.timestamps[se]=n==="null"?null:n;continue}if(se==="dependencies"||se==="tags"||se==="ticks"){if(n.startsWith("[")&&n.endsWith("]")){const d=n.slice(1,-1).trim();G[se]=d===""?[]:d.split(",").map(_=>_.trim().replace(/^["']|["']$/g,""))}else G[se]=[];continue}n!=="null"&&(G[se]=n)}return G}const Ag=new Set(["conceived","specified","planned","implementing","implemented","committed","integrated","abandoned","on-hold"]);function Rg(I){return!(!I.id||I.id==="NNNN"||!/^\d{4}$/.test(I.id)||!I.status||!Ag.has(I.status)||!I.title||I.tags&&I.tags.includes("example"))}function Dg(I){const G=[],V=/```yaml\n([\s\S]*?)```/g;let U;for(;(U=V.exec(I))!==null;){const se=U[1].split(/\n(?=\s*- id:)/);for(const F of se){if(!F.trim()||!F.includes("id:"))continue;const n=Mg(F);n&&Rg(n)&&G.push(n)}}return G}const Po=["conceived","specified","planned","implementing","implemented","committed","integrated"],Tg=["CONC'D","SPEC'D","PLANNED","IMPL'ING","IMPL'D","CMTD","INTGR'D"],Bg=new Set(["conceived","specified","planned","implementing","implemented","committed"]),mf=new Set(["abandoned","on-hold"]);function jo(I){var U;if(I.status!=="integrated")return!1;const G=(U=I.timestamps)==null?void 0:U.integrated_at;if(!G)return!1;const V=new Date(G);return isNaN(V.getTime())?!1:(Date.now()-V.getTime())/(1e3*60*60)<=72}function fa(I){const G=Po.indexOf(I);return G>=0?G:-1}function rf(I,G){var V,U,J;switch(G){case"specified":return(V=I.files)!=null&&V.spec?{label:"Spec",link:I.files.spec}:{label:"",link:null};case"planned":return(U=I.files)!=null&&U.plan?{label:"Plan",link:I.files.plan}:{label:"",link:null};case"implemented":return(J=I.files)!=null&&J.review?{label:"Revw",link:I.files.review}:{label:"",link:null};case"committed":{if(I.notes){const se=I.notes.match(/PR\s*#?(\d+)/i);if(se)return{label:"PR",link:`https://github.com/cluesmith/codev/pull/${se[1]}`,external:!0}}return{label:"",link:null}}default:return{label:"",link:null}}}function Og({project:I,stage:G}){const V=fa(I.status),U=fa(G);if(U<V){const J=rf(I,G);return Q.jsxs("td",{className:"project-stage",children:[Q.jsx("span",{className:"checkmark",children:"✓"}),J.label&&J.link&&(J.external?Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:J.link,target:"_blank",rel:"noreferrer",children:J.label})]}):Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:"#",onClick:se=>{se.preventDefault(),er(J.link)},children:J.label})]}))]})}if(U===V){if(G==="integrated"&&jo(I))return Q.jsx("td",{className:"project-stage",children:Q.jsx("span",{className:"celebration",children:"🎉"})});const J=rf(I,G);return Q.jsxs("td",{className:"project-stage",children:[Q.jsx("span",{className:"current-indicator"}),J.label&&J.link&&(J.external?Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:J.link,target:"_blank",rel:"noreferrer",children:J.label})]}):Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:"#",onClick:se=>{se.preventDefault(),er(J.link)},children:J.label})]}))]})}return Q.jsx("td",{className:"project-stage"})}async function er(I){try{const G=_a();await fetch(`${G}api/tabs/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:I})})}catch{}}function kg({project:I}){const G=mf.has(I.status);return Q.jsxs("tr",{className:`project-row status-${I.status}`,children:[Q.jsxs("td",{className:"project-cell",children:[Q.jsx("span",{className:"project-id",children:I.id}),Q.jsxs("span",{className:"project-title",children:[I.title,G&&Q.jsxs("span",{className:"project-terminal-status",children:[" (",I.status,")"]})]})]}),G?Po.map(V=>Q.jsx("td",{className:"project-stage"},V)):Po.map(V=>Q.jsx(Og,{project:I,stage:V},V))]})}function Io({projects:I}){return I.length===0?Q.jsx("p",{style:{color:"var(--text-muted)",textAlign:"center",padding:20},children:"No projects"}):Q.jsxs("table",{className:"project-table",children:[Q.jsx("thead",{children:Q.jsxs("tr",{children:[Q.jsx("th",{style:{textAlign:"left"},children:"Project"}),Tg.map(G=>Q.jsx("th",{className:"stage-header",children:G},G))]})}),Q.jsx("tbody",{children:I.map(G=>Q.jsx(kg,{project:G},G.id))})]})}function Hg({projects:I}){const G=I.filter(J=>Bg.has(J.status)||jo(J));G.sort((J,se)=>{const F=fa(J.status),n=fa(se.status);return n!==F?n-F:J.id.localeCompare(se.id)});const V=I.filter(J=>J.status==="integrated"&&!jo(J)),U=I.filter(J=>mf.has(J.status));return Q.jsxs(Q.Fragment,{children:[(G.length>0||V.length===0)&&Q.jsxs("details",{className:"project-section",open:!0,children:[Q.jsxs("summary",{children:["Active ",Q.jsxs("span",{className:"section-count",children:["(",G.length,")"]})]}),Q.jsx(Io,{projects:G})]}),V.length>0&&Q.jsxs("details",{className:"project-section",children:[Q.jsxs("summary",{children:["Completed ",Q.jsxs("span",{className:"section-count",children:["(",V.length,")"]})]}),Q.jsx(Io,{projects:V})]}),U.length>0&&Q.jsxs("details",{className:"project-section",children:[Q.jsxs("summary",{children:["Terminal ",Q.jsxs("span",{className:"section-count",children:["(",U.length,")"]})]}),Q.jsx(Io,{projects:U})]})]})}function zg({state:I,onRefresh:G,onSelectTab:V}){const[U,J]=we.useState([]),[se,F]=we.useState(null);if(we.useEffect(()=>{let a="";const p=()=>{const b=_a();fetch(`${b}file?path=codev/projectlist.md`).then(async o=>{if(!o.ok){if(o.status===404){J([]);return}throw new Error(`HTTP ${o.status}`)}const r=await o.text(),h=r.length+":"+r.slice(0,100);h!==a&&(a=h,J(Dg(r)),F(null))}).catch(o=>F(o.message))};p();const w=setInterval(p,5e3);return()=>clearInterval(w)},[]),!I)return Q.jsx("div",{className:"dashboard-container",children:Q.jsx("p",{style:{color:"var(--text-muted)",padding:16},children:"Loading..."})});const n=async()=>{try{await Gv(),G()}catch(a){console.error("Failed to create shell:",a)}},u=I.builders??[],d=(I.utils??[]).filter(a=>a.terminalId||a.pid&&a.pid!==0),_=I.annotations??[];return Q.jsxs("div",{className:"dashboard-container",children:[Q.jsxs("div",{className:"projects-info",children:[Q.jsx("h1",{style:{fontSize:20,marginBottom:12,color:"var(--text-primary)"},children:"Agent Farm Dashboard"}),Q.jsxs("p",{children:["Coordinate AI builders working on your codebase. The left panel shows the Architect terminal – tell it what you want to build. ",Q.jsx("strong",{children:"Tabs"})," shows open terminals (Architect, Builders, utility shells)."," ",Q.jsx("strong",{children:"Files"})," lets you browse and open project files. ",Q.jsx("strong",{children:"Projects"})," tracks work as it moves from conception to integration."]}),Q.jsxs("p",{children:["Docs:"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/cheatsheet.md")},children:"Cheatsheet"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/lifecycle.md")},children:"Lifecycle"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/commands/overview.md")},children:"CLI Reference"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/protocols/spir/protocol.md")},children:"SPIR Protocol"})," ·"," ",Q.jsx("a",{href:"https://github.com/cluesmith/codev#readme",target:"_blank",rel:"noreferrer",children:"README"})," ·"," ",Q.jsx("a",{href:"https://discord.gg/mJ92DhDa6n",target:"_blank",rel:"noreferrer",children:"Discord"})]})]}),Q.jsxs("div",{className:"dashboard-header",children:[Q.jsx(Uo,{title:"Tabs",className:"section-tabs",actions:Q.jsx("button",{onClick:n,children:"+ Shell"}),children:Q.jsxs("div",{className:"dashboard-tabs-list",children:[I.architect&&Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>V==null?void 0:V("architect"),children:[Q.jsx("span",{className:"tab-icon",children:"🏗️"}),Q.jsx("span",{className:"tab-name",children:"Architect"})]}),u.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>V==null?void 0:V(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"🔨"}),Q.jsx("span",{className:"tab-name",children:a.name}),Q.jsx("span",{className:`status-dot status-${a.status}`})]},a.id)),d.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>V==null?void 0:V(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"💻"}),Q.jsx("span",{className:"tab-name",children:a.name})]},a.id)),_.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>V==null?void 0:V(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"📄"}),Q.jsx("span",{className:"tab-name",children:a.file.split("/").pop()})]},a.id)),!I.architect&&u.length===0&&d.length===0&&_.length===0&&Q.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic",fontSize:12,padding:"4px 8px"},children:"No tabs open"})]})}),Q.jsx(Uo,{title:"Files",className:"section-files",children:Q.jsx(Eg,{onRefresh:G})})]}),Q.jsx(Uo,{title:"Projects",className:"section-projects",children:se?Q.jsxs("div",{className:"projects-error",children:[Q.jsx("span",{children:se}),Q.jsx("button",{onClick:()=>window.location.reload(),children:"Retry"})]}):U.length===0?Q.jsx("div",{className:"projects-welcome",children:Q.jsx("p",{children:"No projects yet. Ask the Architect to create your first project."})}):Q.jsx(Hg,{projects:U})})]})}function Ng({tabs:I,activeTabId:G,onSelectTab:V,onRefresh:U,children:J}){return Q.jsxs("div",{className:"mobile-layout",children:[Q.jsx(hf,{tabs:I,activeTabId:G,onSelectTab:V,onRefresh:U}),Q.jsx("div",{className:"mobile-content",children:J})]})}function Ug({tabId:I,initialLine:G}){let U=`${_a()}api/annotate/${I}/`;return G&&(U+=`?line=${G}`),Q.jsx("div",{className:"file-viewer",style:{width:"100%",height:"100%"},children:Q.jsx("iframe",{src:U,style:{width:"100%",height:"100%",border:"none"},title:"File Annotator"})})}function Ig(I){if(I<0)return"0m";const G=Math.floor(I/6e4);if(G<60)return`${G}m`;const V=Math.floor(G/60),U=G%60;return U>0?`${V}h ${U}m`:`${V}h`}function nf({gateStatus:I}){const[G,V]=we.useState(Date.now());if(we.useEffect(()=>{if(!(I!=null&&I.hasGate)||!I.requestedAt)return;const u=setInterval(()=>V(Date.now()),3e4);return()=>clearInterval(u)},[I==null?void 0:I.hasGate,I==null?void 0:I.requestedAt]),!(I!=null&&I.hasGate))return null;const{gateName:U,builderId:J,requestedAt:se}=I,F=`porch approve ${J} ${U}`;let n=null;if(se){const u=G-Date.parse(se);n=Ig(u)}return Q.jsxs("div",{className:"gate-banner",role:"alert",children:[Q.jsxs("span",{className:"gate-banner-message",children:[Q.jsx("span",{className:"gate-banner-icon","aria-hidden":"true",children:"⚠"})," ","Builder ",J," blocked on ",Q.jsx("strong",{children:U})]}),n!==null&&Q.jsxs("span",{className:"gate-banner-wait",children:["waiting ",n]}),Q.jsx("code",{className:"gate-banner-cmd",children:F})]})}function Pg(){var h,c,l,S;const{state:I,refresh:G}=Qv(),{tabs:V,activeTab:U,activeTabId:J,selectTab:se}=Jv(I),F=cf(`(max-width: ${af}px)`),[n,u]=we.useState(new Set),d=we.useRef(new Map),_=we.useCallback(async(x,v,y,m)=>{try{const C=await lf(x,v,m);v&&v>0&&d.current.set(C.id,v),G()}catch(C){console.error("Failed to open file:",C)}},[G]);we.useEffect(()=>{I!=null&&I.projectName?document.title=`${I.projectName} Agent Farm`:document.title="Agent Farm"},[I==null?void 0:I.projectName]);const[a]=we.useState(()=>new URLSearchParams(window.location.search).get("fullscreen")==="1");we.useEffect(()=>{if(!U)return;(U.type==="architect"||U.type==="builder"||U.type==="shell")&&u(v=>{if(v.has(U.id))return v;const y=new Set(v);return y.add(U.id),y})},[U==null?void 0:U.id,U==null?void 0:U.type]);const p=x=>{const v=Yd(x);return v?Q.jsx(tf,{wsPath:v,onFileOpen:_,persistent:x.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},w=x=>{if(!x.annotationId||!I)return Q.jsx("div",{className:"no-terminal",children:"No file viewer"});if(!I.annotations.find(m=>m.id===x.annotationId))return Q.jsx("div",{className:"no-terminal",children:"Annotation not found"});const y=d.current.get(x.annotationId);return y!==void 0&&d.current.delete(x.annotationId),Q.jsx(Ug,{tabId:x.annotationId,initialLine:y??x.initialLine})},b=x=>{const v=V.filter(y=>x.includes(y.type)&&n.has(y.id));return Q.jsxs(Q.Fragment,{children:[v.map(y=>{const m=Yd(y);return Q.jsx("div",{className:"terminal-tab-pane",style:{display:J===y.id?void 0:"none"},children:m?Q.jsx(tf,{wsPath:m,onFileOpen:_,persistent:y.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},y.id)}),(U==null?void 0:U.type)==="dashboard"&&Q.jsx(zg,{state:I,onRefresh:G,onSelectTab:se}),(U==null?void 0:U.type)==="file"&&w(U)]})};if(a)return U&&(U.type==="architect"||U.type==="builder"||U.type==="shell")?Q.jsx("div",{className:"fullscreen-terminal",children:p(U)}):Q.jsx("div",{className:"fullscreen-terminal"});if(F)return Q.jsxs("div",{className:"mobile-wrapper",children:[Q.jsx(nf,{gateStatus:I==null?void 0:I.gateStatus}),Q.jsx(Ng,{tabs:V,activeTabId:J,onSelectTab:se,onRefresh:G,children:b(["architect","builder","shell"])})]});const o=V.find(x=>x.type==="architect"),r=o?p(o):Q.jsx("div",{className:"no-architect",children:"No architect terminal"});return Q.jsxs("div",{className:"app",children:[Q.jsxs("header",{className:"app-header",children:[Q.jsx("h1",{className:"app-title",children:"Agent Farm"}),Q.jsx("div",{className:"header-meta",children:Q.jsxs("span",{className:"builder-count",children:[((h=I==null?void 0:I.builders)==null?void 0:h.length)??0," builder(s)"]})})]}),Q.jsx(nf,{gateStatus:I==null?void 0:I.gateStatus}),Q.jsx("div",{className:"app-body",children:Q.jsx(eg,{left:r,right:Q.jsxs("div",{className:"right-panel",children:[Q.jsx(hf,{tabs:V.filter(x=>x.type!=="architect"),activeTabId:J,onSelectTab:se,onRefresh:G}),Q.jsx("div",{className:"tab-content",role:"tabpanel",children:b(["builder","shell"])})]})})}),Q.jsxs("footer",{className:"status-bar",children:[Q.jsxs("span",{children:[((c=I==null?void 0:I.builders)==null?void 0:c.length)??0," builders"]}),Q.jsxs("span",{children:[((l=I==null?void 0:I.utils)==null?void 0:l.length)??0," shells"]}),Q.jsxs("span",{children:[((S=I==null?void 0:I.annotations)==null?void 0:S.length)??0," files"]})]})]})}$v.createRoot(document.getElementById("root")).render(Q.jsx(we.StrictMode,{children:Q.jsx(Pg,{})}));
136
- //# sourceMappingURL=index-CH_utkcW.js.map
134
+ `)};const D=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);let O="",$=0;d.onData(z=>{var B,T,k,V,K,ue;if(y.readyState!==WebSocket.OPEN)return;if(D){const le=Date.now();if(z===O&&le-$<150)return;O=z,$=le}if(C){const le=z.replace(/\x1b\[[\?>][\d;]*c/g,"").replace(/\x1b\[\d+;\d+R/g,"").replace(/\x1b\[\?[\d;]*\$y/g,"");if(!le)return;z=le}const M=n.current;if((M.ctrl||M.cmd)&&z.length===1){const le=z.charCodeAt(0);if(M.ctrl)le>=97&&le<=122?z=String.fromCharCode(le-96):le>=65&&le<=90&&(z=String.fromCharCode(le-64)),M.ctrl=!1,M.cmd=!1,(B=M.clearCallback)==null||B.call(M);else if(M.cmd){const q=z.toLowerCase();if(q==="v"){(T=navigator.clipboard)==null||T.readText().then(N=>{N&&d.paste(N)}).catch(()=>{}),M.ctrl=!1,M.cmd=!1,(k=M.clearCallback)==null||k.call(M);return}if(q==="c"){const N=d.getSelection();N&&((V=navigator.clipboard)==null||V.writeText(N).catch(()=>{})),M.ctrl=!1,M.cmd=!1,(K=M.clearCallback)==null||K.call(M);return}M.ctrl=!1,M.cmd=!1,(ue=M.clearCallback)==null||ue.call(M)}}xg(y,z)}),d.onResize(({cols:z,rows:M})=>{y.readyState===WebSocket.OPEN&&sf(y,"resize",{cols:z,rows:M})});const U=new ResizeObserver(l);U.observe(I.current);const j=()=>{document.hidden||l()};return document.addEventListener("visibilitychange",j),()=>{var z;clearTimeout(S),c&&clearTimeout(c),L&&clearTimeout(L),o==null||o.dispose(),b==null||b.dispose(),(z=I.current)==null||z.removeEventListener("paste",h),U.disconnect(),document.removeEventListener("visibilitychange",j),y.close(),d.dispose(),J.current=null,ie.current=null,F.current=null}},[P]),Q.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[X===!1&&Q.jsx("div",{style:{backgroundColor:"#3a2a00",color:"#ffcc00",padding:"4px 12px",fontSize:"12px",flexShrink:0},children:"Session persistence unavailable — this terminal will not survive a restart"}),Q.jsx("div",{ref:I,className:"terminal-container",style:{width:"100%",flex:1,backgroundColor:"#1a1a1a"}}),u&&Q.jsx(Sg,{wsRef:ie,modifierRef:n})]})}function xg(P,W){const X=new TextEncoder().encode(W),I=new Uint8Array(1+X.length);I[0]=_f,I.set(X,1),P.send(I.buffer)}function sf(P,W,X){const I=JSON.stringify({type:W,payload:X}),J=new TextEncoder().encode(I),ie=new Uint8Array(1+J.length);ie[0]=Cg,ie.set(J,1),P.send(ie.buffer)}function Lg(P,W){const X=P.replace(/^\//,"");return W.staged.some(I=>X.endsWith(I)||I.endsWith(X))?{indicator:"A",className:"git-staged"}:W.modified.some(I=>X.endsWith(I)||I.endsWith(X))?{indicator:"M",className:"git-modified"}:W.untracked.some(I=>X.endsWith(I)||I.endsWith(X))?{indicator:"?",className:"git-untracked"}:null}function gf({entry:P,expanded:W,gitStatus:X,onToggle:I,onOpen:J,depth:ie=0}){var d;const F=P.type==="directory",n=W.has(P.path),u=F?null:Lg(P.path,X);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{className:`file-node ${F?"directory":"file"}`,style:{paddingLeft:`${ie*16+8}px`},onClick:()=>F?I(P.path):J(P.path),role:"treeitem","aria-expanded":F?n:void 0,tabIndex:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),F?I(P.path):J(P.path))},children:[Q.jsx("span",{className:"file-icon",children:F?n?"📂":"📁":"📄"}),Q.jsx("span",{className:"file-name",children:P.name}),u&&Q.jsx("span",{className:`git-indicator ${u.className}`,children:u.indicator})]}),F&&n&&((d=P.children)==null?void 0:d.map(_=>Q.jsx(gf,{entry:_,expanded:W,gitStatus:X,onToggle:I,onOpen:J,depth:ie+1},_.path)))]})}function pf(P,W=[]){for(const X of P)X.type==="file"&&W.push(X),X.children&&pf(X.children,W);return W}function Eg({onRefresh:P}){const[W,X]=we.useState([]),[I,J]=we.useState(new Set),[ie,F]=we.useState(null),[n,u]=we.useState(!1),[d,_]=we.useState({modified:[],staged:[],untracked:[]}),[a,p]=we.useState([]),[w,b]=we.useState(""),[o,r]=we.useState(!1),h=we.useRef(null),c=we.useCallback(async()=>{try{const E=await Vv();X(E),F(null),u(!0)}catch(E){F(E.message)}},[]),l=we.useCallback(async()=>{try{const E=await Yv();_(E)}catch(E){console.error("Failed to load git status:",E)}},[]),S=we.useCallback(async()=>{try{const E=await Kv();p(E)}catch(E){console.error("Failed to load recent files:",E)}},[]);we.useEffect(()=>{n||(c(),l(),S())},[n,c,l,S]),we.useEffect(()=>{const E=setInterval(()=>{c(),l()},5e3);return()=>clearInterval(E)},[c,l]);const x=E=>{J(D=>{const O=new Set(D);return O.has(E)?O.delete(E):O.add(E),O})},v=async E=>{try{await lf(E),P(),S()}catch(D){console.error("Failed to open file:",D)}},y=we.useMemo(()=>pf(W),[W]),m=we.useMemo(()=>{if(!w.trim())return[];const E=w.toLowerCase();return y.filter(D=>D.name.toLowerCase().includes(E)||D.path.toLowerCase().includes(E)).slice(0,10)},[y,w]),C=E=>{b(E.target.value),r(!0)},L=E=>{E.key==="Escape"?(r(!1),b("")):E.key==="Enter"&&m.length>0&&(v(m[0].path),b(""),r(!1))},R=E=>{v(E),b(""),r(!1)};return ie?Q.jsxs("div",{className:"file-tree-error",children:["Error: ",ie]}):n?Q.jsxs("div",{className:"file-tree-container",children:[Q.jsxs("div",{className:"file-search",children:[Q.jsx("input",{ref:h,type:"text",className:"file-search-input",placeholder:"Search files...",value:w,onChange:C,onKeyDown:L,onFocus:()=>r(!0),onBlur:()=>setTimeout(()=>r(!1),200)}),o&&m.length>0&&Q.jsx("div",{className:"file-search-suggestions",children:m.map(E=>Q.jsxs("div",{className:"file-search-suggestion",onMouseDown:()=>R(E.path),children:[Q.jsx("span",{className:"suggestion-name",children:E.name}),Q.jsx("span",{className:"suggestion-path",children:E.path})]},E.path))})]}),a.length>0&&Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Recent"}),a.map(E=>Q.jsxs("div",{className:"file-node file recent-file",style:{paddingLeft:"8px"},onClick:()=>v(E.path),role:"treeitem",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),v(E.path))},children:[Q.jsx("span",{className:"file-icon",children:"🕐"}),Q.jsx("span",{className:"file-name",children:E.name}),Q.jsx("span",{className:"file-path-hint",children:E.relativePath})]},E.id))]}),Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Files"}),Q.jsx("div",{className:"file-tree",role:"tree","aria-label":"Project files",children:W.map(E=>Q.jsx(gf,{entry:E,expanded:I,gitStatus:d,onToggle:x,onOpen:v},E.path))})]})]}):Q.jsx("div",{className:"file-tree-loading",children:"Loading files..."})}function Uo({title:P,className:W,defaultOpen:X=!0,actions:I,children:J}){const[ie,F]=we.useState(X);return Q.jsxs("div",{className:`dashboard-section${ie?"":" collapsed"}${W?" "+W:""}`,children:[Q.jsxs("div",{className:"dashboard-section-header",onClick:()=>F(!ie),children:[Q.jsxs("h3",{children:[Q.jsx("span",{className:"collapse-icon",children:"▼"})," ",P]}),I&&Q.jsx("div",{className:"header-actions",onClick:n=>n.stopPropagation(),children:I})]}),ie&&Q.jsx("div",{className:"dashboard-section-content",children:J})]})}function Mg(P){const W={},X=P.split(`
135
+ `);for(const I of X){const J=I.match(/^\s*-?\s*(\w+):\s*(.*)$/);if(!J)continue;const[,ie,F]=J;let n=F.trim();if((n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1)),ie==="files"){W.files={};continue}if(ie==="spec"||ie==="plan"||ie==="review"){W.files||(W.files={}),W.files[ie]=n==="null"?null:n;continue}if(ie==="timestamps"){W.timestamps={};continue}if(["conceived_at","specified_at","planned_at","implementing_at","implemented_at","committed_at","integrated_at"].includes(ie)){W.timestamps||(W.timestamps={}),W.timestamps[ie]=n==="null"?null:n;continue}if(ie==="dependencies"||ie==="tags"||ie==="ticks"){if(n.startsWith("[")&&n.endsWith("]")){const d=n.slice(1,-1).trim();W[ie]=d===""?[]:d.split(",").map(_=>_.trim().replace(/^["']|["']$/g,""))}else W[ie]=[];continue}n!=="null"&&(W[ie]=n)}return W}const Ag=new Set(["conceived","specified","planned","implementing","implemented","committed","integrated","abandoned","on-hold"]);function Rg(P){return!(!P.id||P.id==="NNNN"||!/^\d{4}$/.test(P.id)||!P.status||!Ag.has(P.status)||!P.title||P.tags&&P.tags.includes("example"))}function Dg(P){const W=[],X=/```yaml\n([\s\S]*?)```/g;let I;for(;(I=X.exec(P))!==null;){const ie=I[1].split(/\n(?=\s*- id:)/);for(const F of ie){if(!F.trim()||!F.includes("id:"))continue;const n=Mg(F);n&&Rg(n)&&W.push(n)}}return W}const Po=["conceived","specified","planned","implementing","implemented","committed","integrated"],Tg=["CONC'D","SPEC'D","PLANNED","IMPL'ING","IMPL'D","CMTD","INTGR'D"],Bg=new Set(["conceived","specified","planned","implementing","implemented","committed"]),mf=new Set(["abandoned","on-hold"]);function jo(P){var I;if(P.status!=="integrated")return!1;const W=(I=P.timestamps)==null?void 0:I.integrated_at;if(!W)return!1;const X=new Date(W);return isNaN(X.getTime())?!1:(Date.now()-X.getTime())/(1e3*60*60)<=72}function fa(P){const W=Po.indexOf(P);return W>=0?W:-1}function rf(P,W){var X,I,J;switch(W){case"specified":return(X=P.files)!=null&&X.spec?{label:"Spec",link:P.files.spec}:{label:"",link:null};case"planned":return(I=P.files)!=null&&I.plan?{label:"Plan",link:P.files.plan}:{label:"",link:null};case"implemented":return(J=P.files)!=null&&J.review?{label:"Revw",link:P.files.review}:{label:"",link:null};case"committed":{if(P.notes){const ie=P.notes.match(/PR\s*#?(\d+)/i);if(ie)return{label:"PR",link:`https://github.com/cluesmith/codev/pull/${ie[1]}`,external:!0}}return{label:"",link:null}}default:return{label:"",link:null}}}function Og({project:P,stage:W}){const X=fa(P.status),I=fa(W);if(I<X){const J=rf(P,W);return Q.jsxs("td",{className:"project-stage",children:[Q.jsx("span",{className:"checkmark",children:"✓"}),J.label&&J.link&&(J.external?Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:J.link,target:"_blank",rel:"noreferrer",children:J.label})]}):Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:"#",onClick:ie=>{ie.preventDefault(),er(J.link)},children:J.label})]}))]})}if(I===X){if(W==="integrated"&&jo(P))return Q.jsx("td",{className:"project-stage",children:Q.jsx("span",{className:"celebration",children:"🎉"})});const J=rf(P,W);return Q.jsxs("td",{className:"project-stage",children:[Q.jsx("span",{className:"current-indicator"}),J.label&&J.link&&(J.external?Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:J.link,target:"_blank",rel:"noreferrer",children:J.label})]}):Q.jsxs(Q.Fragment,{children:[" ",Q.jsx("a",{href:"#",onClick:ie=>{ie.preventDefault(),er(J.link)},children:J.label})]}))]})}return Q.jsx("td",{className:"project-stage"})}async function er(P){try{const W=_a();await fetch(`${W}api/tabs/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:P})})}catch{}}function kg({project:P}){const W=mf.has(P.status);return Q.jsxs("tr",{className:`project-row status-${P.status}`,children:[Q.jsxs("td",{className:"project-cell",children:[Q.jsx("span",{className:"project-id",children:P.id}),Q.jsxs("span",{className:"project-title",children:[P.title,W&&Q.jsxs("span",{className:"project-terminal-status",children:[" (",P.status,")"]})]})]}),W?Po.map(X=>Q.jsx("td",{className:"project-stage"},X)):Po.map(X=>Q.jsx(Og,{project:P,stage:X},X))]})}function Io({projects:P}){return P.length===0?Q.jsx("p",{style:{color:"var(--text-muted)",textAlign:"center",padding:20},children:"No projects"}):Q.jsxs("table",{className:"project-table",children:[Q.jsx("thead",{children:Q.jsxs("tr",{children:[Q.jsx("th",{style:{textAlign:"left"},children:"Project"}),Tg.map(W=>Q.jsx("th",{className:"stage-header",children:W},W))]})}),Q.jsx("tbody",{children:P.map(W=>Q.jsx(kg,{project:W},W.id))})]})}function Hg({projects:P}){const W=P.filter(J=>Bg.has(J.status)||jo(J));W.sort((J,ie)=>{const F=fa(J.status),n=fa(ie.status);return n!==F?n-F:J.id.localeCompare(ie.id)});const X=P.filter(J=>J.status==="integrated"&&!jo(J)),I=P.filter(J=>mf.has(J.status));return Q.jsxs(Q.Fragment,{children:[(W.length>0||X.length===0)&&Q.jsxs("details",{className:"project-section",open:!0,children:[Q.jsxs("summary",{children:["Active ",Q.jsxs("span",{className:"section-count",children:["(",W.length,")"]})]}),Q.jsx(Io,{projects:W})]}),X.length>0&&Q.jsxs("details",{className:"project-section",children:[Q.jsxs("summary",{children:["Completed ",Q.jsxs("span",{className:"section-count",children:["(",X.length,")"]})]}),Q.jsx(Io,{projects:X})]}),I.length>0&&Q.jsxs("details",{className:"project-section",children:[Q.jsxs("summary",{children:["Terminal ",Q.jsxs("span",{className:"section-count",children:["(",I.length,")"]})]}),Q.jsx(Io,{projects:I})]})]})}function zg({state:P,onRefresh:W,onSelectTab:X}){const[I,J]=we.useState([]),[ie,F]=we.useState(null);if(we.useEffect(()=>{let a="";const p=()=>{const b=_a();fetch(`${b}file?path=codev/projectlist.md`).then(async o=>{if(!o.ok){if(o.status===404){J([]);return}throw new Error(`HTTP ${o.status}`)}const r=await o.text(),h=r.length+":"+r.slice(0,100);h!==a&&(a=h,J(Dg(r)),F(null))}).catch(o=>F(o.message))};p();const w=setInterval(p,5e3);return()=>clearInterval(w)},[]),!P)return Q.jsx("div",{className:"dashboard-container",children:Q.jsx("p",{style:{color:"var(--text-muted)",padding:16},children:"Loading..."})});const n=async()=>{try{await Gv(),W()}catch(a){console.error("Failed to create shell:",a)}},u=P.builders??[],d=(P.utils??[]).filter(a=>a.terminalId||a.pid&&a.pid!==0),_=P.annotations??[];return Q.jsxs("div",{className:"dashboard-container",children:[Q.jsxs("div",{className:"projects-info",children:[Q.jsx("h1",{style:{fontSize:20,marginBottom:12,color:"var(--text-primary)"},children:"Agent Farm Dashboard"}),Q.jsxs("p",{children:["Coordinate AI builders working on your codebase. The left panel shows the Architect terminal – tell it what you want to build. ",Q.jsx("strong",{children:"Tabs"})," shows open terminals (Architect, Builders, utility shells)."," ",Q.jsx("strong",{children:"Files"})," lets you browse and open project files. ",Q.jsx("strong",{children:"Projects"})," tracks work as it moves from conception to integration."]}),Q.jsxs("p",{children:["Docs:"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/cheatsheet.md")},children:"Cheatsheet"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/lifecycle.md")},children:"Lifecycle"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/resources/commands/overview.md")},children:"CLI Reference"})," ·"," ",Q.jsx("a",{href:"#",onClick:a=>{a.preventDefault(),er("codev/protocols/spir/protocol.md")},children:"SPIR Protocol"})," ·"," ",Q.jsx("a",{href:"https://github.com/cluesmith/codev#readme",target:"_blank",rel:"noreferrer",children:"README"})," ·"," ",Q.jsx("a",{href:"https://discord.gg/mJ92DhDa6n",target:"_blank",rel:"noreferrer",children:"Discord"})]})]}),Q.jsxs("div",{className:"dashboard-header",children:[Q.jsx(Uo,{title:"Tabs",className:"section-tabs",actions:Q.jsx("button",{onClick:n,children:"+ Shell"}),children:Q.jsxs("div",{className:"dashboard-tabs-list",children:[P.architect&&Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>X==null?void 0:X("architect"),children:[Q.jsx("span",{className:"tab-icon",children:"🏗️"}),Q.jsx("span",{className:"tab-name",children:"Architect"})]}),u.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>X==null?void 0:X(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"🔨"}),Q.jsx("span",{className:"tab-name",children:a.name}),Q.jsx("span",{className:`status-dot status-${a.status}`})]},a.id)),d.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>X==null?void 0:X(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"💻"}),Q.jsx("span",{className:"tab-name",children:a.name})]},a.id)),_.map(a=>Q.jsxs("div",{className:"dashboard-tab-item",onClick:()=>X==null?void 0:X(a.id),children:[Q.jsx("span",{className:"tab-icon",children:"📄"}),Q.jsx("span",{className:"tab-name",children:a.file.split("/").pop()})]},a.id)),!P.architect&&u.length===0&&d.length===0&&_.length===0&&Q.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic",fontSize:12,padding:"4px 8px"},children:"No tabs open"})]})}),Q.jsx(Uo,{title:"Files",className:"section-files",children:Q.jsx(Eg,{onRefresh:W})})]}),Q.jsx(Uo,{title:"Projects",className:"section-projects",children:ie?Q.jsxs("div",{className:"projects-error",children:[Q.jsx("span",{children:ie}),Q.jsx("button",{onClick:()=>window.location.reload(),children:"Retry"})]}):I.length===0?Q.jsx("div",{className:"projects-welcome",children:Q.jsx("p",{children:"No projects yet. Ask the Architect to create your first project."})}):Q.jsx(Hg,{projects:I})})]})}function Ng({tabs:P,activeTabId:W,onSelectTab:X,onRefresh:I,children:J}){return Q.jsxs("div",{className:"mobile-layout",children:[Q.jsx(hf,{tabs:P,activeTabId:W,onSelectTab:X,onRefresh:I}),Q.jsx("div",{className:"mobile-content",children:J})]})}function Ug({tabId:P,initialLine:W}){let I=`${_a()}api/annotate/${P}/`;return W&&(I+=`?line=${W}`),Q.jsx("div",{className:"file-viewer",style:{width:"100%",height:"100%"},children:Q.jsx("iframe",{src:I,style:{width:"100%",height:"100%",border:"none"},title:"File Annotator"})})}function Ig(P){if(P<0)return"0m";const W=Math.floor(P/6e4);if(W<60)return`${W}m`;const X=Math.floor(W/60),I=W%60;return I>0?`${X}h ${I}m`:`${X}h`}function nf({gateStatus:P}){const[W,X]=we.useState(Date.now());if(we.useEffect(()=>{if(!(P!=null&&P.hasGate)||!P.requestedAt)return;const u=setInterval(()=>X(Date.now()),3e4);return()=>clearInterval(u)},[P==null?void 0:P.hasGate,P==null?void 0:P.requestedAt]),!(P!=null&&P.hasGate))return null;const{gateName:I,builderId:J,requestedAt:ie}=P,F=`porch approve ${J} ${I}`;let n=null;if(ie){const u=W-Date.parse(ie);n=Ig(u)}return Q.jsxs("div",{className:"gate-banner",role:"alert",children:[Q.jsxs("span",{className:"gate-banner-message",children:[Q.jsx("span",{className:"gate-banner-icon","aria-hidden":"true",children:"⚠"})," ","Builder ",J," blocked on ",Q.jsx("strong",{children:I})]}),n!==null&&Q.jsxs("span",{className:"gate-banner-wait",children:["waiting ",n]}),Q.jsx("code",{className:"gate-banner-cmd",children:F})]})}function Pg(){var h,c,l,S;const{state:P,refresh:W}=Qv(),{tabs:X,activeTab:I,activeTabId:J,selectTab:ie}=Jv(P),F=cf(`(max-width: ${af}px)`),[n,u]=we.useState(new Set),d=we.useRef(new Map),_=we.useCallback(async(x,v,y,m)=>{try{const C=await lf(x,v,m);v&&v>0&&d.current.set(C.id,v),W()}catch(C){console.error("Failed to open file:",C)}},[W]);we.useEffect(()=>{P!=null&&P.projectName?document.title=`${P.projectName} Agent Farm`:document.title="Agent Farm"},[P==null?void 0:P.projectName]);const[a]=we.useState(()=>new URLSearchParams(window.location.search).get("fullscreen")==="1");we.useEffect(()=>{if(!I)return;(I.type==="architect"||I.type==="builder"||I.type==="shell")&&u(v=>{if(v.has(I.id))return v;const y=new Set(v);return y.add(I.id),y})},[I==null?void 0:I.id,I==null?void 0:I.type]);const p=x=>{const v=Yd(x);return v?Q.jsx(tf,{wsPath:v,onFileOpen:_,persistent:x.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},w=x=>{if(!x.annotationId||!P)return Q.jsx("div",{className:"no-terminal",children:"No file viewer"});if(!P.annotations.find(m=>m.id===x.annotationId))return Q.jsx("div",{className:"no-terminal",children:"Annotation not found"});const y=d.current.get(x.annotationId);return y!==void 0&&d.current.delete(x.annotationId),Q.jsx(Ug,{tabId:x.annotationId,initialLine:y??x.initialLine})},b=x=>{const v=X.filter(y=>x.includes(y.type)&&n.has(y.id));return Q.jsxs(Q.Fragment,{children:[v.map(y=>{const m=Yd(y);return Q.jsx("div",{className:"terminal-tab-pane",style:{display:J===y.id?void 0:"none"},children:m?Q.jsx(tf,{wsPath:m,onFileOpen:_,persistent:y.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},y.id)}),(I==null?void 0:I.type)==="dashboard"&&Q.jsx(zg,{state:P,onRefresh:W,onSelectTab:ie}),(I==null?void 0:I.type)==="file"&&w(I)]})};if(a)return I&&(I.type==="architect"||I.type==="builder"||I.type==="shell")?Q.jsx("div",{className:"fullscreen-terminal",children:p(I)}):Q.jsx("div",{className:"fullscreen-terminal"});if(F)return Q.jsxs("div",{className:"mobile-wrapper",children:[Q.jsx(nf,{gateStatus:P==null?void 0:P.gateStatus}),Q.jsx(Ng,{tabs:X,activeTabId:J,onSelectTab:ie,onRefresh:W,children:b(["architect","builder","shell"])})]});const o=X.find(x=>x.type==="architect"),r=o?p(o):Q.jsx("div",{className:"no-architect",children:"No architect terminal"});return Q.jsxs("div",{className:"app",children:[Q.jsxs("header",{className:"app-header",children:[Q.jsx("h1",{className:"app-title",children:"Agent Farm"}),Q.jsx("div",{className:"header-meta",children:Q.jsxs("span",{className:"builder-count",children:[((h=P==null?void 0:P.builders)==null?void 0:h.length)??0," builder(s)"]})})]}),Q.jsx(nf,{gateStatus:P==null?void 0:P.gateStatus}),Q.jsx("div",{className:"app-body",children:Q.jsx(eg,{left:r,right:Q.jsxs("div",{className:"right-panel",children:[Q.jsx(hf,{tabs:X.filter(x=>x.type!=="architect"),activeTabId:J,onSelectTab:ie,onRefresh:W}),Q.jsx("div",{className:"tab-content",role:"tabpanel",children:b(["builder","shell"])})]})})}),Q.jsxs("footer",{className:"status-bar",children:[Q.jsxs("span",{children:[((c=P==null?void 0:P.builders)==null?void 0:c.length)??0," builders"]}),Q.jsxs("span",{children:[((l=P==null?void 0:P.utils)==null?void 0:l.length)??0," shells"]}),Q.jsxs("span",{children:[((S=P==null?void 0:P.annotations)==null?void 0:S.length)??0," files"]})]})]})}$v.createRoot(document.getElementById("root")).render(Q.jsx(we.StrictMode,{children:Q.jsx(Pg,{})}));
136
+ //# sourceMappingURL=index-b38SaXk5.js.map