@cluesmith/codev 2.0.13 → 2.0.15

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 (48) hide show
  1. package/dashboard/dist/assets/index-2EEvbgZv.css +32 -0
  2. package/dashboard/dist/assets/index-BYfmVwKi.js +134 -0
  3. package/dashboard/dist/assets/index-BYfmVwKi.js.map +1 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +33 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/bench.d.ts +49 -0
  9. package/dist/agent-farm/commands/bench.d.ts.map +1 -0
  10. package/dist/agent-farm/commands/bench.js +262 -0
  11. package/dist/agent-farm/commands/bench.js.map +1 -0
  12. package/dist/agent-farm/commands/spawn-roles.d.ts +1 -0
  13. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
  15. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  16. package/dist/agent-farm/commands/spawn.js +45 -13
  17. package/dist/agent-farm/commands/spawn.js.map +1 -1
  18. package/dist/agent-farm/servers/overview.js +1 -1
  19. package/dist/agent-farm/servers/overview.js.map +1 -1
  20. package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
  21. package/dist/agent-farm/servers/send-buffer.js +3 -1
  22. package/dist/agent-farm/servers/send-buffer.js.map +1 -1
  23. package/dist/agent-farm/servers/tower-routes.js +5 -3
  24. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  25. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  26. package/dist/agent-farm/servers/tower-websocket.js +31 -3
  27. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  28. package/dist/cli.d.ts.map +1 -1
  29. package/dist/cli.js +47 -1
  30. package/dist/cli.js.map +1 -1
  31. package/dist/commands/consult/index.d.ts.map +1 -1
  32. package/dist/commands/consult/index.js +14 -6
  33. package/dist/commands/consult/index.js.map +1 -1
  34. package/dist/commands/update.d.ts +16 -3
  35. package/dist/commands/update.d.ts.map +1 -1
  36. package/dist/commands/update.js +248 -212
  37. package/dist/commands/update.js.map +1 -1
  38. package/dist/terminal/pty-session.d.ts +7 -0
  39. package/dist/terminal/pty-session.d.ts.map +1 -1
  40. package/dist/terminal/pty-session.js +13 -0
  41. package/dist/terminal/pty-session.js.map +1 -1
  42. package/dist/terminal/ws-protocol.d.ts +1 -1
  43. package/dist/terminal/ws-protocol.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/skeleton/.claude/skills/codev/SKILL.md +2 -1
  46. package/dashboard/dist/assets/index-8O8nCk_X.js +0 -135
  47. package/dashboard/dist/assets/index-8O8nCk_X.js.map +0 -1
  48. package/dashboard/dist/assets/index-DCQyWOPv.css +0 -32
@@ -0,0 +1,134 @@
1
+ var Av=Object.defineProperty;var Rv=(I,W,$)=>W in I?Av(I,W,{enumerable:!0,configurable:!0,writable:!0,value:$}):I[W]=$;var ha=(I,W,$)=>Rv(I,typeof W!="symbol"?W+"":W,$);(function(){const W=document.createElement("link").relList;if(W&&W.supports&&W.supports("modulepreload"))return;for(const te of document.querySelectorAll('link[rel="modulepreload"]'))O(te);new MutationObserver(te=>{for(const ne of te)if(ne.type==="childList")for(const j of ne.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&O(j)}).observe(document,{childList:!0,subtree:!0});function $(te){const ne={};return te.integrity&&(ne.integrity=te.integrity),te.referrerPolicy&&(ne.referrerPolicy=te.referrerPolicy),te.crossOrigin==="use-credentials"?ne.credentials="include":te.crossOrigin==="anonymous"?ne.credentials="omit":ne.credentials="same-origin",ne}function O(te){if(te.ep)return;te.ep=!0;const ne=$(te);fetch(te.href,ne)}})();var Ml={exports:{}},Yr={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Nd;function Dv(){if(Nd)return Yr;Nd=1;var I=Symbol.for("react.transitional.element"),W=Symbol.for("react.fragment");function $(O,te,ne){var j=null;if(ne!==void 0&&(j=""+ne),te.key!==void 0&&(j=""+te.key),"key"in te){ne={};for(var n in te)n!=="key"&&(ne[n]=te[n])}else ne=te;return te=ne.ref,{$$typeof:I,type:O,key:j,ref:te!==void 0?te:null,props:ne}}return Yr.Fragment=W,Yr.jsx=$,Yr.jsxs=$,Yr}var Ud;function Tv(){return Ud||(Ud=1,Ml.exports=Dv()),Ml.exports}var Q=Tv(),Al={exports:{}},De={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Id;function Bv(){if(Id)return De;Id=1;var I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),j=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),g=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c=Object.assign,r={};function h(D,k,Y){this.props=D,this.context=k,this.refs=r,this.updater=Y||b}h.prototype.isReactComponent={},h.prototype.setState=function(D,k){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,k,"setState")},h.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function l(){}l.prototype=h.prototype;function o(D,k,Y){this.props=D,this.context=k,this.refs=r,this.updater=Y||b}var m=o.prototype=new l;m.constructor=o,c(m,h.prototype),m.isPureReactComponent=!0;var x=Array.isArray;function v(){}var w={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function C(D,k,Y){var V=Y.ref;return{$$typeof:I,type:D,key:k,ref:V!==void 0?V:null,props:Y}}function L(D,k){return C(D.type,k,D.props)}function A(D){return typeof D=="object"&&D!==null&&D.$$typeof===I}function E(D){var k={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Y){return k[Y]})}var T=/\/+/g;function H(D,k){return typeof D=="object"&&D!==null&&D.key!=null?E(""+D.key):k.toString(36)}function G(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(v,v):(D.status="pending",D.then(function(k){D.status==="pending"&&(D.status="fulfilled",D.value=k)},function(k){D.status==="pending"&&(D.status="rejected",D.reason=k)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function U(D,k,Y,V,le){var ce=typeof D;(ce==="undefined"||ce==="boolean")&&(D=null);var q=!1;if(D===null)q=!0;else switch(ce){case"bigint":case"string":case"number":q=!0;break;case"object":switch(D.$$typeof){case I:case W:q=!0;break;case _:return q=D._init,U(q(D._payload),k,Y,V,le)}}if(q)return le=le(D),q=V===""?"."+H(D,0):V,x(le)?(Y="",q!=null&&(Y=q.replace(T,"$&/")+"/"),U(le,k,Y,"",function(ee){return ee})):le!=null&&(A(le)&&(le=L(le,Y+(le.key==null||D&&D.key===le.key?"":(""+le.key).replace(T,"$&/")+"/")+q)),k.push(le)),1;q=0;var N=V===""?".":V+":";if(x(D))for(var J=0;J<D.length;J++)V=D[J],ce=N+H(V,J),q+=U(V,k,Y,ce,le);else if(J=y(D),typeof J=="function")for(D=J.call(D),J=0;!(V=D.next()).done;)V=V.value,ce=N+H(V,J++),q+=U(V,k,Y,ce,le);else if(ce==="object"){if(typeof D.then=="function")return U(G(D),k,Y,V,le);throw k=String(D),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return q}function P(D,k,Y){if(D==null)return D;var V=[],le=0;return U(D,V,"","",function(ce){return k.call(Y,ce,le++)}),V}function F(D){if(D._status===-1){var k=D._result;k=k(),k.then(function(Y){(D._status===0||D._status===-1)&&(D._status=1,D._result=Y)},function(Y){(D._status===0||D._status===-1)&&(D._status=2,D._result=Y)}),D._status===-1&&(D._status=0,D._result=k)}if(D._status===1)return D._result.default;throw D._result}var R=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},B={map:P,forEach:function(D,k,Y){P(D,function(){k.apply(this,arguments)},Y)},count:function(D){var k=0;return P(D,function(){k++}),k},toArray:function(D){return P(D,function(k){return k})||[]},only:function(D){if(!A(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return De.Activity=a,De.Children=B,De.Component=h,De.Fragment=$,De.Profiler=te,De.PureComponent=o,De.StrictMode=O,De.Suspense=u,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,De.__COMPILER_RUNTIME={__proto__:null,c:function(D){return w.H.useMemoCache(D)}},De.cache=function(D){return function(){return D.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(D,k,Y){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var V=c({},D.props),le=D.key;if(k!=null)for(ce in k.key!==void 0&&(le=""+k.key),k)!S.call(k,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&k.ref===void 0||(V[ce]=k[ce]);var ce=arguments.length-2;if(ce===1)V.children=Y;else if(1<ce){for(var q=Array(ce),N=0;N<ce;N++)q[N]=arguments[N+2];V.children=q}return C(D.type,le,V)},De.createContext=function(D){return D={$$typeof:j,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:ne,_context:D},D},De.createElement=function(D,k,Y){var V,le={},ce=null;if(k!=null)for(V in k.key!==void 0&&(ce=""+k.key),k)S.call(k,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(le[V]=k[V]);var q=arguments.length-2;if(q===1)le.children=Y;else if(1<q){for(var N=Array(q),J=0;J<q;J++)N[J]=arguments[J+2];le.children=N}if(D&&D.defaultProps)for(V in q=D.defaultProps,q)le[V]===void 0&&(le[V]=q[V]);return C(D,ce,le)},De.createRef=function(){return{current:null}},De.forwardRef=function(D){return{$$typeof:n,render:D}},De.isValidElement=A,De.lazy=function(D){return{$$typeof:_,_payload:{_status:-1,_result:D},_init:F}},De.memo=function(D,k){return{$$typeof:f,type:D,compare:k===void 0?null:k}},De.startTransition=function(D){var k=w.T,Y={};w.T=Y;try{var V=D(),le=w.S;le!==null&&le(Y,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(v,R)}catch(ce){R(ce)}finally{k!==null&&Y.types!==null&&(k.types=Y.types),w.T=k}},De.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},De.use=function(D){return w.H.use(D)},De.useActionState=function(D,k,Y){return w.H.useActionState(D,k,Y)},De.useCallback=function(D,k){return w.H.useCallback(D,k)},De.useContext=function(D){return w.H.useContext(D)},De.useDebugValue=function(){},De.useDeferredValue=function(D,k){return w.H.useDeferredValue(D,k)},De.useEffect=function(D,k){return w.H.useEffect(D,k)},De.useEffectEvent=function(D){return w.H.useEffectEvent(D)},De.useId=function(){return w.H.useId()},De.useImperativeHandle=function(D,k,Y){return w.H.useImperativeHandle(D,k,Y)},De.useInsertionEffect=function(D,k){return w.H.useInsertionEffect(D,k)},De.useLayoutEffect=function(D,k){return w.H.useLayoutEffect(D,k)},De.useMemo=function(D,k){return w.H.useMemo(D,k)},De.useOptimistic=function(D,k){return w.H.useOptimistic(D,k)},De.useReducer=function(D,k,Y){return w.H.useReducer(D,k,Y)},De.useRef=function(D){return w.H.useRef(D)},De.useState=function(D){return w.H.useState(D)},De.useSyncExternalStore=function(D,k,Y){return w.H.useSyncExternalStore(D,k,Y)},De.useTransition=function(){return w.H.useTransition()},De.version="19.2.4",De}var Pd;function Il(){return Pd||(Pd=1,Al.exports=Bv()),Al.exports}var ye=Il(),Rl={exports:{}},Vr={},Dl={exports:{}},Tl={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Fd;function Ov(){return Fd||(Fd=1,(function(I){function W(U,P){var F=U.length;U.push(P);e:for(;0<F;){var R=F-1>>>1,B=U[R];if(0<te(B,P))U[R]=P,U[F]=B,F=R;else break e}}function $(U){return U.length===0?null:U[0]}function O(U){if(U.length===0)return null;var P=U[0],F=U.pop();if(F!==P){U[0]=F;e:for(var R=0,B=U.length,D=B>>>1;R<D;){var k=2*(R+1)-1,Y=U[k],V=k+1,le=U[V];if(0>te(Y,F))V<B&&0>te(le,Y)?(U[R]=le,U[V]=F,R=V):(U[R]=Y,U[k]=F,R=k);else if(V<B&&0>te(le,F))U[R]=le,U[V]=F,R=V;else break e}}return P}function te(U,P){var F=U.sortIndex-P.sortIndex;return F!==0?F:U.id-P.id}if(I.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var ne=performance;I.unstable_now=function(){return ne.now()}}else{var j=Date,n=j.now();I.unstable_now=function(){return j.now()-n}}var u=[],f=[],_=1,a=null,g=3,y=!1,b=!1,c=!1,r=!1,h=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;function m(U){for(var P=$(f);P!==null;){if(P.callback===null)O(f);else if(P.startTime<=U)O(f),P.sortIndex=P.expirationTime,W(u,P);else break;P=$(f)}}function x(U){if(c=!1,m(U),!b)if($(u)!==null)b=!0,v||(v=!0,E());else{var P=$(f);P!==null&&G(x,P.startTime-U)}}var v=!1,w=-1,S=5,C=-1;function L(){return r?!0:!(I.unstable_now()-C<S)}function A(){if(r=!1,v){var U=I.unstable_now();C=U;var P=!0;try{e:{b=!1,c&&(c=!1,l(w),w=-1),y=!0;var F=g;try{t:{for(m(U),a=$(u);a!==null&&!(a.expirationTime>U&&L());){var R=a.callback;if(typeof R=="function"){a.callback=null,g=a.priorityLevel;var B=R(a.expirationTime<=U);if(U=I.unstable_now(),typeof B=="function"){a.callback=B,m(U),P=!0;break t}a===$(u)&&O(u),m(U)}else O(u);a=$(u)}if(a!==null)P=!0;else{var D=$(f);D!==null&&G(x,D.startTime-U),P=!1}}break e}finally{a=null,g=F,y=!1}P=void 0}}finally{P?E():v=!1}}}var E;if(typeof o=="function")E=function(){o(A)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,H=T.port2;T.port1.onmessage=A,E=function(){H.postMessage(null)}}else E=function(){h(A,0)};function G(U,P){w=h(function(){U(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(U){U.callback=null},I.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"):S=0<U?Math.floor(1e3/U):5},I.unstable_getCurrentPriorityLevel=function(){return g},I.unstable_next=function(U){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var F=g;g=P;try{return U()}finally{g=F}},I.unstable_requestPaint=function(){r=!0},I.unstable_runWithPriority=function(U,P){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var F=g;g=U;try{return P()}finally{g=F}},I.unstable_scheduleCallback=function(U,P,F){var R=I.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?R+F:R):F=R,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=F+B,U={id:_++,callback:P,priorityLevel:U,startTime:F,expirationTime:B,sortIndex:-1},F>R?(U.sortIndex=F,W(f,U),$(u)===null&&U===$(f)&&(c?(l(w),w=-1):c=!0,G(x,F-R))):(U.sortIndex=B,W(u,U),b||y||(b=!0,v||(v=!0,E()))),U},I.unstable_shouldYield=L,I.unstable_wrapCallback=function(U){var P=g;return function(){var F=g;g=P;try{return U.apply(this,arguments)}finally{g=F}}}})(Tl)),Tl}var jd;function kv(){return jd||(jd=1,Dl.exports=Ov()),Dl.exports}var Bl={exports:{}},wt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var $d;function Hv(){if($d)return wt;$d=1;var I=Il();function W(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)f+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function $(){}var O={d:{f:$,r:function(){throw Error(W(522))},D:$,C:$,L:$,m:$,X:$,S:$,M:$},p:0,findDOMNode:null},te=Symbol.for("react.portal");function ne(u,f,_){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:te,key:a==null?null:""+a,children:u,containerInfo:f,implementation:_}}var j=I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,wt.createPortal=function(u,f){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(W(299));return ne(u,f,null,_)},wt.flushSync=function(u){var f=j.T,_=O.p;try{if(j.T=null,O.p=2,u)return u()}finally{j.T=f,O.p=_,O.d.f()}},wt.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,O.d.C(u,f))},wt.prefetchDNS=function(u){typeof u=="string"&&O.d.D(u)},wt.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var _=f.as,a=n(_,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;_==="style"?O.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:a,integrity:g,fetchPriority:y}):_==="script"&&O.d.X(u,{crossOrigin:a,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},wt.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var _=n(f.as,f.crossOrigin);O.d.M(u,{crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&O.d.M(u)},wt.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var _=f.as,a=n(_,f.crossOrigin);O.d.L(u,_,{crossOrigin:a,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},wt.preloadModule=function(u,f){if(typeof u=="string")if(f){var _=n(f.as,f.crossOrigin);O.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else O.d.m(u)},wt.requestFormReset=function(u){O.d.r(u)},wt.unstable_batchedUpdates=function(u,f){return u(f)},wt.useFormState=function(u,f,_){return j.H.useFormState(u,f,_)},wt.useFormStatus=function(){return j.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var qd;function zv(){if(qd)return Bl.exports;qd=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(W){console.error(W)}}return I(),Bl.exports=Hv(),Bl.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Wd;function Nv(){if(Wd)return Vr;Wd=1;var I=kv(),W=Il(),$=zv();function O(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function te(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ne(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 j(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(ne(e)!==e)throw Error(O(188))}function f(e){var t=e.alternate;if(!t){if(t=ne(e),t===null)throw Error(O(188));return t!==e?null:e}for(var i=e,s=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(s=d.return,s!==null){i=s;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return u(d),e;if(p===s)return u(d),t;p=p.sibling}throw Error(O(188))}if(i.return!==s.return)i=d,s=p;else{for(var M=!1,z=d.child;z;){if(z===i){M=!0,i=d,s=p;break}if(z===s){M=!0,s=d,i=p;break}z=z.sibling}if(!M){for(z=p.child;z;){if(z===i){M=!0,i=p,s=d;break}if(z===s){M=!0,s=p,i=d;break}z=z.sibling}if(!M)throw Error(O(189))}}if(i.alternate!==s)throw Error(O(190))}if(i.tag!==3)throw Error(O(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,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=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 T=Symbol.for("react.client.reference");function H(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===T?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c: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 o:return e.displayName||"Context";case l:return(e._context.displayName||"Context")+".Consumer";case m:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w:return t=e.displayName||null,t!==null?t:H(e.type)||"Memo";case S:t=e._payload,e=e._init;try{return H(e(t))}catch{}}return null}var G=Array.isArray,U=W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=$.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},R=[],B=-1;function D(e){return{current:e}}function k(e){0>B||(e.current=R[B],R[B]=null,B--)}function Y(e,t){B++,R[B]=e.current,e.current=t}var V=D(null),le=D(null),ce=D(null),q=D(null);function N(e,t){switch(Y(ce,t),Y(le,e),Y(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ad(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ad(t),e=od(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(V),Y(V,e)}function J(){k(V),k(le),k(ce)}function ee(e){e.memoizedState!==null&&Y(q,e);var t=V.current,i=od(t,e.type);t!==i&&(Y(le,e),Y(V,i))}function _e(e){le.current===e&&(k(V),k(le)),q.current===e&&(k(q),qr._currentValue=F)}var fe,Me;function ve(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
+ 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 re=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){re=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){re=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&re&&typeof ae.stack=="string")return[ae.stack,re.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=s.DetermineComponentFrameRoot(),M=p[0],z=p[1];if(M&&z){var X=M.split(`
44
+ `),se=z.split(`
45
+ `);for(d=s=0;s<X.length&&!X[s].includes("DetermineComponentFrameRoot");)s++;for(;d<se.length&&!se[d].includes("DetermineComponentFrameRoot");)d++;if(s===X.length||d===se.length)for(s=X.length-1,d=se.length-1;1<=s&&0<=d&&X[s]!==se[d];)d--;for(;1<=s&&0<=d;s--,d--)if(X[s]!==se[d]){if(s!==1||d!==1)do if(s--,d--,0>d||X[s]!==se[d]){var oe=`
46
+ `+X[s].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=s&&0<=d);break}}}finally{Oe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ve(i):""}function we(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve("Lazy");case 13:return e.child!==t&&t!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("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 ve("Activity");default:return""}}function ft(e){try{var t="",i=null;do t+=we(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
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 Ft=256,ri=262144,ni=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 d=0,p=e.suspendedLanes,M=e.pingedLanes;e=e.warmLanes;var z=s&134217727;return z!==0?(s=z&~p,s!==0?d=Jt(s):(M&=z,M!==0?d=Jt(M):i||(i=z&~e,i!==0&&(d=Jt(i))))):(z=s&~p,z!==0?d=Jt(z):M!==0?d=Jt(M):i||(i=s&~e,i!==0&&(d=Jt(i)))),d===0?0:t!==0&&t!==d&&(t&p)===0&&(p=d&-d,i=t&-t,p>=i||p===32&&(i&4194048)!==0)?t:d}function sr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vf(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 Fl(){var e=ni;return ni<<=1,(ni&62914560)===0&&(ni=4194304),e}function _a(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 gf(e,t,i,s,d,p){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 z=e.entanglements,X=e.expirationTimes,se=e.hiddenUpdates;for(i=M&~i;0<i;){var oe=31-ut(i),de=1<<oe;z[oe]=0,X[oe]=-1;var re=se[oe];if(re!==null)for(se[oe]=null,oe=0;oe<re.length;oe++){var ae=re[oe];ae!==null&&(ae.lane&=-536870913)}i&=~de}s!==0&&jl(e,s,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(M&~t))}function jl(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 $l(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-ut(i),d=1<<s;d&t|e[s]&t&&(e[s]|=t),i&=~d}}function ql(e,t){var i=t&-t;return i=(i&42)!==0?1:va(i),(i&(e.suspendedLanes|t))!==0?0:i}function va(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 ga(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wl(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Dd(e.type))}function Gl(e,t){var i=P.p;try{return P.p=e,t()}finally{P.p=i}}var Ri=Math.random().toString(36).slice(2),mt="__reactFiber$"+Ri,Et="__reactProps$"+Ri,gs="__reactContainer$"+Ri,pa="__reactEvents$"+Ri,pf="__reactListeners$"+Ri,mf="__reactHandles$"+Ri,Xl="__reactResources$"+Ri,nr="__reactMarker$"+Ri;function ma(e){delete e[mt],delete e[Et],delete e[pa],delete e[pf],delete e[mf]}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=_d(e);e!==null;){if(i=e[mt])return i;e=_d(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(O(33))}function Ss(e){var t=e[Xl];return t||(t=e[Xl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[nr]=!0}var Yl=new Set,Vl={};function Ji(e,t){Cs(e,t),Cs(e+"Capture",t)}function Cs(e,t){for(Vl[e]=t,e=0;e<t.length;e++)Yl.add(t[e])}var Sf=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]*$"),Kl={},Ql={};function Cf(e){return Ot.call(Ql,e)?!0:Ot.call(Kl,e)?!1:Sf.test(e)?Ql[e]=!0:(Kl[e]=!0,!1)}function Qr(e,t,i){if(Cf(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 ui(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 jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yf(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 d=s.get,p=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(M){i=""+M,p.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 Sa(e){if(!e._valueTracker){var t=Zl(e)?"checked":"value";e._valueTracker=yf(e,t,""+e[t])}}function Jl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Zl(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 bf=/[\n"\\]/g;function $t(e){return e.replace(bf,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ca(e,t,i,s,d,p,M,z){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=""+jt(t)):e.value!==""+jt(t)&&(e.value=""+jt(t)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),t!=null?ya(e,M,jt(t)):i!=null?ya(e,M,jt(i)):s!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+jt(z):e.removeAttribute("name")}function ec(e,t,i,s,d,p,M,z){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||i!=null){if(!(p!=="submit"&&p!=="reset"||t!=null)){Sa(e);return}i=i!=null?""+jt(i):"",t=t!=null?""+jt(t):i,z||t===e.value||(e.value=t),e.defaultValue=t}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=z?e.checked:!!s,e.defaultChecked=!!s,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(e.name=M),Sa(e)}function ya(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 d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&s&&(e[i].defaultSelected=!0)}else{for(i=""+jt(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function tc(e,t,i){if(t!=null&&(t=""+jt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+jt(i):""}function ic(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(O(92));if(G(s)){if(1<s.length)throw Error(O(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=jt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Sa(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 wf=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 sc(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||wf.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function rc(e,t,i){if(t!=null&&typeof t!="object")throw Error(O(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 d in t)s=t[d],t.hasOwnProperty(d)&&i[d]!==s&&sc(e,d,s)}else for(var p in t)t.hasOwnProperty(p)&&sc(e,p,t[p])}function ba(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 xf=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"]]),Lf=/^[\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 Lf.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function di(){}var wa=null;function xa(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 nc(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(Ca(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 d=s[Et]||null;if(!d)throw Error(O(90));Ca(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Jl(s)}break e;case"textarea":tc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ys(e,!!i.multiple,t,!1)}}}var La=!1;function ac(e,t,i){if(La)return e(t,i);La=!0;try{var s=e(t);return s}finally{if(La=!1,(ws!==null||xs!==null)&&(jn(),ws&&(t=ws,e=xs,xs=ws=null,nc(t),e)))for(t=0;t<e.length;t++)nc(e[t])}}function or(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(O(231,t,typeof i));return i}var fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ea=!1;if(fi)try{var lr={};Object.defineProperty(lr,"passive",{get:function(){Ea=!0}}),window.addEventListener("test",lr,lr),window.removeEventListener("test",lr,lr)}catch{Ea=!1}var Di=null,Ma=null,tn=null;function oc(){if(tn)return tn;var e,t=Ma,i=t.length,s,d="value"in Di?Di.value:Di.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var M=i-e;for(s=1;s<=M&&t[i-s]===d[p-s];s++);return tn=d.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 lc(){return!1}function Mt(e){function t(i,s,d,p,M){this._reactName=i,this._targetInst=d,this.type=s,this.nativeEvent=p,this.target=M,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(i=e[z],this[z]=i?i(p):p[z]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?rn:lc,this.isPropagationStopped=lc,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}),Ef=Mt(cr),Aa,Ra,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:Ta,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"?(Aa=e.screenX-hr.screenX,Ra=e.screenY-hr.screenY):Ra=Aa=0,hr=e),Aa)},movementY:function(e){return"movementY"in e?e.movementY:Ra}}),cc=Mt(an),Mf=a({},an,{dataTransfer:0}),Af=Mt(Mf),Rf=a({},cr,{relatedTarget:0}),Da=Mt(Rf),Df=a({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),Tf=Mt(Df),Bf=a({},es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Of=Mt(Bf),kf=a({},es,{data:0}),hc=Mt(kf),Hf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zf={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"},Nf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nf[e])?!!t[e]:!1}function Ta(){return Uf}var If=a({},cr,{key:function(e){if(e.key){var t=Hf[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"?zf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ta,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}}),Pf=Mt(If),Ff=a({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uc=Mt(Ff),jf=a({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ta}),$f=Mt(jf),qf=a({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wf=Mt(qf),Gf=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}),Xf=Mt(Gf),Yf=a({},es,{newState:0,oldState:0}),Vf=Mt(Yf),Kf=[9,13,27,32],Ba=fi&&"CompositionEvent"in window,ur=null;fi&&"documentMode"in document&&(ur=document.documentMode);var Qf=fi&&"TextEvent"in window&&!ur,dc=fi&&(!Ba||ur&&8<ur&&11>=ur),fc=" ",_c=!1;function vc(e,t){switch(e){case"keyup":return Kf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ls=!1;function Zf(e,t){switch(e){case"compositionend":return gc(t);case"keypress":return t.which!==32?null:(_c=!0,fc);case"textInput":return e=t.data,e===fc&&_c?null:e;default:return null}}function Jf(e,t){if(Ls)return e==="compositionend"||!Ba&&vc(e,t)?(e=oc(),tn=Ma=Di=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 dc&&t.locale!=="ko"?null:t.data;default:return null}}var e_={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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!e_[e.type]:t==="textarea"}function mc(e,t,i,s){ws?xs?xs.push(s):xs=[s]:ws=s,t=Vn(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 t_(e){ed(e,0)}function on(e){var t=ar(e);if(Jl(t))return e}function Sc(e,t){if(e==="change")return t}var Cc=!1;if(fi){var Oa;if(fi){var ka="oninput"in document;if(!ka){var yc=document.createElement("div");yc.setAttribute("oninput","return;"),ka=typeof yc.oninput=="function"}Oa=ka}else Oa=!1;Cc=Oa&&(!document.documentMode||9<document.documentMode)}function bc(){dr&&(dr.detachEvent("onpropertychange",wc),fr=dr=null)}function wc(e){if(e.propertyName==="value"&&on(fr)){var t=[];mc(t,fr,e,xa(e)),ac(t_,t)}}function i_(e,t,i){e==="focusin"?(bc(),dr=t,fr=i,dr.attachEvent("onpropertychange",wc)):e==="focusout"&&bc()}function s_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return on(fr)}function r_(e,t){if(e==="click")return on(t)}function n_(e,t){if(e==="input"||e==="change")return on(t)}function a_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:a_;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 d=i[s];if(!Ot.call(t,d)||!kt(e[d],t[d]))return!1}return!0}function xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lc(e,t){var i=xc(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=xc(i)}}function Ec(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ec(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mc(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 Ha(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 o_=fi&&"documentMode"in document&&11>=document.documentMode,Es=null,za=null,vr=null,Na=!1;function Ac(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Na||Es==null||Es!==Jr(s)||(s=Es,"selectionStart"in s&&Ha(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=Vn(za,"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")},Ua={},Rc={};fi&&(Rc=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(Ua[e])return Ua[e];if(!Ms[e])return e;var t=Ms[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Rc)return Ua[e]=t[i];return e}var Dc=is("animationend"),Tc=is("animationiteration"),Bc=is("animationstart"),l_=is("transitionrun"),c_=is("transitionstart"),h_=is("transitioncancel"),Oc=is("transitionend"),kc=new Map,Ia="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(" ");Ia.push("scrollEnd");function ei(e,t){kc.set(e,t),Ji(t,[e])}var ln=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,Pa=0;function cn(){for(var e=As,t=Pa=As=0;t<e;){var i=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var d=qt[t];qt[t++]=null;var p=qt[t];if(qt[t++]=null,s!==null&&d!==null){var M=s.pending;M===null?d.next=d:(d.next=M.next,M.next=d),s.pending=d}p!==0&&Hc(i,d,p)}}function hn(e,t,i,s){qt[As++]=e,qt[As++]=t,qt[As++]=i,qt[As++]=s,Pa|=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 Hc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var d=!1,p=e.return;p!==null;)p.childLanes|=i,s=p.alternate,s!==null&&(s.childLanes|=i),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&t!==null&&(d=31-ut(i),e=p.hiddenUpdates,s=e[d],s===null?e[d]=[t]:s.push(t),t.lane=i|536870912),p):null}function un(e){if(50<Nr)throw Nr=0,Qo=null,Error(O(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rs={};function u_(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 u_(e,t,i,s)}function ja(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _i(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 zc(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,d,p){var M=0;if(s=e,typeof e=="function")ja(e)&&(M=1);else if(typeof e=="string")M=gv(e,i,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case C:return e=Ht(31,i,t,d),e.elementType=C,e.lanes=p,e;case c:return rs(i.children,d,p,t);case r:M=8,d|=24;break;case h:return e=Ht(12,i,t,d|2),e.elementType=h,e.lanes=p,e;case x:return e=Ht(13,i,t,d),e.elementType=x,e.lanes=p,e;case v:return e=Ht(19,i,t,d),e.elementType=v,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o:M=10;break e;case l:M=9;break e;case m:M=11;break e;case w:M=14;break e;case S:M=16,s=null;break e}M=29,i=Error(O(130,e===null?"null":typeof e,"")),s=null}return t=Ht(M,i,t,d),t.elementType=e,t.type=s,t.lanes=p,t}function rs(e,t,i,s){return e=Ht(7,e,s,t),e.lanes=i,e}function $a(e,t,i){return e=Ht(6,e,null,t),e.lanes=i,e}function Nc(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function qa(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 Uc=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=Uc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ft(t)},Uc.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var Ds=[],Ts=0,fn=null,gr=0,Gt=[],Xt=0,Ti=null,ai=1,oi="";function vi(e,t){Ds[Ts++]=gr,Ds[Ts++]=fn,fn=e,gr=t}function Ic(e,t,i){Gt[Xt++]=ai,Gt[Xt++]=oi,Gt[Xt++]=Ti,Ti=e;var s=ai;e=oi;var d=32-ut(s)-1;s&=~(1<<d),i+=1;var p=32-ut(t)+d;if(30<p){var M=d-d%5;p=(s&(1<<M)-1).toString(32),s>>=M,d-=M,ai=1<<32-ut(t)+d|i<<d|s,oi=p+e}else ai=1<<p|i<<d|s,oi=e}function Wa(e){e.return!==null&&(vi(e,1),Ic(e,1,0))}function Ga(e){for(;e===fn;)fn=Ds[--Ts],Ds[Ts]=null,gr=Ds[--Ts],Ds[Ts]=null;for(;e===Ti;)Ti=Gt[--Xt],Gt[Xt]=null,oi=Gt[--Xt],Gt[Xt]=null,ai=Gt[--Xt],Gt[Xt]=null}function Pc(e,t){Gt[Xt++]=ai,Gt[Xt++]=oi,Gt[Xt++]=Ti,ai=t.id,oi=t.overflow,Ti=e}var St=null,Ze=null,Pe=!1,Bi=null,Yt=!1,Xa=Error(O(519));function Oi(e){var t=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(Wt(t,e)),Xa}function Fc(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),ec(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),ic(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||rd(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=di),t=!0):t=!1,t||Oi(e,!0)}function jc(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:Yt=!1;return;case 27:case 3:Yt=!0;return;default:St=St.return}}function Bs(e){if(e!==St)return!1;if(!Pe)return jc(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")||dl(e.type,e.memoizedProps)),i=!i),i&&Ze&&Oi(e),jc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));Ze=fd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));Ze=fd(e)}else t===27?(t=Ze,Xi(e.type)?(e=pl,pl=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=Bi;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Bi=null),e}function pr(e){Bi===null?Bi=[e]:Bi.push(e)}var Va=D(null),as=null,gi=null;function ki(e,t,i){Y(Va,t._currentValue),t._currentValue=i}function pi(e){e._currentValue=Va.current,k(Va)}function Ka(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 Qa(e,t,i,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var M=d.child;p=p.firstContext;e:for(;p!==null;){var z=p;p=d;for(var X=0;X<t.length;X++)if(z.context===t[X]){p.lanes|=i,z=p.alternate,z!==null&&(z.lanes|=i),Ka(p.return,i,e),s||(M=null);break e}p=z.next}}else if(d.tag===18){if(M=d.return,M===null)throw Error(O(341));M.lanes|=i,p=M.alternate,p!==null&&(p.lanes|=i),Ka(M,i,e),M=null}else M=d.child;if(M!==null)M.return=d;else for(M=d;M!==null;){if(M===e){M=null;break}if(d=M.sibling,d!==null){d.return=M.return,M=d;break}M=M.return}d=M}}function Os(e,t,i,s){e=null;for(var d=t,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var M=d.alternate;if(M===null)throw Error(O(387));if(M=M.memoizedProps,M!==null){var z=d.type;kt(d.pendingProps.value,M.value)||(e!==null?e.push(z):e=[z])}}else if(d===q.current){if(M=d.alternate,M===null)throw Error(O(387));M.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(qr):e=[qr])}d=d.return}e!==null&&Qa(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 os(e){as=e,gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return $c(as,e)}function vn(e,t){return as===null&&os(e),$c(e,t)}function $c(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},gi===null){if(e===null)throw Error(O(308));gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gi=gi.next=t;return i}var d_=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()})}},f_=I.unstable_scheduleCallback,__=I.unstable_NormalPriority,ot={$$typeof:o,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Za(){return{controller:new d_,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&f_(__,function(){e.controller.abort()})}var Sr=null,Ja=0,ks=0,Hs=null;function v_(e,t){if(Sr===null){var i=Sr=[];Ja=0,ks=sl(),Hs={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Ja++,t.then(qc,qc),t}function qc(){if(--Ja===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 g_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var d=0;d<i.length;d++)(0,i[d])(t)},function(d){for(s.status="rejected",s.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),s}var Wc=U.S;U.S=function(e,t){Au=ge(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&v_(e,t),Wc!==null&&Wc(e,t)};var ls=D(null);function eo(){var e=ls.current;return e!==null?e:Ke.pooledCache}function gn(e,t){t===null?Y(ls,ls.current):Y(ls,t.pool)}function Gc(){var e=eo();return e===null?null:{parent:ot._currentValue,pool:e}}var zs=Error(O(460)),to=Error(O(474)),pn=Error(O(542)),mn={then:function(){}};function Xc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(di,di),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kc(e),e;default:if(typeof t.status=="string")t.then(di,di);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(O(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=s}},function(s){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kc(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 Vc(){if(hs===null)throw Error(O(459));var e=hs;return hs=null,e}function Kc(e){if(e===zs||e===pn)throw Error(O(483))}var Ns=null,Cr=0;function Sn(e){var t=Cr;return Cr+=1,Ns===null&&(Ns=[]),Yc(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===g?Error(O(525)):(e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(e){function t(Z,K){if(e){var ie=Z.deletions;ie===null?(Z.deletions=[K],Z.flags|=16):ie.push(K)}}function i(Z,K){if(!e)return null;for(;K!==null;)t(Z,K),K=K.sibling;return null}function s(Z){for(var K=new Map;Z!==null;)Z.key!==null?K.set(Z.key,Z):K.set(Z.index,Z),Z=Z.sibling;return K}function d(Z,K){return Z=_i(Z,K),Z.index=0,Z.sibling=null,Z}function p(Z,K,ie){return Z.index=ie,e?(ie=Z.alternate,ie!==null?(ie=ie.index,ie<K?(Z.flags|=67108866,K):ie):(Z.flags|=67108866,K)):(Z.flags|=1048576,K)}function M(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function z(Z,K,ie,he){return K===null||K.tag!==6?(K=$a(ie,Z.mode,he),K.return=Z,K):(K=d(K,ie),K.return=Z,K)}function X(Z,K,ie,he){var xe=ie.type;return xe===c?oe(Z,K,ie.props.children,he,ie.key):K!==null&&(K.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===S&&cs(xe)===K.type)?(K=d(K,ie.props),yr(K,ie),K.return=Z,K):(K=dn(ie.type,ie.key,ie.props,null,Z.mode,he),yr(K,ie),K.return=Z,K)}function se(Z,K,ie,he){return K===null||K.tag!==4||K.stateNode.containerInfo!==ie.containerInfo||K.stateNode.implementation!==ie.implementation?(K=qa(ie,Z.mode,he),K.return=Z,K):(K=d(K,ie.children||[]),K.return=Z,K)}function oe(Z,K,ie,he,xe){return K===null||K.tag!==7?(K=rs(ie,Z.mode,he,xe),K.return=Z,K):(K=d(K,ie),K.return=Z,K)}function de(Z,K,ie){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=$a(""+K,Z.mode,ie),K.return=Z,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return ie=dn(K.type,K.key,K.props,null,Z.mode,ie),yr(ie,K),ie.return=Z,ie;case b:return K=qa(K,Z.mode,ie),K.return=Z,K;case S:return K=cs(K),de(Z,K,ie)}if(G(K)||E(K))return K=rs(K,Z.mode,ie,null),K.return=Z,K;if(typeof K.then=="function")return de(Z,Sn(K),ie);if(K.$$typeof===o)return de(Z,vn(Z,K),ie);Cn(Z,K)}return null}function re(Z,K,ie,he){var xe=K!==null?K.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return xe!==null?null:z(Z,K,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case y:return ie.key===xe?X(Z,K,ie,he):null;case b:return ie.key===xe?se(Z,K,ie,he):null;case S:return ie=cs(ie),re(Z,K,ie,he)}if(G(ie)||E(ie))return xe!==null?null:oe(Z,K,ie,he,null);if(typeof ie.then=="function")return re(Z,K,Sn(ie),he);if(ie.$$typeof===o)return re(Z,K,vn(Z,ie),he);Cn(Z,ie)}return null}function ae(Z,K,ie,he,xe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Z=Z.get(ie)||null,z(K,Z,""+he,xe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return Z=Z.get(he.key===null?ie:he.key)||null,X(K,Z,he,xe);case b:return Z=Z.get(he.key===null?ie:he.key)||null,se(K,Z,he,xe);case S:return he=cs(he),ae(Z,K,ie,he,xe)}if(G(he)||E(he))return Z=Z.get(ie)||null,oe(K,Z,he,xe,null);if(typeof he.then=="function")return ae(Z,K,ie,Sn(he),xe);if(he.$$typeof===o)return ae(Z,K,ie,vn(K,he),xe);Cn(K,he)}return null}function Ce(Z,K,ie,he){for(var xe=null,Fe=null,be=K,Be=K=0,Ue=null;be!==null&&Be<ie.length;Be++){be.index>Be?(Ue=be,be=null):Ue=be.sibling;var je=re(Z,be,ie[Be],he);if(je===null){be===null&&(be=Ue);break}e&&be&&je.alternate===null&&t(Z,be),K=p(je,K,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je,be=Ue}if(Be===ie.length)return i(Z,be),Pe&&vi(Z,Be),xe;if(be===null){for(;Be<ie.length;Be++)be=de(Z,ie[Be],he),be!==null&&(K=p(be,K,Be),Fe===null?xe=be:Fe.sibling=be,Fe=be);return Pe&&vi(Z,Be),xe}for(be=s(be);Be<ie.length;Be++)Ue=ae(be,Z,Be,ie[Be],he),Ue!==null&&(e&&Ue.alternate!==null&&be.delete(Ue.key===null?Be:Ue.key),K=p(Ue,K,Be),Fe===null?xe=Ue:Fe.sibling=Ue,Fe=Ue);return e&&be.forEach(function(Zi){return t(Z,Zi)}),Pe&&vi(Z,Be),xe}function Ee(Z,K,ie,he){if(ie==null)throw Error(O(151));for(var xe=null,Fe=null,be=K,Be=K=0,Ue=null,je=ie.next();be!==null&&!je.done;Be++,je=ie.next()){be.index>Be?(Ue=be,be=null):Ue=be.sibling;var Zi=re(Z,be,je.value,he);if(Zi===null){be===null&&(be=Ue);break}e&&be&&Zi.alternate===null&&t(Z,be),K=p(Zi,K,Be),Fe===null?xe=Zi:Fe.sibling=Zi,Fe=Zi,be=Ue}if(je.done)return i(Z,be),Pe&&vi(Z,Be),xe;if(be===null){for(;!je.done;Be++,je=ie.next())je=de(Z,je.value,he),je!==null&&(K=p(je,K,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je);return Pe&&vi(Z,Be),xe}for(be=s(be);!je.done;Be++,je=ie.next())je=ae(be,Z,Be,je.value,he),je!==null&&(e&&je.alternate!==null&&be.delete(je.key===null?Be:je.key),K=p(je,K,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je);return e&&be.forEach(function(Mv){return t(Z,Mv)}),Pe&&vi(Z,Be),xe}function Ve(Z,K,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===c&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case y:e:{for(var xe=ie.key;K!==null;){if(K.key===xe){if(xe=ie.type,xe===c){if(K.tag===7){i(Z,K.sibling),he=d(K,ie.props.children),he.return=Z,Z=he;break e}}else if(K.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===S&&cs(xe)===K.type){i(Z,K.sibling),he=d(K,ie.props),yr(he,ie),he.return=Z,Z=he;break e}i(Z,K);break}else t(Z,K);K=K.sibling}ie.type===c?(he=rs(ie.props.children,Z.mode,he,ie.key),he.return=Z,Z=he):(he=dn(ie.type,ie.key,ie.props,null,Z.mode,he),yr(he,ie),he.return=Z,Z=he)}return M(Z);case b:e:{for(xe=ie.key;K!==null;){if(K.key===xe)if(K.tag===4&&K.stateNode.containerInfo===ie.containerInfo&&K.stateNode.implementation===ie.implementation){i(Z,K.sibling),he=d(K,ie.children||[]),he.return=Z,Z=he;break e}else{i(Z,K);break}else t(Z,K);K=K.sibling}he=qa(ie,Z.mode,he),he.return=Z,Z=he}return M(Z);case S:return ie=cs(ie),Ve(Z,K,ie,he)}if(G(ie))return Ce(Z,K,ie,he);if(E(ie)){if(xe=E(ie),typeof xe!="function")throw Error(O(150));return ie=xe.call(ie),Ee(Z,K,ie,he)}if(typeof ie.then=="function")return Ve(Z,K,Sn(ie),he);if(ie.$$typeof===o)return Ve(Z,K,vn(Z,ie),he);Cn(Z,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,K!==null&&K.tag===6?(i(Z,K.sibling),he=d(K,ie),he.return=Z,Z=he):(i(Z,K),he=$a(ie,Z.mode,he),he.return=Z,Z=he),M(Z)):i(Z,K)}return function(Z,K,ie,he){try{Cr=0;var xe=Ve(Z,K,ie,he);return Ns=null,xe}catch(be){if(be===zs||be===pn)throw be;var Fe=Ht(29,be,null,Z.mode);return Fe.lanes=he,Fe.return=Z,Fe}finally{}}}var us=Qc(!0),Zc=Qc(!1),Hi=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(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 zi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ni(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,($e&2)!==0){var d=s.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),s.pending=t,t=un(e),Hc(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,$l(e,i)}}function ro(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var M={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};p===null?d=p=M:p=p.next=M,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:p,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 no=!1;function wr(){if(no){var e=Hs;if(e!==null)throw e}}function xr(e,t,i,s){no=!1;var d=e.updateQueue;Hi=!1;var p=d.firstBaseUpdate,M=d.lastBaseUpdate,z=d.shared.pending;if(z!==null){d.shared.pending=null;var X=z,se=X.next;X.next=null,M===null?p=se:M.next=se,M=X;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,z=oe.lastBaseUpdate,z!==M&&(z===null?oe.firstBaseUpdate=se:z.next=se,oe.lastBaseUpdate=X))}if(p!==null){var de=d.baseState;M=0,oe=se=X=null,z=p;do{var re=z.lane&-536870913,ae=re!==z.lane;if(ae?(Ne&re)===re:(s&re)===re){re!==0&&re===ks&&(no=!0),oe!==null&&(oe=oe.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ce=e,Ee=z;re=t;var Ve=i;switch(Ee.tag){case 1:if(Ce=Ee.payload,typeof Ce=="function"){de=Ce.call(Ve,de,re);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ee.payload,re=typeof Ce=="function"?Ce.call(Ve,de,re):Ce,re==null)break e;de=a({},de,re);break e;case 2:Hi=!0}}re=z.callback,re!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=d.callbacks,ae===null?d.callbacks=[re]:ae.push(re))}else ae={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},oe===null?(se=oe=ae,X=de):oe=oe.next=ae,M|=re;if(z=z.next,z===null){if(z=d.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);oe===null&&(X=de),d.baseState=X,d.firstBaseUpdate=se,d.lastBaseUpdate=oe,p===null&&(d.shared.lanes=0),ji|=M,e.lanes=M,e.memoizedState=de}}function Jc(e,t){if(typeof e!="function")throw Error(O(191,e));e.call(t)}function eh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Jc(i[e],t)}var Us=D(null),yn=D(0);function th(e,t){e=Ei,Y(yn,e),Y(Us,t),Ei=e|t.baseLanes}function ao(){Y(yn,Ei),Y(Us,Us.current)}function oo(){Ei=yn.current,k(Us),k(yn)}var zt=D(null),Vt=null;function Ui(e){var t=e.alternate;Y(nt,nt.current&1),Y(zt,e),Vt===null&&(t===null||Us.current!==null||t.memoizedState!==null)&&(Vt=e)}function lo(e){Y(nt,nt.current),Y(zt,e),Vt===null&&(Vt=e)}function ih(e){e.tag===22?(Y(nt,nt.current),Y(zt,e),Vt===null&&(Vt=e)):Ii()}function Ii(){Y(nt,nt.current),Y(zt,zt.current)}function Nt(e){k(zt),Vt===e&&(Vt=null),k(nt)}var nt=D(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||vl(i)||gl(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 mi=0,Te=null,Xe=null,lt=null,wn=!1,Is=!1,ds=!1,xn=0,Lr=0,Ps=null,p_=0;function st(){throw Error(O(321))}function co(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 ho(e,t,i,s,d,p){return mi=p,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Ih:Eo,ds=!1,p=i(s,d),ds=!1,Is&&(p=rh(t,i,s,d)),sh(e),p}function sh(e){U.H=Ar;var t=Xe!==null&&Xe.next!==null;if(mi=0,lt=Xe=Te=null,wn=!1,Lr=0,Ps=null,t)throw Error(O(300));e===null||ct||(e=e.dependencies,e!==null&&_n(e)&&(ct=!0))}function rh(e,t,i,s){Te=e;var d=0;do{if(Is&&(Ps=null),Lr=0,Is=!1,25<=d)throw Error(O(301));if(d+=1,lt=Xe=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}U.H=Ph,p=t(i,s)}while(Is);return p}function m_(){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 uo(){var e=xn!==0;return xn=0,e}function fo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function _o(e){if(wn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wn=!1}mi=0,lt=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 lt===null?Te.memoizedState=lt=e:lt=lt.next=e,lt}function at(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=lt===null?Te.memoizedState:lt.next;if(t!==null)lt=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(O(467)):Error(O(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},lt===null?Te.memoizedState=lt=e:lt=lt.next=e}return lt}function Ln(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Er(e){var t=Lr;return Lr+=1,Ps===null&&(Ps=[]),e=Yc(Ps,e,t),t=Te,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Ih:Eo),e}function En(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Er(e);if(e.$$typeof===o)return Ct(e)}throw Error(O(438,String(e)))}function vo(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(d){return d.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 Si(e,t){return typeof t=="function"?t(e):t}function Mn(e){var t=at();return go(t,Xe,e)}function go(e,t,i){var s=e.queue;if(s===null)throw Error(O(311));s.lastRenderedReducer=i;var d=e.baseQueue,p=s.pending;if(p!==null){if(d!==null){var M=d.next;d.next=p.next,p.next=M}t.baseQueue=d=p,s.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{t=d.next;var z=M=null,X=null,se=t,oe=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(Ne&de)===de:(mi&de)===de){var re=se.revertLane;if(re===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===ks&&(oe=!0);else if((mi&re)===re){se=se.next,re===ks&&(oe=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},X===null?(z=X=de,M=p):X=X.next=de,Te.lanes|=re,ji|=re;de=se.action,ds&&i(p,de),p=se.hasEagerState?se.eagerState:i(p,de)}else re={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},X===null?(z=X=re,M=p):X=X.next=re,Te.lanes|=de,ji|=de;se=se.next}while(se!==null&&se!==t);if(X===null?M=p:X.next=z,!kt(p,e.memoizedState)&&(ct=!0,oe&&(i=Hs,i!==null)))throw i;e.memoizedState=p,e.baseState=M,e.baseQueue=X,s.lastRenderedState=p}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function po(e){var t=at(),i=t.queue;if(i===null)throw Error(O(311));i.lastRenderedReducer=e;var s=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var M=d=d.next;do p=e(p,M.action),M=M.next;while(M!==d);kt(p,t.memoizedState)||(ct=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,s]}function nh(e,t,i){var s=Te,d=at(),p=Pe;if(p){if(i===void 0)throw Error(O(407));i=i()}else i=t();var M=!kt((Xe||d).memoizedState,i);if(M&&(d.memoizedState=i,ct=!0),d=d.queue,Co(lh.bind(null,s,d,e),[e]),d.getSnapshot!==t||M||lt!==null&&lt.memoizedState.tag&1){if(s.flags|=2048,Fs(9,{destroy:void 0},oh.bind(null,s,d,i,t),null),Ke===null)throw Error(O(349));p||(mi&127)!==0||ah(s,t,i)}return i}function ah(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 oh(e,t,i,s){t.value=i,t.getSnapshot=s,ch(t)&&hh(e)}function lh(e,t,i){return i(function(){ch(t)&&hh(e)})}function ch(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function hh(e){var t=ss(e,2);t!==null&&Bt(t,e,2)}function mo(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:Si,lastRenderedState:e},t}function uh(e,t,i,s){return e.baseState=i,go(e,Xe,typeof s=="function"?s:Si)}function S_(e,t,i,s,d){if(Dn(e))throw Error(O(485));if(e=t.action,e!==null){var p={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){p.listeners.push(M)}};U.T!==null?i(!0):p.isTransition=!1,s(p),i=t.pending,i===null?(p.next=t.pending=p,dh(t,p)):(p.next=i.next,t.pending=i.next=p)}}function dh(e,t){var i=t.action,s=t.payload,d=e.state;if(t.isTransition){var p=U.T,M={};U.T=M;try{var z=i(d,s),X=U.S;X!==null&&X(M,z),fh(e,t,z)}catch(se){So(e,t,se)}finally{p!==null&&M.types!==null&&(p.types=M.types),U.T=p}}else try{p=i(d,s),fh(e,t,p)}catch(se){So(e,t,se)}}function fh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){_h(e,t,s)},function(s){return So(e,t,s)}):_h(e,t,i)}function _h(e,t,i){t.status="fulfilled",t.value=i,vh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,dh(e,i)))}function So(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,vh(t),t=t.next;while(t!==s)}e.action=null}function vh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gh(e,t){return t}function ph(e,t){if(Pe){var i=Ke.formState;if(i!==null){e:{var s=Te;if(Pe){if(Ze){t:{for(var d=Ze,p=Yt;d.nodeType!==8;){if(!p){d=null;break t}if(d=Kt(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){Ze=Kt(d.nextSibling),s=d.data==="F!";break e}}Oi(s)}s=!1}s&&(t=i[0])}}return i=Lt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:t},i.queue=s,i=zh.bind(null,Te,s),s.dispatch=i,s=mo(!1),p=Lo.bind(null,Te,!1,s.queue),s=Lt(),d={state:t,dispatch:null,action:e,pending:null},s.queue=d,i=S_.bind(null,Te,d,p,i),d.dispatch=i,s.memoizedState=e,[t,i,!1]}function mh(e){var t=at();return Sh(t,Xe,e)}function Sh(e,t,i){if(t=go(e,t,gh)[0],e=Mn(Si)[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 d=t.queue,p=d.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,Fs(9,{destroy:void 0},C_.bind(null,d,i),null)),[s,p,e]}function C_(e,t){e.action=t}function Ch(e){var t=at(),i=Xe;if(i!==null)return Sh(t,i,e);at(),t=t.memoizedState,i=at();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Fs(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 yh(){return at().memoizedState}function An(e,t,i,s){var d=Lt();Te.flags|=e,d.memoizedState=Fs(1|t,{destroy:void 0},i,s===void 0?null:s)}function Rn(e,t,i,s){var d=at();s=s===void 0?null:s;var p=d.memoizedState.inst;Xe!==null&&s!==null&&co(s,Xe.memoizedState.deps)?d.memoizedState=Fs(t,p,i,s):(Te.flags|=e,d.memoizedState=Fs(1|t,p,i,s))}function bh(e,t){An(8390656,8,e,t)}function Co(e,t){Rn(2048,8,e,t)}function y_(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 wh(e){var t=at().memoizedState;return y_({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(O(440));return t.impl.apply(void 0,arguments)}}function xh(e,t){return Rn(4,2,e,t)}function Lh(e,t){return Rn(4,4,e,t)}function Eh(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 Mh(e,t,i){i=i!=null?i.concat([e]):null,Rn(4,4,Eh.bind(null,t,e),i)}function yo(){}function Ah(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&co(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Rh(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&co(t,s[1]))return s[0];if(s=e(),ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(mi&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Du(),Te.lanes|=e,ji|=e,i)}function Dh(e,t,i,s){return kt(i,t)?i:Us.current!==null?(e=bo(e,i,s),kt(e,t)||(ct=!0),e):(mi&42)===0||(mi&1073741824)!==0&&(Ne&261930)===0?(ct=!0,e.memoizedState=i):(e=Du(),Te.lanes|=e,ji|=e,t)}function Th(e,t,i,s,d){var p=P.p;P.p=p!==0&&8>p?p:8;var M=U.T,z={};U.T=z,Lo(e,!1,t,i);try{var X=d(),se=U.S;if(se!==null&&se(z,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var oe=g_(X,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{P.p=p,M!==null&&z.types!==null&&(M.types=z.types),U.T=M}}function b_(){}function wo(e,t,i,s){if(e.tag!==5)throw Error(O(476));var d=Bh(e).queue;Th(e,d,t,F,i===null?b_:function(){return Oh(e),i(s)})}function Bh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:F},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Oh(e){var t=Bh(e);t.next===null&&(t=e.alternate.memoizedState),Mr(e,t.next.queue,{},Pt())}function xo(){return Ct(qr)}function kh(){return at().memoizedState}function Hh(){return at().memoizedState}function w_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Pt();e=zi(i);var s=Ni(t,e,i);s!==null&&(Bt(s,t,i),br(s,t,i)),t={cache:Za()},e.payload=t;return}t=t.return}}function x_(e,t,i){var s=Pt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dn(e)?Nh(t,i):(i=Fa(e,t,i,s),i!==null&&(Bt(i,e,s),Uh(i,t,s)))}function zh(e,t,i){var s=Pt();Mr(e,t,i,s)}function Mr(e,t,i,s){var d={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Dn(e))Nh(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var M=t.lastRenderedState,z=p(M,i);if(d.hasEagerState=!0,d.eagerState=z,kt(z,M))return hn(e,t,d,0),Ke===null&&cn(),!1}catch{}finally{}if(i=Fa(e,t,d,s),i!==null)return Bt(i,e,s),Uh(i,t,s),!0}return!1}function Lo(e,t,i,s){if(s={lane:2,revertLane:sl(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dn(e)){if(t)throw Error(O(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 Nh(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 Uh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,$l(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 Ih={readContext:Ct,use:En,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:bh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,An(4194308,4,Eh.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 d=i(t);if(ds){vt(!0);try{i(t)}finally{vt(!1)}}}else d=t;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=x_.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=zh.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:yo,useDeferredValue:function(e,t){var i=Lt();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=Th.bind(null,Te,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Te,d=Lt();if(Pe){if(i===void 0)throw Error(O(407));i=i()}else{if(i=t(),Ke===null)throw Error(O(349));(Ne&127)!==0||ah(s,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,bh(lh.bind(null,s,p,e),[e]),s.flags|=2048,Fs(9,{destroy:void 0},oh.bind(null,s,p,i,t),null),i},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Pe){var i=oi,s=ai;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=p_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xo,useFormState:ph,useActionState:ph,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=Lo.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:vo,useCacheRefresh:function(){return Lt().memoizedState=w_.bind(null,Te)},useEffectEvent:function(e){var t=Lt(),i={impl:e};return t.memoizedState=i,function(){if(($e&2)!==0)throw Error(O(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:Ct,use:En,useCallback:Ah,useContext:Ct,useEffect:Co,useImperativeHandle:Mh,useInsertionEffect:xh,useLayoutEffect:Lh,useMemo:Rh,useReducer:Mn,useRef:yh,useState:function(){return Mn(Si)},useDebugValue:yo,useDeferredValue:function(e,t){var i=at();return Dh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Mn(Si)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:nh,useId:kh,useHostTransitionStatus:xo,useFormState:mh,useActionState:mh,useOptimistic:function(e,t){var i=at();return uh(i,Xe,e,t)},useMemoCache:vo,useCacheRefresh:Hh};Eo.useEffectEvent=wh;var Ph={readContext:Ct,use:En,useCallback:Ah,useContext:Ct,useEffect:Co,useImperativeHandle:Mh,useInsertionEffect:xh,useLayoutEffect:Lh,useMemo:Rh,useReducer:po,useRef:yh,useState:function(){return po(Si)},useDebugValue:yo,useDeferredValue:function(e,t){var i=at();return Xe===null?bo(i,e,t):Dh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=po(Si)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:nh,useId:kh,useHostTransitionStatus:xo,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var i=at();return Xe!==null?uh(i,Xe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:vo,useCacheRefresh:Hh};Ph.useEffectEvent=wh;function Mo(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 Ao={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Pt(),d=zi(s);d.payload=t,i!=null&&(d.callback=i),t=Ni(e,d,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Pt(),d=zi(s);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=Ni(e,d,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Pt(),s=zi(i);s.tag=2,t!=null&&(s.callback=t),t=Ni(e,s,i),t!==null&&(Bt(t,e,i),br(t,e,i))}};function Fh(e,t,i,s,d,p,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,M):t.prototype&&t.prototype.isPureReactComponent?!_r(i,s)||!_r(d,p):!0}function jh(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&&Ao.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 d in e)i[d]===void 0&&(i[d]=e[d])}return i}function $h(e){ln(e)}function qh(e){console.error(e)}function Wh(e){ln(e)}function Tn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Gh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Ro(e,t,i){return i=zi(i),i.tag=3,i.payload={element:null},i.callback=function(){Tn(e,t)},i}function Xh(e){return e=zi(e),e.tag=3,e}function Yh(e,t,i,s){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var p=s.value;e.payload=function(){return d(p)},e.callback=function(){Gh(t,i,s)}}var M=i.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){Gh(t,i,s),typeof d!="function"&&($i===null?$i=new Set([this]):$i.add(this));var z=s.stack;this.componentDidCatch(s.value,{componentStack:z!==null?z:""})})}function L_(e,t,i,s,d){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,d,!0),i=zt.current,i!==null){switch(i.tag){case 31:case 13:return Vt===null?$n():i.alternate===null&&rt===0&&(rt=3),i.flags&=-257,i.flags|=65536,i.lanes=d,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),el(e,s,d)),!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)),el(e,s,d)),!1}throw Error(O(435,i.tag))}return el(e,s,d),$n(),!1}if(Pe)return t=zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,s!==Xa&&(e=Error(O(422),{cause:s}),pr(Wt(e,i)))):(s!==Xa&&(t=Error(O(423),{cause:s}),pr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=Wt(s,i),d=Ro(e.stateNode,s,d),ro(e,d),rt!==4&&(rt=2)),!1;var p=Error(O(520),{cause:s});if(p=Wt(p,i),zr===null?zr=[p]:zr.push(p),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=d&-d,i.lanes|=e,e=Ro(i.stateNode,s,e),ro(i,e),!1;case 1:if(t=i.type,p=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&($i===null||!$i.has(p))))return i.flags|=65536,d&=-d,i.lanes|=d,d=Xh(d),Yh(d,e,i,s),ro(i,d),!1}i=i.return}while(i!==null);return!1}var Do=Error(O(461)),ct=!1;function yt(e,t,i,s){t.child=e===null?Zc(t,null,i,s):us(t,e.child,i,s)}function Vh(e,t,i,s,d){i=i.render;var p=t.ref;if("ref"in s){var M={};for(var z in s)z!=="ref"&&(M[z]=s[z])}else M=s;return os(t),s=ho(e,t,i,M,p,d),z=uo(),e!==null&&!ct?(fo(e,t,d),Ci(e,t,d)):(Pe&&z&&Wa(t),t.flags|=1,yt(e,t,s,d),t.child)}function Kh(e,t,i,s,d){if(e===null){var p=i.type;return typeof p=="function"&&!ja(p)&&p.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=p,Qh(e,t,p,s,d)):(e=dn(i.type,null,s,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!Uo(e,d)){var M=p.memoizedProps;if(i=i.compare,i=i!==null?i:_r,i(M,s)&&e.ref===t.ref)return Ci(e,t,d)}return t.flags|=1,e=_i(p,s),e.ref=t.ref,e.return=t,t.child=e}function Qh(e,t,i,s,d){if(e!==null){var p=e.memoizedProps;if(_r(p,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=p,Uo(e,d))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Ci(e,t,d)}return To(e,t,i,s,d)}function Zh(e,t,i,s){var d=s.children,p=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(p=p!==null?p.baseLanes|i:i,e!==null){for(s=t.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~p}else s=0,t.child=null;return Jh(e,t,p,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gn(t,p!==null?p.cachePool:null),p!==null?th(t,p):ao(),ih(t);else return s=t.lanes=536870912,Jh(e,t,p!==null?p.baseLanes|i:i,i,s)}else p!==null?(gn(t,p.cachePool),th(t,p),Ii(),t.memoizedState=null):(e!==null&&gn(t,null),ao(),Ii());return yt(e,t,d,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 Jh(e,t,i,s,d){var p=eo();return p=p===null?null:{parent:ot._currentValue,pool:p},t.memoizedState={baseLanes:i,cachePool:p},e!==null&&gn(t,null),ao(),ih(t),e!==null&&Os(e,t,s,!0),t.childLanes=d,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 eu(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 E_(e,t,i){var s=t.pendingProps,d=(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(lo(t),(e=Ze)?(e=dd(e,Yt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},i=Nc(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return Bn(t,s)}var p=e.memoizedState;if(p!==null){var M=p.dehydrated;if(lo(t),d)if(t.flags&256)t.flags&=-257,t=eu(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(O(558));else if(ct||Os(e,t,i,!1),d=(i&e.childLanes)!==0,ct||d){if(s=Ke,s!==null&&(M=ql(s,i),M!==0&&M!==p.retryLane))throw p.retryLane=M,ss(e,M),Bt(s,e,M),Do;$n(),t=eu(e,t,i)}else e=p.treeContext,Ze=Kt(M.nextSibling),St=t,Pe=!0,Bi=null,Yt=!1,e!==null&&Pc(t,e),t=Bn(t,s),t.flags|=4096;return t}return e=_i(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(O(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function To(e,t,i,s,d){return os(t),i=ho(e,t,i,s,void 0,d),s=uo(),e!==null&&!ct?(fo(e,t,d),Ci(e,t,d)):(Pe&&s&&Wa(t),t.flags|=1,yt(e,t,i,d),t.child)}function tu(e,t,i,s,d,p){return os(t),t.updateQueue=null,i=rh(t,s,i,d),sh(e),s=uo(),e!==null&&!ct?(fo(e,t,p),Ci(e,t,p)):(Pe&&s&&Wa(t),t.flags|=1,yt(e,t,i,p),t.child)}function iu(e,t,i,s,d){if(os(t),t.stateNode===null){var p=Rs,M=i.contextType;typeof M=="object"&&M!==null&&(p=Ct(M)),p=new i(s,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Ao,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=s,p.state=t.memoizedState,p.refs={},io(t),M=i.contextType,p.context=typeof M=="object"&&M!==null?Ct(M):Rs,p.state=t.memoizedState,M=i.getDerivedStateFromProps,typeof M=="function"&&(Mo(t,i,M,s),p.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(M=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),M!==p.state&&Ao.enqueueReplaceState(p,p.state,null),xr(t,s,p,d),wr(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){p=t.stateNode;var z=t.memoizedProps,X=fs(i,z);p.props=X;var se=p.context,oe=i.contextType;M=Rs,typeof oe=="object"&&oe!==null&&(M=Ct(oe));var de=i.getDerivedStateFromProps;oe=typeof de=="function"||typeof p.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,oe||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(z||se!==M)&&jh(t,p,s,M),Hi=!1;var re=t.memoizedState;p.state=re,xr(t,s,p,d),wr(),se=t.memoizedState,z||re!==se||Hi?(typeof de=="function"&&(Mo(t,i,de,s),se=t.memoizedState),(X=Hi||Fh(t,i,X,s,re,se,M))?(oe||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=se),p.props=s,p.state=se,p.context=M,s=X):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{p=t.stateNode,so(e,t),M=t.memoizedProps,oe=fs(i,M),p.props=oe,de=t.pendingProps,re=p.context,se=i.contextType,X=Rs,typeof se=="object"&&se!==null&&(X=Ct(se)),z=i.getDerivedStateFromProps,(se=typeof z=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(M!==de||re!==X)&&jh(t,p,s,X),Hi=!1,re=t.memoizedState,p.state=re,xr(t,s,p,d),wr();var ae=t.memoizedState;M!==de||re!==ae||Hi||e!==null&&e.dependencies!==null&&_n(e.dependencies)?(typeof z=="function"&&(Mo(t,i,z,s),ae=t.memoizedState),(oe=Hi||Fh(t,i,oe,s,re,ae,X)||e!==null&&e.dependencies!==null&&_n(e.dependencies))?(se||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,ae,X),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,ae,X)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||M===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ae),p.props=s,p.state=ae,p.context=X,s=oe):(typeof p.componentDidUpdate!="function"||M===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),s=!1)}return p=s,On(e,t),s=(t.flags&128)!==0,p||s?(p=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&s?(t.child=us(t,e.child,null,d),t.child=us(t,null,i,d)):yt(e,t,i,d),t.memoizedState=p.state,e=t.child):e=Ci(e,t,d),e}function su(e,t,i,s){return ns(),t.flags|=256,yt(e,t,i,s),t.child}var Bo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oo(e){return{baseLanes:e,cachePool:Gc()}}function ko(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=It),e}function ru(e,t,i){var s=t.pendingProps,d=!1,p=(t.flags&128)!==0,M;if((M=p)||(M=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),M&&(d=!0,t.flags&=-129),M=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(d?Ui(t):Ii(),(e=Ze)?(e=dd(e,Yt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},i=Nc(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Oi(t);return gl(e)?t.lanes=32:t.lanes=536870912,null}var z=s.children;return s=s.fallback,d?(Ii(),d=t.mode,z=kn({mode:"hidden",children:z},d),s=rs(s,d,i,null),z.return=t,s.return=t,z.sibling=s,t.child=z,s=t.child,s.memoizedState=Oo(i),s.childLanes=ko(e,M,i),t.memoizedState=Bo,Rr(null,s)):(Ui(t),Ho(t,z))}var X=e.memoizedState;if(X!==null&&(z=X.dehydrated,z!==null)){if(p)t.flags&256?(Ui(t),t.flags&=-257,t=zo(e,t,i)):t.memoizedState!==null?(Ii(),t.child=e.child,t.flags|=128,t=null):(Ii(),z=s.fallback,d=t.mode,s=kn({mode:"visible",children:s.children},d),z=rs(z,d,i,null),z.flags|=2,s.return=t,z.return=t,s.sibling=z,t.child=s,us(t,e.child,null,i),s=t.child,s.memoizedState=Oo(i),s.childLanes=ko(e,M,i),t.memoizedState=Bo,t=Rr(null,s));else if(Ui(t),gl(z)){if(M=z.nextSibling&&z.nextSibling.dataset,M)var se=M.dgst;M=se,s=Error(O(419)),s.stack="",s.digest=M,pr({value:s,source:null,stack:null}),t=zo(e,t,i)}else if(ct||Os(e,t,i,!1),M=(i&e.childLanes)!==0,ct||M){if(M=Ke,M!==null&&(s=ql(M,i),s!==0&&s!==X.retryLane))throw X.retryLane=s,ss(e,s),Bt(M,e,s),Do;vl(z)||$n(),t=zo(e,t,i)}else vl(z)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,Ze=Kt(z.nextSibling),St=t,Pe=!0,Bi=null,Yt=!1,e!==null&&Pc(t,e),t=Ho(t,s.children),t.flags|=4096);return t}return d?(Ii(),z=s.fallback,d=t.mode,X=e.child,se=X.sibling,s=_i(X,{mode:"hidden",children:s.children}),s.subtreeFlags=X.subtreeFlags&65011712,se!==null?z=_i(se,z):(z=rs(z,d,i,null),z.flags|=2),z.return=t,s.return=t,s.sibling=z,t.child=s,Rr(null,s),s=t.child,z=e.child.memoizedState,z===null?z=Oo(i):(d=z.cachePool,d!==null?(X=ot._currentValue,d=d.parent!==X?{parent:X,pool:X}:d):d=Gc(),z={baseLanes:z.baseLanes|i,cachePool:d}),s.memoizedState=z,s.childLanes=ko(e,M,i),t.memoizedState=Bo,Rr(e.child,s)):(Ui(t),i=e.child,e=i.sibling,i=_i(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 Ho(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 zo(e,t,i){return us(t,e.child,null,i),e=Ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nu(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ka(e.return,t,i)}function No(e,t,i,s,d,p){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:d,treeForkCount:p}:(M.isBackwards=t,M.rendering=null,M.renderingStartTime=0,M.last=s,M.tail=i,M.tailMode=d,M.treeForkCount=p)}function au(e,t,i){var s=t.pendingProps,d=s.revealOrder,p=s.tail;s=s.children;var M=nt.current,z=(M&2)!==0;if(z?(M=M&1|2,t.flags|=128):M&=1,Y(nt,M),yt(e,t,s,i),s=Pe?gr:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,i,t);else if(e.tag===19)nu(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(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&bn(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),No(t,!1,d,i,p,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&bn(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}No(t,!0,i,null,p,s);break;case"together":No(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ci(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ji|=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(O(153));if(t.child!==null){for(e=t.child,i=_i(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=_i(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Uo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_n(e)))}function M_(e,t,i){switch(t.tag){case 3:N(t,t.stateNode.containerInfo),ki(t,ot,e.memoizedState.cache),ns();break;case 27:case 5:ee(t);break;case 4:N(t,t.stateNode.containerInfo);break;case 10:ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ui(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ru(e,t,i):(Ui(t),e=Ci(e,t,i),e!==null?e.sibling:null);Ui(t);break;case 19:var d=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),d){if(s)return au(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Y(nt,nt.current),s)break;return null;case 22:return t.lanes=0,Zh(e,t,i,t.pendingProps);case 24:ki(t,ot,e.memoizedState.cache)}return Ci(e,t,i)}function ou(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Uo(e,i)&&(t.flags&128)===0)return ct=!1,M_(e,t,i);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&Ic(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")ja(e)?(s=fs(e,s),t.tag=1,t=iu(null,t,e,s,i)):(t.tag=0,t=To(null,t,e,s,i));else{if(e!=null){var d=e.$$typeof;if(d===m){t.tag=11,t=Vh(null,t,e,s,i);break e}else if(d===w){t.tag=14,t=Kh(null,t,e,s,i);break e}}throw t=H(e)||e,Error(O(306,t,""))}}return t;case 0:return To(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,d=fs(s,t.pendingProps),iu(e,t,s,d,i);case 3:e:{if(N(t,t.stateNode.containerInfo),e===null)throw Error(O(387));s=t.pendingProps;var p=t.memoizedState;d=p.element,so(e,t),xr(t,s,null,i);var M=t.memoizedState;if(s=M.cache,ki(t,ot,s),s!==p.cache&&Qa(t,[ot],i,!0),wr(),s=M.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:M.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=su(e,t,s,i);break e}else if(s!==d){d=Wt(Error(O(424)),t),pr(d),t=su(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,Bi=null,Yt=!0,i=Zc(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ns(),s===d){t=Ci(e,t,i);break e}yt(e,t,s,i)}t=t.child}return t;case 26:return On(e,t),e===null?(i=md(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=md(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Pe&&(s=t.stateNode=vd(t.type,t.pendingProps,ce.current),St=t,Yt=!0,d=Ze,Xi(t.type)?(pl=d,Ze=Kt(s.firstChild)):Ze=d),yt(e,t,t.pendingProps.children,i),On(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((d=s=Ze)&&(s=sv(s,t.type,t.pendingProps,Yt),s!==null?(t.stateNode=s,St=t,Ze=Kt(s.firstChild),Yt=!1,d=!0):d=!1),d||Oi(t)),ee(t),d=t.type,p=t.pendingProps,M=e!==null?e.memoizedProps:null,s=p.children,dl(d,p)?s=null:M!==null&&dl(d,M)&&(t.flags|=32),t.memoizedState!==null&&(d=ho(e,t,m_,null,null,i),qr._currentValue=d),On(e,t),yt(e,t,s,i),t.child;case 6:return e===null&&Pe&&((e=i=Ze)&&(i=rv(i,t.pendingProps,Yt),i!==null?(t.stateNode=i,St=t,Ze=null,e=!0):e=!1),e||Oi(t)),null;case 13:return ru(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 Vh(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,ki(t,t.type,s.value),yt(e,t,s.children,i),t.child;case 9:return d=t.type._context,s=t.pendingProps.children,os(t),d=Ct(d),s=s(d),t.flags|=1,yt(e,t,s,i),t.child;case 14:return Kh(e,t,t.type,t.pendingProps,i);case 15:return Qh(e,t,t.type,t.pendingProps,i);case 19:return au(e,t,i);case 31:return E_(e,t,i);case 22:return Zh(e,t,i,t.pendingProps);case 24:return os(t),s=Ct(ot),e===null?(d=eo(),d===null&&(d=Ke,p=Za(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=i),d=p),t.memoizedState={parent:s,cache:d},io(t),ki(t,ot,d)):((e.lanes&i)!==0&&(so(e,t),xr(t,null,null,i),wr()),d=e.memoizedState,p=t.memoizedState,d.parent!==s?(d={parent:s,cache:s},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),ki(t,ot,s)):(s=p.cache,ki(t,ot,s),s!==d.cache&&Qa(t,[ot],i,!0))),yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(O(156,t.tag))}function yi(e){e.flags|=4}function Io(e,t,i,s,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(ku())e.flags|=8192;else throw hs=mn,to}else e.flags&=-16777217}function lu(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wd(t))if(ku())e.flags|=8192;else throw hs=mn,to}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fl():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 d=e.child;d!==null;)i|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function A_(e,t,i){var s=t.pendingProps;switch(Ga(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),pi(ot),J(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?yi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ya())),Je(t),null;case 26:var d=t.type,p=t.memoizedState;return e===null?(yi(t),p!==null?(Je(t),lu(t,p)):(Je(t),Io(t,d,null,s,i))):p?p!==e.memoizedState?(yi(t),Je(t),lu(t,p)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&yi(t),Je(t),Io(t,d,e,s,i)),null;case 27:if(_e(t),i=ce.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(!s){if(t.stateNode===null)throw Error(O(166));return Je(t),null}e=V.current,Bs(t)?Fc(t):(e=vd(d,s,i),t.stateNode=e,yi(t))}return Je(t),null;case 5:if(_e(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(!s){if(t.stateNode===null)throw Error(O(166));return Je(t),null}if(p=V.current,Bs(t))Fc(t);else{var M=Kn(ce.current);switch(p){case 1:p=M.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=M.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=M.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=M.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=M.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?M.createElement("select",{is:s.is}):M.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?M.createElement(d,{is:s.is}):M.createElement(d)}}p[mt]=t,p[Et]=s;e:for(M=t.child;M!==null;){if(M.tag===5||M.tag===6)p.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=p;e:switch(bt(p,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&yi(t)}}return Je(t),Io(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(O(166));if(e=ce.current,Bs(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,d=St,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[mt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||rd(e.nodeValue,i)),e||Oi(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(O(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(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(O(558))}return Je(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Bs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(O(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(O(317));d[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),d=!1}else d=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)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,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==d&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),Je(t),null);case 4:return J(),e===null&&ol(t.stateNode.containerInfo),Je(t),null;case 10:return pi(t.type),Je(t),null;case 19:if(k(nt),s=t.memoizedState,s===null)return Je(t),null;if(d=(t.flags&128)!==0,p=s.rendering,p===null)if(d)Dr(s,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=bn(e),p!==null){for(t.flags|=128,Dr(s,!1),e=p.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)zc(i,e),i=i.sibling;return Y(nt,nt.current&1|2),Pe&&vi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ge()>Pn&&(t.flags|=128,d=!0,Dr(s,!1),t.lanes=4194304)}else{if(!d)if(e=bn(p),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!Pe)return Je(t),null}else 2*ge()-s.renderingStartTime>Pn&&i!==536870912&&(t.flags|=128,d=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(p.sibling=t.child,t.child=p):(e=s.last,e!==null?e.sibling=p:t.child=p,s.last=p)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ge(),e.sibling=null,i=nt.current,Y(nt,d?i&1|2:i&1),Pe&&vi(t,s.treeForkCount),e):(Je(t),null);case 22:case 23:return Nt(t),oo(),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(ls),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),pi(ot),Je(t),null;case 25:return null;case 30:return null}throw Error(O(156,t.tag))}function R_(e,t){switch(Ga(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(ot),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(O(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(O(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(nt),null;case 4:return J(),null;case 10:return pi(t.type),null;case 22:case 23:return Nt(t),oo(),e!==null&&k(ls),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pi(ot),null;case 25:return null;default:return null}}function cu(e,t){switch(Ga(t),t.tag){case 3:pi(ot),J();break;case 26:case 27:case 5:_e(t);break;case 4:J();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:k(nt);break;case 10:pi(t.type);break;case 22:case 23:Nt(t),oo(),e!==null&&k(ls);break;case 24:pi(ot)}}function Tr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var d=s.next;i=d;do{if((i.tag&e)===e){s=void 0;var p=i.create,M=i.inst;s=p(),M.destroy=s}i=i.next}while(i!==d)}}catch(z){Ge(t,t.return,z)}}function Pi(e,t,i){try{var s=t.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&e)===e){var M=s.inst,z=M.destroy;if(z!==void 0){M.destroy=void 0,d=t;var X=i,se=z;try{se()}catch(oe){Ge(d,X,oe)}}}s=s.next}while(s!==p)}}catch(oe){Ge(t,t.return,oe)}}function hu(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{eh(t,i)}catch(s){Ge(e,e.return,s)}}}function uu(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(d){Ge(e,t,d)}}function li(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(d){Ge(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){Ge(e,t,d)}else i.current=null}function du(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(d){Ge(e,e.return,d)}}function Po(e,t,i){try{var s=e.stateNode;Q_(s,e.type,i,t),s[Et]=t}catch(d){Ge(e,e.return,d)}}function fu(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xi(e.type)||e.tag===4}function Fo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fu(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&&Xi(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 jo(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=di));else if(s!==4&&(s===27&&Xi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(jo(e,t,i),e=e.sibling;e!==null;)jo(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&&Xi(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 _u(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);bt(t,s,i),t[mt]=e,t[Et]=i}catch(p){Ge(e,e.return,p)}}var bi=!1,ht=!1,$o=!1,vu=typeof WeakSet=="function"?WeakSet:Set,pt=null;function D_(e,t){if(e=e.containerInfo,hl=sa,e=Mc(e),Ha(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 d=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var M=0,z=-1,X=-1,se=0,oe=0,de=e,re=null;t:for(;;){for(var ae;de!==i||d!==0&&de.nodeType!==3||(z=M+d),de!==p||s!==0&&de.nodeType!==3||(X=M+s),de.nodeType===3&&(M+=de.nodeValue.length),(ae=de.firstChild)!==null;)re=de,de=ae;for(;;){if(de===e)break t;if(re===i&&++se===d&&(z=M),re===p&&++oe===s&&(X=M),(ae=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=ae}i=z===-1||X===-1?null:{start:z,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(ul={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,p=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++)d=e[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,i=t,d=p.memoizedProps,p=p.memoizedState,s=i.stateNode;try{var Ce=fs(i.type,d);e=s.getSnapshotBeforeUpdate(Ce,p),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)_l(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_l(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(O(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function gu(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:xi(e,i),s&4&&Tr(5,i);break;case 1:if(xi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(M){Ge(i,i.return,M)}else{var d=fs(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(M){Ge(i,i.return,M)}}s&64&&hu(i),s&512&&Br(i,i.return);break;case 3:if(xi(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{eh(e,t)}catch(M){Ge(i,i.return,M)}}break;case 27:t===null&&s&4&&_u(i);case 26:case 5:xi(e,i),t===null&&s&4&&du(i),s&512&&Br(i,i.return);break;case 12:xi(e,i);break;case 31:xi(e,i),s&4&&Su(e,i);break;case 13:xi(e,i),s&4&&Cu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=I_.bind(null,i),nv(e,i))));break;case 22:if(s=i.memoizedState!==null||bi,!s){t=t!==null&&t.memoizedState!==null||ht,d=bi;var p=ht;bi=s,(ht=t)&&!p?Li(e,i,(i.subtreeFlags&8772)!==0):xi(e,i),bi=d,ht=p}break;case 30:break;default:xi(e,i)}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ma(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 wi(e,t,i){for(i=i.child;i!==null;)mu(e,t,i),i=i.sibling}function mu(e,t,i){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(xt,i)}catch{}switch(i.tag){case 26:ht||li(i,t),wi(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,d=At;Xi(i.type)&&(et=i.stateNode,At=!1),wi(e,t,i),Fr(i.stateNode),et=s,At=d;break;case 5:ht||li(i,t);case 6:if(s=et,d=At,et=null,wi(e,t,i),et=s,At=d,et!==null)if(At)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(p){Ge(i,t,p)}else try{et.removeChild(i.stateNode)}catch(p){Ge(i,t,p)}break;case 18:et!==null&&(At?(e=et,hd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):hd(et,i.stateNode));break;case 4:s=et,d=At,et=i.stateNode.containerInfo,At=!0,wi(e,t,i),et=s,At=d;break;case 0:case 11:case 14:case 15:Pi(2,i,t),ht||Pi(4,i,t),wi(e,t,i);break;case 1:ht||(li(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&uu(i,t,s)),wi(e,t,i);break;case 21:wi(e,t,i);break;case 22:ht=(s=ht)||i.memoizedState!==null,wi(e,t,i),ht=s;break;default:wi(e,t,i)}}function Su(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 Cu(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 T_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vu),t;default:throw Error(O(435,e.tag))}}function Nn(e,t){var i=T_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var d=P_.bind(null,e,s);s.then(d,d)}})}function Rt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var d=i[s],p=e,M=t,z=M;e:for(;z!==null;){switch(z.tag){case 27:if(Xi(z.type)){et=z.stateNode,At=!1;break e}break;case 5:et=z.stateNode,At=!1;break e;case 3:case 4:et=z.stateNode.containerInfo,At=!0;break e}z=z.return}if(et===null)throw Error(O(160));mu(p,M,d),et=null,At=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yu(t,e),t=t.sibling}var ti=null;function yu(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&&(Pi(3,e,e.return),Tr(3,e),Pi(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&64&&bi&&(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 d=ti;if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&4){var p=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,d=d.ownerDocument||d;t:switch(s){case"title":p=d.getElementsByTagName("title")[0],(!p||p[nr]||p[mt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(s),d.head.insertBefore(p,d.querySelector("head > title"))),bt(p,s,i),p[mt]=e,gt(p),s=p;break e;case"link":var M=yd("link","href",d).get(s+(i.href||""));if(M){for(var z=0;z<M.length;z++)if(p=M[z],p.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&p.getAttribute("rel")===(i.rel==null?null:i.rel)&&p.getAttribute("title")===(i.title==null?null:i.title)&&p.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){M.splice(z,1);break t}}p=d.createElement(s),bt(p,s,i),d.head.appendChild(p);break;case"meta":if(M=yd("meta","content",d).get(s+(i.content||""))){for(z=0;z<M.length;z++)if(p=M[z],p.getAttribute("content")===(i.content==null?null:""+i.content)&&p.getAttribute("name")===(i.name==null?null:i.name)&&p.getAttribute("property")===(i.property==null?null:i.property)&&p.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&p.getAttribute("charset")===(i.charSet==null?null:i.charSet)){M.splice(z,1);break t}}p=d.createElement(s),bt(p,s,i),d.head.appendChild(p);break;default:throw Error(O(468,s))}p[mt]=e,gt(p),s=p}e.stateNode=s}else bd(d,e.type,e.stateNode);else e.stateNode=Cd(d,s,e.memoizedProps);else p!==s?(p===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):p.count--,s===null?bd(d,e.type,e.stateNode):Cd(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Po(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&&Po(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){d=e.stateNode;try{bs(d,"")}catch(Ce){Ge(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,Po(e,d,i!==null?i.memoizedProps:d)),s&1024&&($o=!0);break;case 6:if(Rt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(O(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Ce){Ge(e,e.return,Ce)}}break;case 3:if(Jn=null,d=ti,ti=Qn(t.containerInfo),Rt(t,e),ti=d,Dt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(Ce){Ge(e,e.return,Ce)}$o&&($o=!1,bu(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:d=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,se=bi,oe=ht;if(bi=se||d,ht=oe||X,Rt(t,e),ht=oe,bi=se,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(i===null||X||bi||ht||_s(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(p=X.stateNode,d)M=p.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{z=X.stateNode;var de=X.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=d?"":X.memoizedProps}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===18){if(i===null){X=t;try{var ae=X.stateNode;d?ud(ae,!0):ud(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(fu(s)){i=s;break}s=s.return}if(i==null)throw Error(O(160));switch(i.tag){case 27:var d=i.stateNode,p=Fo(e);zn(e,p,d);break;case 5:var M=i.stateNode;i.flags&32&&(bs(M,""),i.flags&=-33);var z=Fo(e);zn(e,z,M);break;case 3:case 4:var X=i.stateNode.containerInfo,se=Fo(e);jo(e,se,X);break;default:throw Error(O(161))}}catch(oe){Ge(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bu(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(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:Pi(4,t,t.return),_s(t);break;case 1:li(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&uu(t,t.return,i),_s(t);break;case 27:Fr(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 Li(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,d=e,p=t,M=p.flags;switch(p.tag){case 0:case 11:case 15:Li(d,p,i),Tr(4,p);break;case 1:if(Li(d,p,i),s=p,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(se){Ge(s,s.return,se)}if(s=p,d=s.updateQueue,d!==null){var z=s.stateNode;try{var X=d.shared.hiddenCallbacks;if(X!==null)for(d.shared.hiddenCallbacks=null,d=0;d<X.length;d++)Jc(X[d],z)}catch(se){Ge(s,s.return,se)}}i&&M&64&&hu(p),Br(p,p.return);break;case 27:_u(p);case 26:case 5:Li(d,p,i),i&&s===null&&M&4&&du(p),Br(p,p.return);break;case 12:Li(d,p,i);break;case 31:Li(d,p,i),i&&M&4&&Su(d,p);break;case 13:Li(d,p,i),i&&M&4&&Cu(d,p);break;case 22:p.memoizedState===null&&Li(d,p,i),Br(p,p.return);break;case 30:break;default:Li(d,p,i)}t=t.sibling}}function qo(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 Wo(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;)wu(e,t,i,s),t=t.sibling}function wu(e,t,i,s){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ii(e,t,i,s),d&2048&&Tr(9,t);break;case 1:ii(e,t,i,s);break;case 3:ii(e,t,i,s),d&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(d&2048){ii(e,t,i,s),e=t.stateNode;try{var p=t.memoizedProps,M=p.id,z=p.onPostCommit;typeof z=="function"&&z(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:p=t.stateNode,M=t.alternate,t.memoizedState!==null?p._visibility&2?ii(e,t,i,s):Or(e,t):p._visibility&2?ii(e,t,i,s):(p._visibility|=2,js(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),d&2048&&qo(M,t);break;case 24:ii(e,t,i,s),d&2048&&Wo(t.alternate,t);break;default:ii(e,t,i,s)}}function js(e,t,i,s,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var p=e,M=t,z=i,X=s,se=M.flags;switch(M.tag){case 0:case 11:case 15:js(p,M,z,X,d),Tr(8,M);break;case 23:break;case 22:var oe=M.stateNode;M.memoizedState!==null?oe._visibility&2?js(p,M,z,X,d):Or(p,M):(oe._visibility|=2,js(p,M,z,X,d)),d&&se&2048&&qo(M.alternate,M);break;case 24:js(p,M,z,X,d),d&&se&2048&&Wo(M.alternate,M);break;default:js(p,M,z,X,d)}t=t.sibling}}function Or(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,d=s.flags;switch(s.tag){case 22:Or(i,s),d&2048&&qo(s.alternate,s);break;case 24:Or(i,s),d&2048&&Wo(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;)xu(e,t,i),e=e.sibling}function xu(e,t,i){switch(e.tag){case 26:$s(e,t,i),e.flags&kr&&e.memoizedState!==null&&pv(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 Lu(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,Mu(s,e)}Lu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Eu(e),e=e.sibling}function Eu(e){switch(e.tag){case 0:case 11:case 15:Hr(e),e.flags&2048&&Pi(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,Mu(s,e)}Lu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pi(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 Mu(e,t){for(;pt!==null;){var i=pt;switch(i.tag){case 0:case 11:case 15:Pi(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 d=s.sibling,p=s.return;if(pu(s),s===i){pt=null;break e}if(d!==null){d.return=p,pt=d;break e}pt=p}}}var B_={getCacheForType:function(e){var t=Ct(ot),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ct(ot).controller.signal}},O_=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ke=null,ke=null,Ne=0,We=0,Ut=null,Fi=!1,qs=!1,Go=!1,Ei=0,rt=0,ji=0,vs=0,Xo=0,It=0,Ws=0,zr=null,Tt=null,Yo=!1,In=0,Au=0,Pn=1/0,Fn=null,$i=null,dt=0,qi=null,Gs=null,Mi=0,Vo=0,Ko=null,Ru=null,Nr=0,Qo=null;function Pt(){return($e&2)!==0&&Ne!==0?Ne&-Ne:U.T!==null?sl():Wl()}function Du(){if(It===0)if((Ne&536870912)===0||Pe){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=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),Wi(e,Ne,It,!1)),rr(e,i),(($e&2)===0||e!==Ke)&&(e===Ke&&(($e&2)===0&&(vs|=i),rt===4&&Wi(e,Ne,It,!1)),ci(e))}function Tu(e,t,i){if(($e&6)!==0)throw Error(O(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||sr(e,t),d=s?z_(e,t):Jo(e,t,!0),p=s;do{if(d===0){qs&&!s&&Wi(e,t,0,!1);break}else{if(i=e.current.alternate,p&&!k_(i)){d=Jo(e,t,!1),p=!1;continue}if(d===2){if(p=t,e.errorRecoveryDisabledLanes&p)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){t=M;e:{var z=e;d=zr;var X=z.current.memoizedState.isDehydrated;if(X&&(Xs(z,M).flags|=256),M=Jo(z,M,!1),M!==2){if(Go&&!X){z.errorRecoveryDisabledLanes|=p,vs|=p,d=4;break e}p=Tt,Tt=d,p!==null&&(Tt===null?Tt=p:Tt.push.apply(Tt,p))}d=M}if(p=!1,d!==2)continue}}if(d===1){Xs(e,0),Wi(e,t,0,!0);break}e:{switch(s=e,p=d,p){case 0:case 1:throw Error(O(345));case 4:if((t&4194048)!==t)break;case 6:Wi(s,t,It,!Fi);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((t&62914560)===t&&(d=In+300-ge(),10<d)){if(Wi(s,t,It,!Fi),Kr(s,0,!0)!==0)break e;Mi=t,s.timeoutHandle=ld(Bu.bind(null,s,i,Tt,Fn,Yo,t,It,vs,Ws,Fi,p,"Throttled",-0,0),d);break e}Bu(s,i,Tt,Fn,Yo,t,It,vs,Ws,Fi,p,null,-0,0)}}break}while(!0);ci(e)}function Bu(e,t,i,s,d,p,M,z,X,se,oe,de,re,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:di},xu(t,p,de);var Ce=(p&62914560)===p?In-ge():(p&4194048)===p?Au-ge():0;if(Ce=mv(de,Ce),Ce!==null){Mi=p,e.cancelPendingCommit=Ce(Pu.bind(null,e,t,p,i,s,d,M,z,X,oe,de,null,re,ae)),Wi(e,p,M,!se);return}}Pu(e,t,p,i,s,d,M,z,X)}function k_(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 d=i[s],p=d.getSnapshot;d=d.value;try{if(!kt(p(),d))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 Wi(e,t,i,s){t&=~Xo,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var d=t;0<d;){var p=31-ut(d),M=1<<p;s[p]=-1,d&=~M}i!==0&&jl(e,i,t)}function jn(){return($e&6)===0?(Ur(0),!1):!0}function Zo(){if(ke!==null){if(We===0)var e=ke.return;else e=ke,gi=as=null,_o(e),Ns=null,Cr=0,e=ke;for(;e!==null;)cu(e.alternate,e),e=e.return;ke=null}}function Xs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,ev(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Mi=0,Zo(),Ke=e,ke=i=_i(e.current,null),Ne=t,We=0,Ut=null,Fi=!1,qs=sr(e,t),Go=!1,Ws=It=Xo=vs=ji=rt=0,Tt=zr=null,Yo=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var d=31-ut(s),p=1<<d;t|=e[d],s&=~p}return Ei=t,cn(),i}function Ou(e,t){Te=null,U.H=Ar,t===zs||t===pn?(t=Vc(),We=3):t===to?(t=Vc(),We=4):We=t===Do?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 ku(){var e=zt.current;return e===null?!0:(Ne&4194048)===Ne?Vt===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===Vt:!1}function Hu(){var e=U.H;return U.H=Ar,e===null?Ar:e}function zu(){var e=U.A;return U.A=B_,e}function $n(){rt=4,Fi||(Ne&4194048)!==Ne&&zt.current!==null||(qs=!0),(ji&134217727)===0&&(vs&134217727)===0||Ke===null||Wi(Ke,Ne,It,!1)}function Jo(e,t,i){var s=$e;$e|=2;var d=Hu(),p=zu();(Ke!==e||Ne!==t)&&(Fn=null,Xs(e,t)),t=!1;var M=rt;e:do try{if(We!==0&&ke!==null){var z=ke,X=Ut;switch(We){case 8:Zo(),M=6;break e;case 3:case 2:case 9:case 6:zt.current===null&&(t=!0);var se=We;if(We=0,Ut=null,Ys(e,z,X,se),i&&qs){M=0;break e}break;default:se=We,We=0,Ut=null,Ys(e,z,X,se)}}H_(),M=rt;break}catch(oe){Ou(e,oe)}while(!0);return t&&e.shellSuspendCounter++,gi=as=null,$e=s,U.H=d,U.A=p,ke===null&&(Ke=null,Ne=0,cn()),M}function H_(){for(;ke!==null;)Nu(ke)}function z_(e,t){var i=$e;$e|=2;var s=Hu(),d=zu();Ke!==e||Ne!==t?(Fn=null,Pn=ge()+500,Xs(e,t)):qs=sr(e,t);e:do try{if(We!==0&&ke!==null){t=ke;var p=Ut;t:switch(We){case 1:We=0,Ut=null,Ys(e,t,p,1);break;case 2:case 9:if(Xc(p)){We=0,Ut=null,Uu(t);break}t=function(){We!==2&&We!==9||Ke!==e||(We=7),ci(e)},p.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Xc(p)?(We=0,Ut=null,Uu(t)):(We=0,Ut=null,Ys(e,t,p,7));break;case 5:var M=null;switch(ke.tag){case 26:M=ke.memoizedState;case 5:case 27:var z=ke;if(M?wd(M):z.stateNode.complete){We=0,Ut=null;var X=z.sibling;if(X!==null)ke=X;else{var se=z.return;se!==null?(ke=se,qn(se)):ke=null}break t}}We=0,Ut=null,Ys(e,t,p,5);break;case 6:We=0,Ut=null,Ys(e,t,p,6);break;case 8:Zo(),rt=6;break e;default:throw Error(O(462))}}N_();break}catch(oe){Ou(e,oe)}while(!0);return gi=as=null,U.H=s,U.A=d,$e=i,ke!==null?0:(Ke=null,Ne=0,cn(),rt)}function N_(){for(;ke!==null&&!me();)Nu(ke)}function Nu(e){var t=ou(e.alternate,e,Ei);e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Uu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=tu(i,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=tu(i,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:_o(t);default:cu(i,t),t=ke=zc(t,Ei),t=ou(i,t,Ei)}e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Ys(e,t,i,s){gi=as=null,_o(t),Ns=null,Cr=0;var d=t.return;try{if(L_(e,d,t,i,Ne)){rt=1,Tn(e,Wt(i,e.current)),ke=null;return}}catch(p){if(d!==null)throw ke=d,p;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:(Fi=e=!0,(s===2||s===9||s===3||s===6)&&(s=zt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Iu(t,e)):qn(t)}function qn(e){var t=e;do{if((t.flags&32768)!==0){Iu(t,Fi);return}e=t.return;var i=A_(t.alternate,t,Ei);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 Iu(e,t){do{var i=R_(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 Pu(e,t,i,s,d,p,M,z,X){e.cancelPendingCommit=null;do Wn();while(dt!==0);if(($e&6)!==0)throw Error(O(327));if(t!==null){if(t===e.current)throw Error(O(177));if(p=t.lanes|t.childLanes,p|=Pa,gf(e,i,p,M,z,X),e===Ke&&(ke=Ke=null,Ne=0),Gs=t,qi=e,Mi=i,Vo=p,Ko=d,Ru=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,F_(Qe,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,d=P.p,P.p=2,M=$e,$e|=4;try{D_(e,t,i)}finally{$e=M,P.p=d,U.T=s}}dt=1,Fu(),ju(),$u()}}function Fu(){if(dt===1){dt=0;var e=qi,t=Gs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var d=$e;$e|=4;try{yu(t,e);var p=ul,M=Mc(e.containerInfo),z=p.focusedElem,X=p.selectionRange;if(M!==z&&z&&z.ownerDocument&&Ec(z.ownerDocument.documentElement,z)){if(X!==null&&Ha(z)){var se=X.start,oe=X.end;if(oe===void 0&&(oe=se),"selectionStart"in z)z.selectionStart=se,z.selectionEnd=Math.min(oe,z.value.length);else{var de=z.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var ae=re.getSelection(),Ce=z.textContent.length,Ee=Math.min(X.start,Ce),Ve=X.end===void 0?Ee:Math.min(X.end,Ce);!ae.extend&&Ee>Ve&&(M=Ve,Ve=Ee,Ee=M);var Z=Lc(z,Ee),K=Lc(z,Ve);if(Z&&K&&(ae.rangeCount!==1||ae.anchorNode!==Z.node||ae.anchorOffset!==Z.offset||ae.focusNode!==K.node||ae.focusOffset!==K.offset)){var ie=de.createRange();ie.setStart(Z.node,Z.offset),ae.removeAllRanges(),Ee>Ve?(ae.addRange(ie),ae.extend(K.node,K.offset)):(ie.setEnd(K.node,K.offset),ae.addRange(ie))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var he=de[z];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}sa=!!hl,ul=hl=null}finally{$e=d,P.p=s,U.T=i}}e.current=t,dt=2}}function ju(){if(dt===2){dt=0;var e=qi,t=Gs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var d=$e;$e|=4;try{gu(e,t.alternate,t)}finally{$e=d,P.p=s,U.T=i}}dt=3}}function $u(){if(dt===4||dt===3){dt=0,ue();var e=qi,t=Gs,i=Mi,s=Ru;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Gs=qi=null,qu(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&($i=null),ga(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,d=P.p,P.p=2,U.T=null;try{for(var p=e.onRecoverableError,M=0;M<s.length;M++){var z=s[M];p(z.value,{componentStack:z.stack})}}finally{U.T=t,P.p=d}}(Mi&3)!==0&&Wn(),ci(e),d=e.pendingLanes,(i&261930)!==0&&(d&42)!==0?e===Qo?Nr++:(Nr=0,Qo=e):Nr=0,Ur(0)}}function qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function Wn(){return Fu(),ju(),$u(),Wu()}function Wu(){if(dt!==5)return!1;var e=qi,t=Vo;Vo=0;var i=ga(Mi),s=U.T,d=P.p;try{P.p=32>i?32:i,U.T=null,i=Ko,Ko=null;var p=qi,M=Mi;if(dt=0,Gs=qi=null,Mi=0,($e&6)!==0)throw Error(O(331));var z=$e;if($e|=4,Eu(p.current),wu(p,p.current,M,i),$e=z,Ur(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(xt,p)}catch{}return!0}finally{P.p=d,U.T=s,qu(e,t)}}function Gu(e,t,i){t=Wt(i,t),t=Ro(e.stateNode,t,2),e=Ni(e,t,2),e!==null&&(rr(e,2),ci(e))}function Ge(e,t,i){if(e.tag===3)Gu(e,e,i);else for(;t!==null;){if(t.tag===3){Gu(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&($i===null||!$i.has(s))){e=Wt(i,e),i=Xh(2),s=Ni(t,i,2),s!==null&&(Yh(i,s,t,e),rr(s,2),ci(s));break}}t=t.return}}function el(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new O_;var d=new Set;s.set(t,d)}else d=s.get(t),d===void 0&&(d=new Set,s.set(t,d));d.has(i)||(Go=!0,d.add(i),e=U_.bind(null,e,t,i),t.then(e,e))}function U_(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):Xo|=i,Ws===Ne&&(Ws=0)),ci(e)}function Xu(e,t){t===0&&(t=Fl()),e=ss(e,t),e!==null&&(rr(e,t),ci(e))}function I_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Xu(e,i)}function P_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(O(314))}s!==null&&s.delete(t),Xu(e,i)}function F_(e,t){return Se(e,t)}var Gn=null,Vs=null,tl=!1,Xn=!1,il=!1,Gi=0;function ci(e){e!==Vs&&e.next===null&&(Vs===null?Gn=Vs=e:Vs=Vs.next=e),Xn=!0,tl||(tl=!0,$_())}function Ur(e,t){if(!il&&Xn){il=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var p=0;else{var M=s.suspendedLanes,z=s.pingedLanes;p=(1<<31-ut(42|e)+1)-1,p&=d&~(M&~z),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(i=!0,Qu(s,p))}else p=Ne,p=Kr(s,s===Ke?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||sr(s,p)||(i=!0,Qu(s,p));s=s.next}while(i);il=!1}}function j_(){Yu()}function Yu(){Xn=tl=!1;var e=0;Gi!==0&&J_()&&(e=Gi);for(var t=ge(),i=null,s=Gn;s!==null;){var d=s.next,p=Vu(s,t);p===0?(s.next=null,i===null?Gn=d:i.next=d,d===null&&(Vs=i)):(i=s,(e!==0||(p&3)!==0)&&(Xn=!0)),s=d}dt!==0&&dt!==5||Ur(e),Gi!==0&&(Gi=0)}function Vu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var M=31-ut(p),z=1<<M,X=d[M];X===-1?((z&i)===0||(z&s)!==0)&&(d[M]=vf(z,t)):X<=t&&(e.expiredLanes|=z),p&=~z}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),ga(i)){case 2:case 8:i=_t;break;case 32:i=Qe;break;case 268435456:i=Ie;break;default:i=Qe}return s=Ku.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 Ku(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:(Tu(e,s,t),Vu(e,ge()),e.callbackNode!=null&&e.callbackNode===i?Ku.bind(null,e):null)}function Qu(e,t){if(Wn())return null;Tu(e,t,!0)}function $_(){tv(function(){($e&6)!==0?Se(Re,j_):Yu()})}function sl(){if(Gi===0){var e=ks;e===0&&(e=Ft,Ft<<=1,(Ft&261888)===0&&(Ft=256)),Gi=e}return Gi}function Zu(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function Ju(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 q_(e,t,i,s,d){if(t==="submit"&&i&&i.stateNode===d){var p=Zu((d[Et]||null).action),M=s.submitter;M&&(t=(t=M[Et]||null)?Zu(t.formAction):M.getAttribute("formAction"),t!==null&&(p=t,M=null));var z=new nn("action","action",null,s,d);e.push({event:z,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gi!==0){var X=M?Ju(d,M):new FormData(d);wo(i,{pending:!0,data:X,method:d.method,action:p},null,X)}}else typeof p=="function"&&(z.preventDefault(),X=M?Ju(d,M):new FormData(d),wo(i,{pending:!0,data:X,method:d.method,action:p},p,X))},currentTarget:d}]})}}for(var rl=0;rl<Ia.length;rl++){var nl=Ia[rl],W_=nl.toLowerCase(),G_=nl[0].toUpperCase()+nl.slice(1);ei(W_,"on"+G_)}ei(Dc,"onAnimationEnd"),ei(Tc,"onAnimationIteration"),ei(Bc,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(l_,"onTransitionRun"),ei(c_,"onTransitionStart"),ei(h_,"onTransitionCancel"),ei(Oc,"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(" "),X_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ir));function ed(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],d=s.event;s=s.listeners;e:{var p=void 0;if(t)for(var M=s.length-1;0<=M;M--){var z=s[M],X=z.instance,se=z.currentTarget;if(z=z.listener,X!==p&&d.isPropagationStopped())break e;p=z,d.currentTarget=se;try{p(d)}catch(oe){ln(oe)}d.currentTarget=null,p=X}else for(M=0;M<s.length;M++){if(z=s[M],X=z.instance,se=z.currentTarget,z=z.listener,X!==p&&d.isPropagationStopped())break e;p=z,d.currentTarget=se;try{p(d)}catch(oe){ln(oe)}d.currentTarget=null,p=X}}}}function He(e,t){var i=t[pa];i===void 0&&(i=t[pa]=new Set);var s=e+"__bubble";i.has(s)||(td(t,e,2,!1),i.add(s))}function al(e,t,i){var s=0;t&&(s|=4),td(i,e,s,t)}var Yn="_reactListening"+Math.random().toString(36).slice(2);function ol(e){if(!e[Yn]){e[Yn]=!0,Yl.forEach(function(i){i!=="selectionchange"&&(X_.has(i)||al(i,!1,e),al(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yn]||(t[Yn]=!0,al("selectionchange",!1,t))}}function td(e,t,i,s){switch(Dd(t)){case 2:var d=yv;break;case 8:d=bv;break;default:d=bl}i=d.bind(null,t,i,e),d=void 0,!Ea||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function ll(e,t,i,s,d){var p=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 z=s.stateNode.containerInfo;if(z===d)break;if(M===4)for(M=s.return;M!==null;){var X=M.tag;if((X===3||X===4)&&M.stateNode.containerInfo===d)return;M=M.return}for(;z!==null;){if(M=ps(z),M===null)return;if(X=M.tag,X===5||X===6||X===26||X===27){s=p=M;continue e}z=z.parentNode}}s=s.return}ac(function(){var se=p,oe=xa(i),de=[];e:{var re=kc.get(e);if(re!==void 0){var ae=nn,Ce=e;switch(e){case"keypress":if(sn(i)===0)break e;case"keydown":case"keyup":ae=Pf;break;case"focusin":Ce="focus",ae=Da;break;case"focusout":Ce="blur",ae=Da;break;case"beforeblur":case"afterblur":ae=Da;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=cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Af;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=$f;break;case Dc:case Tc:case Bc:ae=Tf;break;case Oc:ae=Wf;break;case"scroll":case"scrollend":ae=Ef;break;case"wheel":ae=Xf;break;case"copy":case"cut":case"paste":ae=Of;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=uc;break;case"toggle":case"beforetoggle":ae=Vf}var Ee=(t&4)!==0,Ve=!Ee&&(e==="scroll"||e==="scrollend"),Z=Ee?re!==null?re+"Capture":null:re;Ee=[];for(var K=se,ie;K!==null;){var he=K;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||Z===null||(he=or(K,Z),he!=null&&Ee.push(Pr(K,he,ie))),Ve)break;K=K.return}0<Ee.length&&(re=new ae(re,Ce,null,i,oe),de.push({event:re,listeners:Ee}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",re&&i!==wa&&(Ce=i.relatedTarget||i.fromElement)&&(ps(Ce)||Ce[gs]))break e;if((ae||re)&&(re=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,ae?(Ce=i.relatedTarget||i.toElement,ae=se,Ce=Ce?ps(Ce):null,Ce!==null&&(Ve=ne(Ce),Ee=Ce.tag,Ce!==Ve||Ee!==5&&Ee!==27&&Ee!==6)&&(Ce=null)):(ae=null,Ce=se),ae!==Ce)){if(Ee=cc,he="onMouseLeave",Z="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=uc,he="onPointerLeave",Z="onPointerEnter",K="pointer"),Ve=ae==null?re:ar(ae),ie=Ce==null?re:ar(Ce),re=new Ee(he,K+"leave",ae,i,oe),re.target=Ve,re.relatedTarget=ie,he=null,ps(oe)===se&&(Ee=new Ee(Z,K+"enter",Ce,i,oe),Ee.target=ie,Ee.relatedTarget=Ve,he=Ee),Ve=he,ae&&Ce)t:{for(Ee=Y_,Z=ae,K=Ce,ie=0,he=Z;he;he=Ee(he))ie++;he=0;for(var xe=K;xe;xe=Ee(xe))he++;for(;0<ie-he;)Z=Ee(Z),ie--;for(;0<he-ie;)K=Ee(K),he--;for(;ie--;){if(Z===K||K!==null&&Z===K.alternate){Ee=Z;break t}Z=Ee(Z),K=Ee(K)}Ee=null}else Ee=null;ae!==null&&id(de,re,ae,Ee,!1),Ce!==null&&Ve!==null&&id(de,Ve,Ce,Ee,!0)}}e:{if(re=se?ar(se):window,ae=re.nodeName&&re.nodeName.toLowerCase(),ae==="select"||ae==="input"&&re.type==="file")var Fe=Sc;else if(pc(re))if(Cc)Fe=n_;else{Fe=s_;var be=i_}else ae=re.nodeName,!ae||ae.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&ba(se.elementType)&&(Fe=Sc):Fe=r_;if(Fe&&(Fe=Fe(e,se))){mc(de,Fe,i,oe);break e}be&&be(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&ya(re,"number",re.value)}switch(be=se?ar(se):window,e){case"focusin":(pc(be)||be.contentEditable==="true")&&(Es=be,za=se,vr=null);break;case"focusout":vr=za=Es=null;break;case"mousedown":Na=!0;break;case"contextmenu":case"mouseup":case"dragend":Na=!1,Ac(de,i,oe);break;case"selectionchange":if(o_)break;case"keydown":case"keyup":Ac(de,i,oe)}var Be;if(Ba)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?vc(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(dc&&i.locale!=="ko"&&(Ls||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ls&&(Be=oc()):(Di=oe,Ma="value"in Di?Di.value:Di.textContent,Ls=!0)),be=Vn(se,Ue),0<be.length&&(Ue=new hc(Ue,e,null,i,oe),de.push({event:Ue,listeners:be}),Be?Ue.data=Be:(Be=gc(i),Be!==null&&(Ue.data=Be)))),(Be=Qf?Zf(e,i):Jf(e,i))&&(Ue=Vn(se,"onBeforeInput"),0<Ue.length&&(be=new hc("onBeforeInput","beforeinput",null,i,oe),de.push({event:be,listeners:Ue}),be.data=Be)),q_(de,e,se,i,oe)}ed(de,t)})}function Pr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Vn(e,t){for(var i=t+"Capture",s=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=or(e,i),d!=null&&s.unshift(Pr(e,d,p)),d=or(e,t),d!=null&&s.push(Pr(e,d,p))),e.tag===3)return s;e=e.return}return[]}function Y_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function id(e,t,i,s,d){for(var p=t._reactName,M=[];i!==null&&i!==s;){var z=i,X=z.alternate,se=z.stateNode;if(z=z.tag,X!==null&&X===s)break;z!==5&&z!==26&&z!==27||se===null||(X=se,d?(se=or(i,p),se!=null&&M.unshift(Pr(i,se,X))):d||(se=or(i,p),se!=null&&M.push(Pr(i,se,X)))),i=i.return}M.length!==0&&e.push({event:t,listeners:M})}var V_=/\r\n?/g,K_=/\u0000|\uFFFD/g;function sd(e){return(typeof e=="string"?e:""+e).replace(V_,`
49
+ `).replace(K_,"")}function rd(e,t){return t=sd(t),sd(e)===t}function Ye(e,t,i,s,d,p){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":rc(e,s,p);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 p=="function"&&(i==="formAction"?(t!=="input"&&Ye(e,t,"name",d.name,d,null),Ye(e,t,"formEncType",d.formEncType,d,null),Ye(e,t,"formMethod",d.formMethod,d,null),Ye(e,t,"formTarget",d.formTarget,d,null)):(Ye(e,t,"encType",d.encType,d,null),Ye(e,t,"method",d.method,d,null),Ye(e,t,"target",d.target,d,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=di);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(O(61));if(i=s.__html,i!=null){if(d.children!=null)throw Error(O(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":ui(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ui(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ui(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ui(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ui(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ui(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ui(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ui(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ui(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=xf.get(i)||i,Qr(e,i,s))}}function cl(e,t,i,s,d,p){switch(i){case"style":rc(e,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(O(61));if(i=s.__html,i!=null){if(d.children!=null)throw Error(O(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=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vl.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),t=i.slice(2,d?i.length-7:void 0),p=e[Et]||null,p=p!=null?p[i]:null,typeof p=="function"&&e.removeEventListener(t,p,d),typeof s=="function")){typeof p!="function"&&p!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,d);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,d=!1,p;for(p in i)if(i.hasOwnProperty(p)){var M=i[p];if(M!=null)switch(p){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,p,M,i,null)}}d&&Ye(e,t,"srcSet",i.srcSet,i,null),s&&Ye(e,t,"src",i.src,i,null);return;case"input":He("invalid",e);var z=p=M=d=null,X=null,se=null;for(s in i)if(i.hasOwnProperty(s)){var oe=i[s];if(oe!=null)switch(s){case"name":d=oe;break;case"type":M=oe;break;case"checked":X=oe;break;case"defaultChecked":se=oe;break;case"value":p=oe;break;case"defaultValue":z=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(O(137,t));break;default:Ye(e,t,s,oe,i,null)}}ec(e,p,z,X,se,M,d,!1);return;case"select":He("invalid",e),s=M=p=null;for(d in i)if(i.hasOwnProperty(d)&&(z=i[d],z!=null))switch(d){case"value":p=z;break;case"defaultValue":M=z;break;case"multiple":s=z;default:Ye(e,t,d,z,i,null)}t=p,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),p=d=s=null;for(M in i)if(i.hasOwnProperty(M)&&(z=i[M],z!=null))switch(M){case"value":s=z;break;case"defaultValue":d=z;break;case"children":p=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(O(91));break;default:Ye(e,t,M,z,i,null)}ic(e,s,d,p);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:Ye(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(se in i)if(i.hasOwnProperty(se)&&(s=i[se],s!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,se,s,i,null)}return;default:if(ba(t)){for(oe in i)i.hasOwnProperty(oe)&&(s=i[oe],s!==void 0&&cl(e,t,oe,s,i,void 0));return}}for(z in i)i.hasOwnProperty(z)&&(s=i[z],s!=null&&Ye(e,t,z,s,i,null))}function Q_(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 d=null,p=null,M=null,z=null,X=null,se=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":X=de;default:s.hasOwnProperty(ae)||Ye(e,t,ae,null,s,de)}}for(var re in s){var ae=s[re];if(de=i[re],s.hasOwnProperty(re)&&(ae!=null||de!=null))switch(re){case"type":p=ae;break;case"name":d=ae;break;case"checked":se=ae;break;case"defaultChecked":oe=ae;break;case"value":M=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(O(137,t));break;default:ae!==de&&Ye(e,t,re,ae,s,de)}}Ca(e,M,z,X,se,oe,p,d);return;case"select":ae=M=z=re=null;for(p in i)if(X=i[p],i.hasOwnProperty(p)&&X!=null)switch(p){case"value":break;case"multiple":ae=X;default:s.hasOwnProperty(p)||Ye(e,t,p,null,s,X)}for(d in s)if(p=s[d],X=i[d],s.hasOwnProperty(d)&&(p!=null||X!=null))switch(d){case"value":re=p;break;case"defaultValue":z=p;break;case"multiple":M=p;default:p!==X&&Ye(e,t,d,p,s,X)}t=z,i=M,s=ae,re!=null?ys(e,!!i,re,!1):!!s!=!!i&&(t!=null?ys(e,!!i,t,!0):ys(e,!!i,i?[]:"",!1));return;case"textarea":ae=re=null;for(z in i)if(d=i[z],i.hasOwnProperty(z)&&d!=null&&!s.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Ye(e,t,z,null,s,d)}for(M in s)if(d=s[M],p=i[M],s.hasOwnProperty(M)&&(d!=null||p!=null))switch(M){case"value":re=d;break;case"defaultValue":ae=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(O(91));break;default:d!==p&&Ye(e,t,M,d,s,p)}tc(e,re,ae);return;case"option":for(var Ce in i)if(re=i[Ce],i.hasOwnProperty(Ce)&&re!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ye(e,t,Ce,null,s,re)}for(X in s)if(re=s[X],ae=i[X],s.hasOwnProperty(X)&&re!==ae&&(re!=null||ae!=null))switch(X){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ye(e,t,X,re,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)re=i[Ee],i.hasOwnProperty(Ee)&&re!=null&&!s.hasOwnProperty(Ee)&&Ye(e,t,Ee,null,s,re);for(se in s)if(re=s[se],ae=i[se],s.hasOwnProperty(se)&&re!==ae&&(re!=null||ae!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(O(137,t));break;default:Ye(e,t,se,re,s,ae)}return;default:if(ba(t)){for(var Ve in i)re=i[Ve],i.hasOwnProperty(Ve)&&re!==void 0&&!s.hasOwnProperty(Ve)&&cl(e,t,Ve,void 0,s,re);for(oe in s)re=s[oe],ae=i[oe],!s.hasOwnProperty(oe)||re===ae||re===void 0&&ae===void 0||cl(e,t,oe,re,s,ae);return}}for(var Z in i)re=i[Z],i.hasOwnProperty(Z)&&re!=null&&!s.hasOwnProperty(Z)&&Ye(e,t,Z,null,s,re);for(de in s)re=s[de],ae=i[de],!s.hasOwnProperty(de)||re===ae||re==null&&ae==null||Ye(e,t,de,re,s,ae)}function nd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var d=i[s],p=d.transferSize,M=d.initiatorType,z=d.duration;if(p&&z&&nd(M)){for(M=0,z=d.responseEnd,s+=1;s<i.length;s++){var X=i[s],se=X.startTime;if(se>z)break;var oe=X.transferSize,de=X.initiatorType;oe&&nd(de)&&(X=X.responseEnd,M+=oe*(X<z?1:(z-se)/(X-se)))}if(--s,t+=8*(p+M)/(d.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 hl=null,ul=null;function Kn(e){return e.nodeType===9?e:e.ownerDocument}function ad(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 od(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 dl(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 fl=null;function J_(){var e=window.event;return e&&e.type==="popstate"?e===fl?!1:(fl=e,!0):(fl=null,!1)}var ld=typeof setTimeout=="function"?setTimeout:void 0,ev=typeof clearTimeout=="function"?clearTimeout:void 0,cd=typeof Promise=="function"?Promise:void 0,tv=typeof queueMicrotask=="function"?queueMicrotask:typeof cd<"u"?function(e){return cd.resolve(null).then(e).catch(iv)}:ld;function iv(e){setTimeout(function(){throw e})}function Xi(e){return e==="head"}function hd(e,t){var i=t,s=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(d),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Fr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Fr(i);for(var p=i.firstChild;p;){var M=p.nextSibling,z=p.nodeName;p[nr]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&p.rel.toLowerCase()==="stylesheet"||i.removeChild(p),p=M}}else i==="body"&&Fr(e.ownerDocument.body);i=d}while(i);Js(t)}function ud(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 _l(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":_l(i),ma(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function sv(e,t,i,s){for(;e.nodeType===1;){var d=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(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=Kt(e.nextSibling),e===null)break}return null}function rv(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 dd(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 vl(e){return e.data==="$?"||e.data==="$~"}function gl(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function nv(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 pl=null;function fd(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 _d(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 vd(e,t,i){switch(t=Kn(i),e){case"html":if(e=t.documentElement,!e)throw Error(O(452));return e;case"head":if(e=t.head,!e)throw Error(O(453));return e;case"body":if(e=t.body,!e)throw Error(O(454));return e;default:throw Error(O(451))}}function Fr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ma(e)}var Qt=new Map,gd=new Set;function Qn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ai=P.d;P.d={f:av,r:ov,D:lv,C:cv,L:hv,m:uv,X:fv,S:dv,M:_v};function av(){var e=Ai.f(),t=jn();return e||t}function ov(e){var t=ms(e);t!==null&&t.tag===5&&t.type==="form"?Oh(t):Ai.r(e)}var Ks=typeof document>"u"?null:document;function pd(e,t,i){var s=Ks;if(s&&typeof t=="string"&&t){var d=$t(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),gd.has(d)||(gd.add(d),e={rel:e,crossOrigin:i,href:t},s.querySelector(d)===null&&(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function lv(e){Ai.D(e),pd("dns-prefetch",e,null)}function cv(e,t){Ai.C(e,t),pd("preconnect",e,t)}function hv(e,t,i){Ai.L(e,t,i);var s=Ks;if(s&&e&&t){var d='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+$t(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+$t(i.imageSizes)+'"]')):d+='[href="'+$t(e)+'"]';var p=d;switch(t){case"style":p=Qs(e);break;case"script":p=Zs(e)}Qt.has(p)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qt.set(p,e),s.querySelector(d)!==null||t==="style"&&s.querySelector(jr(p))||t==="script"&&s.querySelector($r(p))||(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function uv(e,t){Ai.m(e,t);var i=Ks;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+$t(s)+'"][href="'+$t(e)+'"]',p=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Zs(e)}if(!Qt.has(p)&&(e=a({rel:"modulepreload",href:e},t),Qt.set(p,e),i.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector($r(p)))return}s=i.createElement("link"),bt(s,"link",e),gt(s),i.head.appendChild(s)}}}function dv(e,t,i){Ai.S(e,t,i);var s=Ks;if(s&&e){var d=Ss(s).hoistableStyles,p=Qs(e);t=t||"default";var M=d.get(p);if(!M){var z={loading:0,preload:null};if(M=s.querySelector(jr(p)))z.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qt.get(p))&&ml(e,i);var X=M=s.createElement("link");gt(X),bt(X,"link",e),X._p=new Promise(function(se,oe){X.onload=se,X.onerror=oe}),X.addEventListener("load",function(){z.loading|=1}),X.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Zn(M,t,s)}M={type:"stylesheet",instance:M,count:1,state:z},d.set(p,M)}}}function fv(e,t){Ai.X(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,d=Zs(e),p=s.get(d);p||(p=i.querySelector($r(d)),p||(e=a({src:e,async:!0},t),(t=Qt.get(d))&&Sl(e,t),p=i.createElement("script"),gt(p),bt(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function _v(e,t){Ai.M(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,d=Zs(e),p=s.get(d);p||(p=i.querySelector($r(d)),p||(e=a({src:e,async:!0,type:"module"},t),(t=Qt.get(d))&&Sl(e,t),p=i.createElement("script"),gt(p),bt(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function md(e,t,i,s){var d=(d=ce.current)?Qn(d):null;if(!d)throw Error(O(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(d).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 p=Ss(d).hoistableStyles,M=p.get(e);if(M||(d=d.ownerDocument||d,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,M),(p=d.querySelector(jr(e)))&&!p._p&&(M.instance=p,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),p||vv(d,e,i,M.state))),t&&s===null)throw Error(O(528,""));return M}if(t&&s!==null)throw Error(O(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zs(i),i=Ss(d).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(O(444,e))}}function Qs(e){return'href="'+$t(e)+'"'}function jr(e){return'link[rel="stylesheet"]['+e+"]"}function Sd(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function vv(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 Cd(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 d=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",d),Zn(s,i.precedence,e),t.instance=s;case"stylesheet":d=Qs(i.href);var p=e.querySelector(jr(d));if(p)return t.state.loading|=4,t.instance=p,gt(p),p;s=Sd(i),(d=Qt.get(d))&&ml(s,d),p=(e.ownerDocument||e).createElement("link"),gt(p);var M=p;return M._p=new Promise(function(z,X){M.onload=z,M.onerror=X}),bt(p,"link",s),t.state.loading|=4,Zn(p,i.precedence,e),t.instance=p;case"script":return p=Zs(i.src),(d=e.querySelector($r(p)))?(t.instance=d,gt(d),d):(s=i,(d=Qt.get(p))&&(s=a({},i),Sl(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),gt(d),bt(d,"link",s),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(O(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]'),d=s.length?s[s.length-1]:null,p=d,M=0;M<s.length;M++){var z=s[M];if(z.dataset.precedence===t)p=z;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function ml(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sl(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 yd(e,t,i){if(Jn===null){var s=new Map,d=Jn=new Map;d.set(i,s)}else d=Jn,s=d.get(i),s||(s=new Map,d.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),d=0;d<i.length;d++){var p=i[d];if(!(p[nr]||p[mt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var M=p.getAttribute(t)||"";M=e+M;var z=s.get(M);z?z.push(p):s.set(M,[p])}}return s}function bd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function gv(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 wd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pv(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 d=Qs(s.href),p=t.querySelector(jr(d));if(p){t=p._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=p,gt(p);return}p=t.ownerDocument||t,s=Sd(s),(d=Qt.get(d))&&ml(s,d),p=p.createElement("link"),gt(p);var M=p;M._p=new Promise(function(z,X){M.onload=z,M.onerror=X}),bt(p,"link",s),i.instance=p}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 Cl=0;function mv(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 p=e.unsuspend;e.unsuspend=null,p()}},6e4+t);0<e.imgBytes&&Cl===0&&(Cl=62500*Z_());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Cl?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}: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(Sv,e),ta=null,ea.call(e))}function Sv(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 d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var M=d[p];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(i.set(M.dataset.precedence,M),s=M)}s&&i.set(null,s)}d=t.instance,M=d.getAttribute("data-precedence"),p=i.get(M)||s,p===s&&i.set(null,d),i.set(M,d),this.count++,s=ea.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var qr={$$typeof:o,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function Cv(e,t,i,s,d,p,M,z,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=_a(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_a(0),this.hiddenUpdates=_a(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function xd(e,t,i,s,d,p,M,z,X,se,oe,de){return e=new Cv(e,t,i,M,X,se,oe,de,z),t=1,p===!0&&(t|=24),p=Ht(3,null,null,t),e.current=p,p.stateNode=e,t=Za(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:s,isDehydrated:i,cache:t},io(p),e}function Ld(e){return e?(e=Rs,e):Rs}function Ed(e,t,i,s,d,p){d=Ld(d),s.context===null?s.context=d:s.pendingContext=d,s=zi(t),s.payload={element:i},p=p===void 0?null:p,p!==null&&(s.callback=p),i=Ni(e,s,t),i!==null&&(Bt(i,e,t),br(i,e,t))}function Md(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function yl(e,t){Md(e,t),(e=e.alternate)&&Md(e,t)}function Ad(e){if(e.tag===13||e.tag===31){var t=ss(e,67108864);t!==null&&Bt(t,e,67108864),yl(e,67108864)}}function Rd(e){if(e.tag===13||e.tag===31){var t=Pt();t=va(t);var i=ss(e,t);i!==null&&Bt(i,e,t),yl(e,t)}}var sa=!0;function yv(e,t,i,s){var d=U.T;U.T=null;var p=P.p;try{P.p=2,bl(e,t,i,s)}finally{P.p=p,U.T=d}}function bv(e,t,i,s){var d=U.T;U.T=null;var p=P.p;try{P.p=8,bl(e,t,i,s)}finally{P.p=p,U.T=d}}function bl(e,t,i,s){if(sa){var d=wl(s);if(d===null)ll(e,t,s,ra,i),Td(e,s);else if(xv(d,e,t,i,s))s.stopPropagation();else if(Td(e,s),t&4&&-1<wv.indexOf(e)){for(;d!==null;){var p=ms(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var M=Jt(p.pendingLanes);if(M!==0){var z=p;for(z.pendingLanes|=2,z.entangledLanes|=2;M;){var X=1<<31-ut(M);z.entanglements[1]|=X,M&=~X}ci(p),($e&6)===0&&(Pn=ge()+500,Ur(0))}}break;case 31:case 13:z=ss(p,2),z!==null&&Bt(z,p,2),jn(),yl(p,2)}if(p=wl(s),p===null&&ll(e,t,s,ra,i),p===d)break;d=p}d!==null&&s.stopPropagation()}else ll(e,t,s,null,i)}}function wl(e){return e=xa(e),xl(e)}var ra=null;function xl(e){if(ra=null,e=ps(e),e!==null){var t=ne(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=j(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 Dd(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 Ll=!1,Yi=null,Vi=null,Ki=null,Wr=new Map,Gr=new Map,Qi=[],wv="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 Td(e,t){switch(e){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":Ki=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,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:p,targetContainers:[d]},t!==null&&(t=ms(t),t!==null&&Ad(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function xv(e,t,i,s,d){switch(t){case"focusin":return Yi=Xr(Yi,e,t,i,s,d),!0;case"dragenter":return Vi=Xr(Vi,e,t,i,s,d),!0;case"mouseover":return Ki=Xr(Ki,e,t,i,s,d),!0;case"pointerover":var p=d.pointerId;return Wr.set(p,Xr(Wr.get(p)||null,e,t,i,s,d)),!0;case"gotpointercapture":return p=d.pointerId,Gr.set(p,Xr(Gr.get(p)||null,e,t,i,s,d)),!0}return!1}function Bd(e){var t=ps(e.target);if(t!==null){var i=ne(t);if(i!==null){if(t=i.tag,t===13){if(t=j(i),t!==null){e.blockedOn=t,Gl(e.priority,function(){Rd(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,Gl(e.priority,function(){Rd(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=wl(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wa=s,i.target.dispatchEvent(s),wa=null}else return t=ms(i),t!==null&&Ad(t),e.blockedOn=i,!1;t.shift()}return!0}function Od(e,t,i){na(e)&&i.delete(t)}function Lv(){Ll=!1,Yi!==null&&na(Yi)&&(Yi=null),Vi!==null&&na(Vi)&&(Vi=null),Ki!==null&&na(Ki)&&(Ki=null),Wr.forEach(Od),Gr.forEach(Od)}function aa(e,t){e.blockedOn===t&&(e.blockedOn=null,Ll||(Ll=!0,I.unstable_scheduleCallback(I.unstable_NormalPriority,Lv)))}var oa=null;function kd(e){oa!==e&&(oa=e,I.unstable_scheduleCallback(I.unstable_NormalPriority,function(){oa===e&&(oa=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],d=e[t+2];if(typeof s!="function"){if(xl(s||i)===null)continue;break}var p=ms(i);p!==null&&(e.splice(t,3),t-=3,wo(p,{pending:!0,data:d,method:i.method,action:s},s,d))}}))}function Js(e){function t(X){return aa(X,e)}Yi!==null&&aa(Yi,e),Vi!==null&&aa(Vi,e),Ki!==null&&aa(Ki,e),Wr.forEach(t),Gr.forEach(t);for(var i=0;i<Qi.length;i++){var s=Qi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Qi.length&&(i=Qi[0],i.blockedOn===null);)Bd(i),i.blockedOn===null&&Qi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var d=i[s],p=i[s+1],M=d[Et]||null;if(typeof p=="function")M||kd(i);else if(M){var z=null;if(p&&p.hasAttribute("formAction")){if(d=p,M=p[Et]||null)z=M.formAction;else if(xl(d)!==null)continue}else z=M.action;typeof z=="function"?i[s+1]=z:(i.splice(s,3),s-=3),kd(i)}}}function Hd(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(M){return d=M})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=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),d!==null&&(d(),d=null)}}}function El(e){this._internalRoot=e}la.prototype.render=El.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));var i=t.current,s=Pt();Ed(i,s,e,t,null,null)},la.prototype.unmount=El.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ed(e.current,2,null,e,null,null),jn(),t[gs]=null}};function la(e){this._internalRoot=e}la.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wl();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Qi.length&&t!==0&&t<Qi[i].priority;i++);Qi.splice(i,0,e),i===0&&Bd(e)}};var zd=W.version;if(zd!=="19.2.4")throw Error(O(527,zd,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=f(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var Ev={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(Ev),tt=ca}catch{}}return Vr.createRoot=function(e,t){if(!te(e))throw Error(O(299));var i=!1,s="",d=$h,p=qh,M=Wh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(M=t.onRecoverableError)),t=xd(e,1,!1,null,null,i,s,null,d,p,M,Hd),e[gs]=t.current,ol(e),new El(t)},Vr.hydrateRoot=function(e,t,i){if(!te(e))throw Error(O(299));var s=!1,d="",p=$h,M=qh,z=Wh,X=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(M=i.onCaughtError),i.onRecoverableError!==void 0&&(z=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=xd(e,1,!0,t,i??null,s,d,X,p,M,z,Hd),t.context=Ld(null),i=t.current,s=Pt(),s=va(s),d=zi(s),d.callback=null,Ni(i,d,s),i=s,t.current.lanes=i,rr(t,i),ci(t),e[gs]=t.current,ol(e),new la(t)},Vr.version="19.2.4",Vr}var Gd;function Uv(){if(Gd)return Rl.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(W){console.error(W)}}return I(),Rl.exports=Nv(),Rl.exports}var Iv=Uv();const ef=768,Pv=1e3;function tf(){return"./"}function si(I){const W=tf(),$=I.startsWith("/")?I.slice(1):I;return W+$}function hi(){const I=localStorage.getItem("codev-web-key");return I?{Authorization:`Bearer ${I}`}:{}}async function Fv(){const I=await fetch(si("api/state"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch state: ${I.status}`);return I.json()}async function jv(){const I=await fetch(si("api/overview"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch overview: ${I.status}`);return I.json()}function $v(){return si("api/events")}async function qv(){await fetch(si("api/overview/refresh"),{method:"POST",headers:hi()})}async function Wv(){const I=await fetch(si("api/tabs/shell"),{method:"POST",headers:{"Content-Type":"application/json",...hi()}});if(!I.ok)throw new Error(await I.text());return I.json()}async function Pl(I,W,$){const O=await fetch(si("api/tabs/file"),{method:"POST",headers:{"Content-Type":"application/json",...hi()},body:JSON.stringify({path:I,line:W,terminalId:$})});if(!O.ok)throw new Error(await O.text());return O.json()}async function Gv(I){const W=await fetch(si(`api/tabs/${I}`),{method:"DELETE",headers:hi()});if(!W.ok)throw new Error(await W.text())}async function Xv(){const I=await fetch(si("api/files"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch files: ${I.status}`);return I.json()}async function sf(I){const W=await fetch(si("api/paste-image"),{method:"POST",headers:{"Content-Type":I.type||"image/png",...hi()},body:I});if(!W.ok)throw new Error(`Image upload failed: ${W.status}`);return W.json()}function Xd(I){if(I.terminalId){const W=window.location.pathname;return`${W.endsWith("/")?W:W+"/"}ws/terminal/${I.terminalId}`}return null}async function Yv(){const I=await fetch(si("api/git/status"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch git status: ${I.status}`);return I.json()}async function Vv(){const I=await fetch(si("api/files/recent"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch recent files: ${I.status}`);return I.json()}function Kv(){const[I,W]=ye.useState(null),[$,O]=ye.useState(null),te=ye.useCallback(async()=>{try{const ne=await Fv();W(ne),O(null)}catch(ne){O(ne.message)}},[]);return ye.useEffect(()=>{te();const ne=setInterval(te,Pv);return()=>clearInterval(ne)},[te]),{state:I,error:$,refresh:te}}function Qv(I){const W=[{id:"work",type:"work",label:"Work",closable:!1}];I!=null&&I.architect&&W.push({id:"architect",type:"architect",label:"Architect",closable:!1,terminalId:I.architect.terminalId,persistent:I.architect.persistent});for(const $ of(I==null?void 0:I.builders)??[])W.push({id:$.id,type:"builder",label:$.name||$.id,closable:!0,projectId:$.id,terminalId:$.terminalId,persistent:$.persistent});for(const $ of(I==null?void 0:I.utils)??[])!$.terminalId&&(!$.pid||$.pid===0)||W.push({id:$.id,type:"shell",label:$.name||`Shell ${$.id}`,closable:!0,utilId:$.id,terminalId:$.terminalId,persistent:$.persistent});for(const $ of(I==null?void 0:I.annotations)??[]){const O=$.file.split("/").pop()??$.file;W.push({id:$.id,type:"file",label:O,closable:!0,annotationId:$.id,filePath:$.file})}return W}function Zv(I){const[W,$]=ye.useState("work"),O=ye.useRef(null),te=ye.useRef(!1),ne=Qv(I);ye.useEffect(()=>{if(te.current||I===null)return;const f=new URLSearchParams(window.location.search).get("tab");if(f){const _=ne.find(a=>a.id===f||a.type===f);if(_){$(_.id),te.current=!0;const a=new URL(window.location.href);a.searchParams.delete("tab"),window.history.replaceState({},"",a.toString())}}else te.current=!0},[ne,I]),ye.useEffect(()=>{const u=new Set(ne.map(f=>f.id));if(O.current===null){I!==null&&(O.current=u);return}for(const f of ne)!O.current.has(f.id)&&f.type!=="architect"&&$(f.id);O.current=u},[ne.map(u=>u.id).join(","),I!==null]);const j=ye.useCallback(u=>{$(u)},[]),n=ne.find(u=>u.id===W)??ne[0];return{tabs:ne,activeTab:n,activeTabId:W,selectTab:j}}function rf(I){const[W,$]=ye.useState(()=>typeof window<"u"?window.matchMedia(I).matches:!1);return ye.useEffect(()=>{const O=window.matchMedia(I),te=ne=>$(ne.matches);return O.addEventListener("change",te),$(O.matches),()=>O.removeEventListener("change",te)},[I]),W}function Jv({left:I,right:W,defaultSplit:$=50}){const[O,te]=ye.useState($),ne=ye.useRef(null),j=ye.useRef(!1),n=ye.useCallback(u=>{u.preventDefault(),j.current=!0;const f=a=>{if(!j.current||!ne.current)return;const g=ne.current.getBoundingClientRect(),y=(a.clientX-g.left)/g.width*100;te(Math.max(20,Math.min(80,y)))},_=()=>{j.current=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",_)},[]);return Q.jsxs("div",{ref:ne,className:"split-pane",children:[Q.jsx("div",{className:"split-left",style:{width:`${O}%`},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-O}%`},children:W})]})}function nf({tabs:I,activeTabId:W,onSelectTab:$,onRefresh:O}){const te=async(ne,j)=>{ne.stopPropagation();try{await Gv(j.id),O()}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(ne=>Q.jsxs("button",{role:"tab","aria-selected":ne.id===W,className:`tab ${ne.id===W?"tab-active":""}`,onClick:()=>$(ne.id),title:ne.label,children:[Q.jsx("span",{className:"tab-label",children:ne.label}),ne.closable&&Q.jsx("span",{className:"tab-close",onClick:j=>te(j,ne),role:"button","aria-label":`Close ${ne.label}`,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),te(j,ne))},children:"×"})]},ne.id))})}var Ol={exports:{}},Yd;function eg(){return Yd||(Yd=1,(function(I,W){(function($,O){I.exports=O()})(globalThis,(()=>(()=>{var $={4567:function(j,n,u){var f=this&&this.__decorate||function(l,o,m,x){var v,w=arguments.length,S=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,o,m,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(S=(w<3?v(S):w>3?v(o,m,S):v(o,m))||S);return w>3&&S&&Object.defineProperty(o,m,S),S},_=this&&this.__param||function(l,o){return function(m,x){o(m,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const a=u(9042),g=u(9924),y=u(844),b=u(4725),c=u(2585),r=u(3656);let h=n.AccessibilityManager=class extends y.Disposable{constructor(l,o,m,x){super(),this._terminal=l,this._coreBrowserService=m,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 g.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
+ `)))),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,y.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let o=0;o<l;o++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
51
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,o){this._liveRegionDebouncer.refresh(l,o,this._terminal.rows)}_renderRows(l,o){const m=this._terminal.buffer,x=m.lines.length.toString();for(let v=l;v<=o;v++){const w=m.lines.get(m.ydisp+v),S=[],C=(w==null?void 0:w.translateToString(!0,void 0,void 0,S))||"",L=(m.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,S)),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(l,o){const m=l.target,x=this._rowElements[o===0?1:this._rowElements.length-2];if(m.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==x)return;let v,w;if(o===0?(v=m,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(v=this._rowElements.shift(),w=m,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var C;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:l.anchorNode,offset:l.anchorOffset},m={node:l.focusNode,offset:l.focusOffset};if((o.node.compareDocumentPosition(m.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===m.node&&o.offset>m.offset)&&([o,m]=[m,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const x=this._rowElements.slice(-1)[0];if(m.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(m={node:x,offset:((C=x.textContent)==null?void 0:C.length)??0}),!this._rowContainer.contains(m.node))return;const v=({node:L,offset:A})=>{const E=L instanceof Text?L.parentNode:L;let T=parseInt(E==null?void 0:E.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(E);if(!H)return console.warn("columns is null. Race condition?"),null;let G=A<H.length?H[A]:H.slice(-1)[0]+1;return G>=this._terminal.cols&&(++T,G=0),{row:T,column:G}},w=v(o),S=v(m);if(w&&S){if(w.row>S.row||w.row===S.row&&w.column>=S.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(S.row-w.row)*this._terminal.cols-w.column+S.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=h=f([_(1,c.IInstantiationService),_(2,b.ICoreBrowserService),_(3,b.IRenderService)],h)},3614:(j,n)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function f(g,y){return y?"\x1B[200~"+g+"\x1B[201~":g}function _(g,y,b,c){g=f(g=u(g),b.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(g,!0),y.value=""}function a(g,y,b){const c=b.getBoundingClientRect(),r=g.clientX-c.left-10,h=g.clientY-c.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${r}px`,y.style.top=`${h}px`,y.style.zIndex="1000",y.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=f,n.copyHandler=function(g,y){g.clipboardData&&g.clipboardData.setData("text/plain",y.selectionText),g.preventDefault()},n.handlePasteEvent=function(g,y,b,c){g.stopPropagation(),g.clipboardData&&_(g.clipboardData.getData("text/plain"),y,b,c)},n.paste=_,n.moveTextAreaUnderMouseCursor=a,n.rightClickHandler=function(g,y,b,c,r){a(g,y,b),r&&c.rightClickSelect(g),y.value=c.selectionText,y.select()}},7239:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const f=u(1505);n.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(_,a,g){this._css.set(_,a,g)}getCss(_,a){return this._css.get(_,a)}setColor(_,a,g){this._color.set(_,a,g)}getColor(_,a){return this._color.get(_,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,f,_,a){u.addEventListener(f,_,a);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(f,_,a))}}}},3551:function(j,n,u){var f=this&&this.__decorate||function(h,l,o,m){var x,v=arguments.length,w=v<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,o):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,m);else for(var S=h.length-1;S>=0;S--)(x=h[S])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,m){l(o,m,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const a=u(3656),g=u(8460),y=u(844),b=u(2585),c=u(4725);let r=n.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(h,l,o,m,x){super(),this._element=h,this._mouseService=l,this._renderService=o,this._bufferService=m,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.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 l=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=h.composedPath();for(let m=0;m<o.length;m++){const x=o[m];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_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,l){var m,x;this._activeProviderReplies&&l||((m=this._activeProviderReplies)==null||m.forEach((v=>{v==null||v.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let o=!1;for(const[v,w]of this._linkProviderService.linkProviders.entries())l?(x=this._activeProviderReplies)!=null&&x.get(v)&&(o=this._checkLinkProviderResult(v,h,o)):w.provideLinks(h.y,(S=>{var L,A;if(this._isMouseOut)return;const C=S==null?void 0:S.map((E=>({link:E})));(L=this._activeProviderReplies)==null||L.set(v,C),o=this._checkLinkProviderResult(v,h,o),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,l){const o=new Set;for(let m=0;m<l.size;m++){const x=l.get(m);if(x)for(let v=0;v<x.length;v++){const w=x[v],S=w.link.range.start.y<h?0:w.link.range.start.x,C=w.link.range.end.y>h?this._bufferService.cols:w.link.range.end.x;for(let L=S;L<=C;L++){if(o.has(L)){x.splice(v--,1);break}o.add(L)}}}}_checkLinkProviderResult(h,l,o){var v;if(!this._activeProviderReplies)return o;const m=this._activeProviderReplies.get(h);let x=!1;for(let w=0;w<h;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(x=!0);if(!x&&m){const w=m.find((S=>this._linkAtPosition(S.link,l)));w&&(o=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let w=0;w<this._activeProviderReplies.size;w++){const S=(v=this._activeProviderReplies.get(w))==null?void 0:v.find((C=>this._linkAtPosition(C.link,l)));if(S){o=!0,this._handleNewLink(S);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,l){this._currentLink&&this._lastMouseEvent&&(!h||!l||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(h.link,l)&&(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 o,m;return(m=(o=this._currentLink)==null?void 0:o.state)==null?void 0:m.decorations.pointerCursor},set:o=>{var m;(m=this._currentLink)!=null&&m.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>{var o,m;return(m=(o=this._currentLink)==null?void 0:o.state)==null?void 0:m.decorations.underline},set:o=>{var m,x,v;(m=this._currentLink)!=null&&m.state&&((v=(x=this._currentLink)==null?void 0:x.state)==null?void 0:v.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((o=>{if(!this._currentLink)return;const m=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(m,x),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}}))))}_linkHover(h,l,o){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(o,l.text)}_fireUnderlineEvent(h,l){const o=h.range,m=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-m-1,o.end.x,o.end.y-m-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(h,l,o){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(o,l.text)}_linkAtPosition(h,l){const o=h.range.start.y*this._bufferService.cols+h.range.start.x,m=h.range.end.y*this._bufferService.cols+h.range.end.x,x=l.y*this._bufferService.cols+l.x;return o<=x&&x<=m}_positionFromMouseEvent(h,l,o){const m=o.getCoords(h,l,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,l,o,m,x){return{x1:h,y1:l,x2:o,y2:m,cols:this._bufferService.cols,fg:x}}};n.Linkifier=r=f([_(1,c.IMouseService),_(2,c.IRenderService),_(3,b.IBufferService),_(4,c.ILinkProviderService)],r)},9042:(j,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(j,n,u){var f=this&&this.__decorate||function(c,r,h,l){var o,m=arguments.length,x=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(m<3?o(x):m>3?o(r,h,x):o(r,h))||x);return m>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const a=u(511),g=u(2585);let y=n.OscLinkProvider=class{constructor(c,r,h){this._bufferService=c,this._optionsService=r,this._oscLinkService=h}provideLinks(c,r){var C;const h=this._bufferService.buffer.lines.get(c-1);if(!h)return void r(void 0);const l=[],o=this._optionsService.rawOptions.linkHandler,m=new a.CellData,x=h.getTrimmedLength();let v=-1,w=-1,S=!1;for(let L=0;L<x;L++)if(w!==-1||h.hasContent(L)){if(h.loadCell(L,m),m.hasExtendedAttrs()&&m.extended.urlId){if(w===-1){w=L,v=m.extended.urlId;continue}S=m.extended.urlId!==v}else w!==-1&&(S=!0);if(S||w!==-1&&L===x-1){const A=(C=this._oscLinkService.getLinkData(v))==null?void 0:C.uri;if(A){const E={start:{x:w+1,y:c},end:{x:L+(S||L!==x-1?0:1),y:c}};let T=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const H=new URL(A);["http:","https:"].includes(H.protocol)||(T=!0)}catch{T=!0}T||l.push({text:A,range:E,activate:(H,G)=>o?o.activate(H,G,E):b(0,G),hover:(H,G)=>{var U;return(U=o==null?void 0:o.hover)==null?void 0:U.call(o,H,G,E)},leave:(H,G)=>{var U;return(U=o==null?void 0:o.leave)==null?void 0:U.call(o,H,G,E)}})}S=!1,m.hasExtendedAttrs()&&m.extended.urlId?(w=L,v=m.extended.urlId):(w=-1,v=-1)}}r(l)}};function b(c,r){if(confirm(`Do you want to navigate to ${r}?
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=y=f([_(0,g.IBufferService),_(1,g.IOptionsService),_(2,g.IOscLinkService)],y)},6193:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,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,f,_){this._rowCount=_,u=u!==void 0?u:0,f=f!==void 0?f: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,f):f,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),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const f=u(3614),_=u(3656),a=u(3551),g=u(9042),y=u(3730),b=u(1680),c=u(3107),r=u(5744),h=u(2950),l=u(1296),o=u(428),m=u(4269),x=u(5114),v=u(8934),w=u(3230),S=u(9312),C=u(4725),L=u(6731),A=u(8055),E=u(8969),T=u(8460),H=u(844),G=u(6114),U=u(8437),P=u(2584),F=u(7399),R=u(5941),B=u(9074),D=u(2585),k=u(5435),Y=u(4567),V=u(779);class le 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=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,J)=>this.refresh(N,J)))),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,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,H.toDisposable)((()=>{var N,J;this._customKeyEventHandler=void 0,(J=(N=this.element)==null?void 0:N.parentNode)==null||J.removeChild(this.element)})))}_handleColorEvent(q){if(this._themeService)for(const N of q){let J,ee="";switch(N.index){case 256:J="foreground",ee="10";break;case 257:J="background",ee="11";break;case 258:J="cursor",ee="12";break;default:J="ansi",ee="4;"+N.index}switch(N.type){case 0:const _e=A.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${P.C0.ESC}]${ee};${(0,R.toRgbString)(_e)}${P.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((fe=>fe.ansi[N.index]=A.channels.toColor(...N.color)));else{const fe=J;this._themeService.modifyColors((Me=>Me[fe]=A.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(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.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(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 q=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(q);if(!N)return;const J=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,_e=N.getWidth(J),fe=this._renderService.dimensions.css.cell.width*_e,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,ve=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ve+"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",(N=>{this.hasSelection()&&(0,f.copyHandler)(N,this._selectionService)})));const q=N=>(0,f.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",q)),this.register((0,_.addDisposableDomListener)(this.element,"paste",q)),G.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,f.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,f.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,f.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 J;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"),((J=this.element)==null?void 0:J.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",(ee=>this.updateCursorStyle(ee)))),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",g.promptLabel),G.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",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.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(m.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.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(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((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(S.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(c.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(Y.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(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const q=this,N=this.element;function J(fe){const Me=q._mouseService.getMouseReportCoords(fe,q.screenElement);if(!Me)return!1;let ve,Oe;switch(fe.overrideType||fe.type){case"mousemove":Oe=32,fe.buttons===void 0?(ve=3,fe.button!==void 0&&(ve=fe.button<3?fe.button:3)):ve=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Oe=0,ve=fe.button<3?fe.button:3;break;case"mousedown":Oe=1,ve=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,ve=4;break;default:return!1}return!(Oe===void 0||ve===void 0||ve>4)&&q.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:ve,action:Oe,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(J(fe),fe.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(fe)),wheel:fe=>(J(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&J(fe)},mousemove:fe=>{fe.buttons||J(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||(N.addEventListener("mousemove",_e.mousemove),ee.mousemove=_e.mousemove):(N.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&fe?ee.wheel||(N.addEventListener("wheel",_e.wheel,{passive:!1}),ee.wheel=_e.wheel):(N.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&fe?ee.mouseup||(ee.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&fe?ee.mousedrag||(ee.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.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 J(fe),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(fe)}))),this.register((0,_.addDisposableDomListener)(N,"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 ve=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+=ve;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 J;(J=this._renderService)==null||J.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,J=0){var ee;J===1?(super.scrollLines(q,N,J),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(q)}paste(q){(0,f.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,J){this._selectionService.setSelection(q,N,J)}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 J;(J=this._selectionService)==null||J.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 J=(0,F.evaluateKeyboardEvent)(q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(q),J.type===3||J.type===2){const ee=this.rows-1;return this.scrollLines(J.type===2?-ee:ee),this.cancel(q,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,q)||(J.cancel&&this.cancel(q,!0),!J.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):(J.key!==P.C0.ETX&&J.key!==P.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||q.altKey||q.ctrlKey?this.cancel(q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(q,N){const J=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"?J:J&&(!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 J,ee;(J=this._charSizeService)==null||J.measure(),(ee=this.viewport)==null||ee.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,J;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(),(J=this.viewport)==null||J.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(P.C0.ESC+"[I"):this.coreService.triggerDataEvent(P.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),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[4;${J};${N}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[6;${_e};${ee}t`)}}cancel(q,N){if(this.options.cancelEvents||N)return q.preventDefault(),q.stopPropagation(),!1}}n.Terminal=le},9924:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,_){this._rowCount=_,u=u!==void 0?u:0,f=f!==void 0?f: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,f):f;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=a-this._lastRefreshMs,y=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(j,n,u){var f=this&&this.__decorate||function(h,l,o,m){var x,v=arguments.length,w=v<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,o):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,m);else for(var S=h.length-1;S>=0;S--)(x=h[S])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,m){l(o,m,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const a=u(3656),g=u(4725),y=u(8460),b=u(844),c=u(2585);let r=n.Viewport=class extends b.Disposable{constructor(h,l,o,m,x,v,w,S){super(),this._viewportElement=h,this._scrollArea=l,this._bufferService=o,this._optionsService=m,this._charSizeService=x,this._renderService=v,this._coreBrowserService=w,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 y.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(S.colors),this.register(S.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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,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,l){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&o<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const l=this._getPixelsScrolled(h);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,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 l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(h,l){var S;let o,m="";const x=[],v=l??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let C=h;C<v;C++){const L=w.get(C);if(!L)continue;const A=(S=w.get(C+1))==null?void 0:S.isWrapped;if(m+=L.translateToString(!A),!A||C===w.length-1){const E=document.createElement("div");E.textContent=m,x.push(E),m.length>0&&(o=E),m=""}}return{bufferElements:x,cursorElement:o}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(h,l){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&l.altKey||o==="ctrl"&&l.ctrlKey||o==="shift"&&l.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 l=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}};n.Viewport=r=f([_(2,c.IBufferService),_(3,c.IOptionsService),_(4,g.ICharSizeService),_(5,g.IRenderService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],r)},3107:function(j,n,u){var f=this&&this.__decorate||function(c,r,h,l){var o,m=arguments.length,x=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(m<3?o(x):m>3?o(r,h,x):o(r,h))||x);return m>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const a=u(4725),g=u(844),y=u(2585);let b=n.BufferDecorationRenderer=class extends g.Disposable{constructor(c,r,h,l,o){super(),this._screenElement=c,this._bufferService=r,this._coreBrowserService=h,this._decorationService=l,this._renderService=o,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((m=>this._removeDecoration(m)))),this.register((0,g.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 c of this._decorationService.decorations)this._renderDecoration(c);this._dimensionsChanged=!1}_renderDecoration(c){this._refreshStyle(c),this._dimensionsChanged&&this._refreshXPosition(c)}_createElement(c){var l;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((l=c==null?void 0:c.options)==null?void 0:l.layer)==="top"),r.style.width=`${Math.round((c.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(c.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(c.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=c.options.x??0;return h&&h>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(c,r),r}_refreshStyle(c){const r=c.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)c.element&&(c.element.style.display="none",c.onRenderEmitter.fire(c.element));else{let h=this._decorationElements.get(c);h||(h=this._createElement(c),c.element=h,this._decorationElements.set(c,h),this._container.appendChild(h),c.onDispose((()=>{this._decorationElements.delete(c),h.remove()}))),h.style.top=r*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",c.onRenderEmitter.fire(h)}}_refreshXPosition(c,r=c.element){if(!r)return;const h=c.options.x??0;(c.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(c){var r;(r=this._decorationElements.get(c))==null||r.remove(),this._decorationElements.delete(c),c.dispose()}};n.BufferDecorationRenderer=b=f([_(1,y.IBufferService),_(2,a.ICoreBrowserService),_(3,y.IDecorationService),_(4,a.IRenderService)],b)},5871:(j,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 f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,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,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,_){return f>=u.startBufferLine-this._linePadding[_||"full"]&&f<=u.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(j,n,u){var f=this&&this.__decorate||function(o,m,x,v){var w,S=arguments.length,C=S<3?m:v===null?v=Object.getOwnPropertyDescriptor(m,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(o,m,x,v);else for(var L=o.length-1;L>=0;L--)(w=o[L])&&(C=(S<3?w(C):S>3?w(m,x,C):w(m,x))||C);return S>3&&C&&Object.defineProperty(m,x,C),C},_=this&&this.__param||function(o,m){return function(x,v){m(x,v,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const a=u(5871),g=u(4725),y=u(844),b=u(2585),c={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 l=n.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,m,x,v,w,S,C){var A;super(),this._viewportElement=o,this._screenElement=m,this._bufferService=x,this._decorationService=v,this._renderService=w,this._optionsService=S,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,y.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 o=Math.floor(this._canvas.width/3),m=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=o,r.center=m,r.right=o,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=r.left,h.right=r.left+r.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,m=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);c.left=m,c.center=m,c.right=m}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.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 m of this._decorationService.decorations)this._colorZoneStore.addDecoration(m);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const m of o)m.position!=="full"&&this._renderColorZone(m);for(const m of o)m.position==="full"&&this._renderColorZone(m);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(h[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-c[o.position||"full"]/2),r[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[o.position||"full"]))}_queueRefresh(o,m){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=m||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=l=f([_(2,b.IBufferService),_(3,b.IDecorationService),_(4,g.IRenderService),_(5,b.IOptionsService),_(6,g.ICoreBrowserService)],l)},2950:function(j,n,u){var f=this&&this.__decorate||function(c,r,h,l){var o,m=arguments.length,x=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(m<3?o(x):m>3?o(r,h,x):o(r,h))||x);return m>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const a=u(4725),g=u(2585),y=u(2584);let b=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(c,r,h,l,o,m){this._textarea=c,this._compositionView=r,this._bufferService=h,this._optionsService=l,this._coreService=o,this._renderService=m,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(c){this._compositionView.textContent=c.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(c){if(this._isComposing||this._isSendingComposition){if(c.keyCode===229||c.keyCode===16||c.keyCode===17||c.keyCode===18)return!1;this._finalizeComposition(!1)}return c.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(c){if(this._compositionView.classList.remove("active"),this._isComposing=!1,c){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 c=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,h=r.replace(c,"");this._dataAlreadySent=h,r.length>c.length?this._coreService.triggerDataEvent(h,!0):r.length<c.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):r.length===c.length&&r!==c&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(c){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,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"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 m=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}c||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=b=f([_(2,g.IBufferService),_(3,g.IOptionsService),_(4,g.ICoreService),_(5,a.IRenderService)],b)},9806:(j,n)=>{function u(f,_,a){const g=a.getBoundingClientRect(),y=f.getComputedStyle(a),b=parseInt(y.getPropertyValue("padding-left")),c=parseInt(y.getPropertyValue("padding-top"));return[_.clientX-g.left-b,_.clientY-g.top-c]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(f,_,a,g,y,b,c,r,h){if(!b)return;const l=u(f,_,a);return l?(l[0]=Math.ceil((l[0]+(h?c/2:0))/c),l[1]=Math.ceil(l[1]/r),l[0]=Math.min(Math.max(l[0],1),g+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),y),l):void 0}},9504:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const f=u(2584);function _(r,h,l,o){const m=r-a(r,l),x=h-a(h,l),v=Math.abs(m-x)-(function(w,S,C){let L=0;const A=w-a(w,C),E=S-a(S,C);for(let T=0;T<Math.abs(A-E);T++){const H=g(w,S)==="A"?-1:1,G=C.buffer.lines.get(A+H*T);G!=null&&G.isWrapped&&L++}return L})(r,h,l);return c(v,b(g(r,h),o))}function a(r,h){let l=0,o=h.buffer.lines.get(r),m=o==null?void 0:o.isWrapped;for(;m&&r>=0&&r<h.rows;)l++,o=h.buffer.lines.get(--r),m=o==null?void 0:o.isWrapped;return l}function g(r,h){return r>h?"A":"B"}function y(r,h,l,o,m,x){let v=r,w=h,S="";for(;v!==l||w!==o;)v+=m?1:-1,m&&v>x.cols-1?(S+=x.buffer.translateBufferLineToString(w,!1,r,v),v=0,r=0,w++):!m&&v<0&&(S+=x.buffer.translateBufferLineToString(w,!1,0,r+1),v=x.cols-1,r=v,w--);return S+x.buffer.translateBufferLineToString(w,!1,r,v)}function b(r,h){const l=h?"O":"[";return f.C0.ESC+l+r}function c(r,h){r=Math.floor(r);let l="";for(let o=0;o<r;o++)l+=h;return l}n.moveToCellSequence=function(r,h,l,o){const m=l.buffer.x,x=l.buffer.y;if(!l.buffer.hasScrollback)return(function(S,C,L,A,E,T){return _(C,A,E,T).length===0?"":c(y(S,C,S,C-a(C,E),!1,E).length,b("D",T))})(m,x,0,h,l,o)+_(x,h,l,o)+(function(S,C,L,A,E,T){let H;H=_(C,A,E,T).length>0?A-a(A,E):C;const G=A,U=(function(P,F,R,B,D,k){let Y;return Y=_(R,B,D,k).length>0?B-a(B,D):F,P<R&&Y<=B||P>=R&&Y<B?"C":"D"})(S,C,L,A,E,T);return c(y(S,H,L,G,U==="C",E).length,b(U,T))})(m,x,r,h,l,o);let v;if(x===h)return v=m>r?"D":"C",c(Math.abs(m-r),b(v,o));v=x>h?"D":"C";const w=Math.abs(x-h);return c((function(S,C){return C.cols-S})(x>h?r:m,l)+(w-1)*l.cols+1+((x>h?m:r)-1),b(v,o))}},1296:function(j,n,u){var f=this&&this.__decorate||function(T,H,G,U){var P,F=arguments.length,R=F<3?H:U===null?U=Object.getOwnPropertyDescriptor(H,G):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(T,H,G,U);else for(var B=T.length-1;B>=0;B--)(P=T[B])&&(R=(F<3?P(R):F>3?P(H,G,R):P(H,G))||R);return F>3&&R&&Object.defineProperty(H,G,R),R},_=this&&this.__param||function(T,H){return function(G,U){H(G,U,T)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const a=u(3787),g=u(2550),y=u(2223),b=u(6171),c=u(6052),r=u(4725),h=u(8055),l=u(8460),o=u(844),m=u(2585),x="xterm-dom-renderer-owner-",v="xterm-rows",w="xterm-fg-",S="xterm-bg-",C="xterm-focus",L="xterm-selection";let A=1,E=n.DomRenderer=class extends o.Disposable{constructor(T,H,G,U,P,F,R,B,D,k,Y,V,le){super(),this._terminal=T,this._document=H,this._element=G,this._screenElement=U,this._viewportElement=P,this._helperContainer=F,this._linkifier2=R,this._charSizeService=D,this._optionsService=k,this._bufferService=Y,this._coreBrowserService=V,this._themeService=le,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,c.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.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=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((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),this.register((0,o.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 g.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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,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(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${v} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${v} .xterm-dim { color: ${h.color.multiplyOpacity(T.foreground,.5).css};}`,H+=`${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 G=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,P=`blink_block_${this._terminalClass}`;H+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${U} { 50% { box-shadow: none; }}`,H+=`@keyframes ${P} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,H+=`${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 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: ${P} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[F,R]of T.ansi.entries())H+=`${this._terminalSelector} .${w}${F} { color: ${R.css}; }${this._terminalSelector} .${w}${F}.xterm-dim { color: ${h.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${S}${F} { background-color: ${R.css}; }`;H+=`${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(T.background).css}; }${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${S}${y.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,H){for(let G=this._rowElements.length;G<=H;G++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,H){this._refreshRowElements(T,H),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(T,H,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,H,G),this.renderRows(0,this._bufferService.rows-1),!T||!H)return;this._selectionRenderModel.update(this._terminal,T,H,G);const U=this._selectionRenderModel.viewportStartRow,P=this._selectionRenderModel.viewportEndRow,F=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(F>=this._bufferService.rows||R<0)return;const B=this._document.createDocumentFragment();if(G){const D=T[0]>H[0];B.appendChild(this._createSelectionElement(F,D?H[0]:T[0],D?T[0]:H[0],R-F+1))}else{const D=U===F?T[0]:0,k=F===P?H[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(F,D,k));const Y=R-F-1;if(B.appendChild(this._createSelectionElement(F+1,0,this._bufferService.cols,Y)),F!==R){const V=P===R?H[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(R,0,V))}}this._selectionContainer.appendChild(B)}_createSelectionElement(T,H,G,U=1){const P=this._document.createElement("div"),F=H*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(G-H);return F+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-F),P.style.height=U*this.dimensions.css.cell.height+"px",P.style.top=T*this.dimensions.css.cell.height+"px",P.style.left=`${F}px`,P.style.width=`${R}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 T of this._rowElements)T.replaceChildren()}renderRows(T,H){const G=this._bufferService.buffer,U=G.ybase+G.y,P=Math.min(G.x,this._bufferService.cols-1),F=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=T;D<=H;D++){const k=D+G.ydisp,Y=this._rowElements[D],V=G.lines.get(k);if(!Y||!V)break;Y.replaceChildren(...this._rowFactory.createRow(V,k,k===U,R,B,P,F,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,H,G,U,P,F){G<0&&(T=0),U<0&&(H=0);const R=this._bufferService.rows-1;G=Math.max(Math.min(G,R),0),U=Math.max(Math.min(U,R),0),P=Math.min(P,this._bufferService.cols);const B=this._bufferService.buffer,D=B.ybase+B.y,k=Math.min(B.x,P-1),Y=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=G;ce<=U;++ce){const q=ce+B.ydisp,N=this._rowElements[ce],J=B.lines.get(q);if(!N||!J)break;N.replaceChildren(...this._rowFactory.createRow(J,q,q===D,V,le,k,Y,this.dimensions.css.cell.width,this._widthCache,F?ce===G?T:0:-1,F?(ce===U?H:P)-1:-1))}}};n.DomRenderer=E=f([_(7,m.IInstantiationService),_(8,r.ICharSizeService),_(9,m.IOptionsService),_(10,m.IBufferService),_(11,r.ICoreBrowserService),_(12,r.IThemeService)],E)},3787:function(j,n,u){var f=this&&this.__decorate||function(v,w,S,C){var L,A=arguments.length,E=A<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,w,S,C);else for(var T=v.length-1;T>=0;T--)(L=v[T])&&(E=(A<3?L(E):A>3?L(w,S,E):L(w,S))||E);return A>3&&E&&Object.defineProperty(w,S,E),E},_=this&&this.__param||function(v,w){return function(S,C){w(S,C,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const a=u(2223),g=u(643),y=u(511),b=u(2585),c=u(8055),r=u(4725),h=u(4269),l=u(6171),o=u(3734);let m=n.DomRendererRowFactory=class{constructor(v,w,S,C,L,A,E){this._document=v,this._characterJoinerService=w,this._optionsService=S,this._coreBrowserService=C,this._coreService=L,this._decorationService=A,this._themeService=E,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,w,S){this._selectionStart=v,this._selectionEnd=w,this._columnSelectMode=S}createRow(v,w,S,C,L,A,E,T,H,G,U){const P=[],F=this._characterJoinerService.getJoinedCharacters(w),R=this._themeService.colors;let B,D=v.getNoBgTrimmedLength();S&&D<A+1&&(D=A+1);let k=0,Y="",V=0,le=0,ce=0,q=!1,N=0,J=!1,ee=0;const _e=[],fe=G!==-1&&U!==-1;for(let Me=0;Me<D;Me++){v.loadCell(Me,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let Oe=!1,qe=Me,we=this._workCell;if(F.length>0&&Me===F[0][0]){Oe=!0;const Le=F.shift();we=new h.JoinedCellData(this._workCell,v.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),qe=Le[1]-1,ve=we.getWidth()}const ft=this._isCellInSelection(Me,w),Ot=S&&Me===A,Se=fe&&Me>=G&&Me<=U;let pe=!1;this._decorationService.forEachDecorationAtCell(Me,w,void 0,(Le=>{pe=!0}));let me=we.getChars()||g.WHITESPACE_CELL_CHAR;if(me===" "&&(we.isUnderline()||we.isOverline())&&(me=" "),ee=ve*T-H.get(me,we.isBold(),we.isItalic()),B){if(k&&(ft&&J||!ft&&!J&&we.bg===V)&&(ft&&J&&R.selectionForeground||we.fg===le)&&we.extended.ext===ce&&Se===q&&ee===N&&!Ot&&!Oe&&!pe){we.isInvisible()?Y+=g.WHITESPACE_CELL_CHAR:Y+=me,k++;continue}k&&(B.textContent=Y),B=this._document.createElement("span"),k=0,Y=""}else B=this._document.createElement("span");if(V=we.bg,le=we.fg,ce=we.extended.ext,q=Se,N=ee,J=ft,Oe&&A>=Me&&A<=qe&&(A=Me),!this._coreService.isCursorHidden&&Ot&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&_e.push("xterm-cursor-blink"),_e.push(C==="bar"?"xterm-cursor-bar":C==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(we.isBold()&&_e.push("xterm-bold"),we.isItalic()&&_e.push("xterm-italic"),we.isDim()&&_e.push("xterm-dim"),Y=we.isInvisible()?g.WHITESPACE_CELL_CHAR:we.getChars()||g.WHITESPACE_CELL_CHAR,we.isUnderline()&&(_e.push(`xterm-underline-${we.extended.underlineStyle}`),Y===" "&&(Y=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let Le=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&Le<8&&(Le+=8),B.style.textDecorationColor=R.ansi[Le].css}we.isOverline()&&(_e.push("xterm-overline"),Y===" "&&(Y=" ")),we.isStrikethrough()&&_e.push("xterm-strikethrough"),Se&&(B.style.textDecoration="underline");let ue=we.getFgColor(),ge=we.getFgColorMode(),ze=we.getBgColor(),Re=we.getBgColorMode();const _t=!!we.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,w,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?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,ze=Qe.rgba>>8&16777215,Re=50331648,Ae=!0,R.selectionForeground&&(ge=50331648,ue=R.selectionForeground.rgba>>8&16777215,it=R.selectionForeground)),Ae&&_e.push("xterm-decoration-top"),Re){case 16777216:case 33554432:Ie=R.ansi[ze],_e.push(`xterm-bg-${ze}`);break;case 50331648:Ie=c.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=R.foreground,_e.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ie=R.background}switch(Qe||we.isDim()&&(Qe=c.color.multiplyOpacity(Ie,.5)),ge){case 16777216:case 33554432:we.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(B,Ie,R.ansi[ue],we,Qe,void 0)||_e.push(`xterm-fg-${ue}`);break;case 50331648:const Le=c.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(B,Ie,Le,we,Qe,it)||this._addStyle(B,`color:#${x(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Ie,R.foreground,we,Qe,it)||_t&&_e.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}_e.length&&(B.className=_e.join(" "),_e.length=0),Ot||Oe||pe?B.textContent=Y:k++,ee!==this.defaultSpacing&&(B.style.letterSpacing=`${ee}px`),P.push(B),Me=qe}return B&&k&&(B.textContent=Y),P}_applyMinimumContrast(v,w,S,C,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(C.getCode()))return!1;const E=this._getContrastCache(C);let T;if(L||A||(T=E.getColor(w.rgba,S.rgba)),T===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);T=c.color.ensureContrastRatio(L||w,A||S,H),E.setColor((L||w).rgba,(A||S).rgba,T??null)}return!!T&&(this._addStyle(v,`color:${T.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,w){v.setAttribute("style",`${v.getAttribute("style")||""}${w};`)}_isCellInSelection(v,w){const S=this._selectionStart,C=this._selectionEnd;return!(!S||!C)&&(this._columnSelectMode?S[0]<=C[0]?v>=S[0]&&w>=S[1]&&v<C[0]&&w<=C[1]:v<S[0]&&w>=S[1]&&v>=C[0]&&w<=C[1]:w>S[1]&&w<C[1]||S[1]===C[1]&&w===S[1]&&v>=S[0]&&v<C[0]||S[1]<C[1]&&w===C[1]&&v<C[0]||S[1]<C[1]&&w===S[1]&&v>=S[0])}};function x(v,w,S){for(;v.length<S;)v=w+v;return v}n.DomRendererRowFactory=m=f([_(1,r.ICharacterJoinerService),_(2,b.IOptionsService),_(3,r.ICoreBrowserService),_(4,b.ICoreService),_(5,b.IDecorationService),_(6,r.IThemeService)],m)},2550:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u,f){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 g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const y=u.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[_,a,g,y],this._container.appendChild(_),this._container.appendChild(a),this._container.appendChild(g),this._container.appendChild(y),f.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,f,_,a){u===this._font&&f===this._fontSize&&_===this._weight&&a===this._weightBold||(this._font=u,this._fontSize=f,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,f,_){let a=0;if(!f&&!_&&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 g=u;f&&(g+="B"),_&&(g+="I");let y=this._holey.get(g);if(y===void 0){let b=0;f&&(b|=1),_&&(b|=2),y=this._measure(u,b),y>0&&this._holey.set(g,y)}return y}_measure(u,f){const _=this._measureElements[f];return _.textContent=u.repeat(32),_.offsetWidth/32}}},2223:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function f(_){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=f,n.allowRescaling=function(_,a,g,y){return a===1&&g>Math.ceil(1.5*y)&&_!==void 0&&_>255&&!f(_)&&!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,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},6052:(j,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,g,y=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const b=_.buffers.active.ydisp,c=a[1]-b,r=g[1]-b,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},456:(j,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,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[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(j,n,u){var f=this&&this.__decorate||function(l,o,m,x){var v,w=arguments.length,S=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,o,m,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(S=(w<3?v(S):w>3?v(o,m,S):v(o,m))||S);return w>3&&S&&Object.defineProperty(o,m,S),S},_=this&&this.__param||function(l,o){return function(m,x){o(m,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const a=u(2585),g=u(8460),y=u(844);let b=n.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,o,m){super(),this._optionsService=m,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new r(l,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};n.CharSizeService=b=f([_(2,a.IOptionsService)],b);class c extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,m){o!==void 0&&o>0&&m!==void 0&&m>0&&(this._result.width=o,this._result.height=m)}}class r extends c{constructor(o,m,x){super(),this._document=o,this._parentElement=m,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 c{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const m=this._ctx.measureText("W");if(!("width"in m&&"fontBoundingBoxAscent"in m&&"fontBoundingBoxDescent"in m))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function(j,n,u){var f=this&&this.__decorate||function(h,l,o,m){var x,v=arguments.length,w=v<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,o):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,m);else for(var S=h.length-1;S>=0;S--)(x=h[S])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,m){l(o,m,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(3734),g=u(643),y=u(511),b=u(2585);class c extends a.AttributeData{constructor(l,o,m){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=o,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=c;let r=n.CharacterJoinerService=class af{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(l){const o={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(o),o.id}deregister(l){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===l)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(l);if(!o||o.length===0)return[];const m=[],x=o.translateToString(!0);let v=0,w=0,S=0,C=o.getFg(0),L=o.getBg(0);for(let A=0;A<o.getTrimmedLength();A++)if(o.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,S,w,o,v);for(let T=0;T<E.length;T++)m.push(E[T])}v=A,S=w,C=this._workCell.fg,L=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const A=this._getJoinedRanges(x,S,w,o,v);for(let E=0;E<A.length;E++)m.push(A[E])}return m}_getJoinedRanges(l,o,m,x,v){const w=l.substring(o,m);let S=[];try{S=this._characterJoiners[0].handler(w)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(w);for(let A=0;A<L.length;A++)af._mergeRanges(S,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(S,x,v),S}_stringRangesToCellRanges(l,o,m){let x=0,v=!1,w=0,S=l[x];if(S){for(let C=m;C<this._bufferService.cols;C++){const L=o.getWidth(C),A=o.getString(C).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&S[0]<=w&&(S[0]=C,v=!0),S[1]<=w){if(S[1]=C,S=l[++x],!S)break;S[0]<=w?(S[0]=C,v=!0):v=!1}w+=A}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(l,o){let m=!1;for(let x=0;x<l.length;x++){const v=l[x];if(m){if(o[1]<=v[0])return l[x-1][1]=o[1],l;if(o[1]<=v[1])return l[x-1][1]=Math.max(o[1],v[1]),l.splice(x,1),l;l.splice(x,1),x--}else{if(o[1]<=v[0])return l.splice(x,0,o),l;if(o[1]<=v[1])return v[0]=Math.min(o[0],v[0]),l;o[0]<v[1]&&(v[0]=Math.min(o[0],v[0]),m=!0)}}return m?l[l.length-1][1]=o[1]:l.push(o),l}};n.CharacterJoinerService=r=f([_(0,b.IBufferService)],r)},5114:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const f=u(844),_=u(8460),a=u(3656);class g extends f.Disposable{constructor(c,r,h){super(),this._textarea=c,this._window=r,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(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((l=>this._screenDprMonitor.setWindow(l)))),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(c){this._window!==c&&(this._window=c,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=g;class y extends f.Disposable{constructor(c){super(),this._parentWindow=c,this._windowResizeListener=this.register(new f.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,f.toDisposable)((()=>this.clearListener())))}setWindow(c){this._parentWindow=c,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 c;this._outerListener&&((c=this._resolutionMediaMatchList)==null||c.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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const f=u(844);class _ extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const y=this.linkProviders.indexOf(g);y!==-1&&this.linkProviders.splice(y,1)}}}}n.LinkProviderService=_},8934:function(j,n,u){var f=this&&this.__decorate||function(b,c,r,h){var l,o=arguments.length,m=o<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,r):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(b,c,r,h);else for(var x=b.length-1;x>=0;x--)(l=b[x])&&(m=(o<3?l(m):o>3?l(c,r,m):l(c,r))||m);return o>3&&m&&Object.defineProperty(c,r,m),m},_=this&&this.__param||function(b,c){return function(r,h){c(r,h,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const a=u(4725),g=u(9806);let y=n.MouseService=class{constructor(b,c){this._renderService=b,this._charSizeService=c}getCoords(b,c,r,h,l){return(0,g.getCoords)(window,b,c,r,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(b,c){const r=(0,g.getCoordsRelativeToElement)(window,b,c);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=y=f([_(0,a.IRenderService),_(1,a.ICharSizeService)],y)},3230:function(j,n,u){var f=this&&this.__decorate||function(l,o,m,x){var v,w=arguments.length,S=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,o,m,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(S=(w<3?v(S):w>3?v(o,m,S):v(o,m))||S);return w>3&&S&&Object.defineProperty(o,m,S),S},_=this&&this.__param||function(l,o){return function(m,x){o(m,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const a=u(6193),g=u(4725),y=u(8460),b=u(844),c=u(7226),r=u(2585);let h=n.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,o,m,x,v,w,S,C){super(),this._rowCount=l,this._charSizeService=x,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new c.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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,A)=>this._renderRows(L,A)),S),this.register(this._renderDebouncer),this.register(S.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(m.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(v.onDecorationRegistered((()=>this._fullRefresh()))),this.register(v.onDecorationRemoved((()=>this._fullRefresh()))),this.register(m.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(m.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(C.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(S.window,o),this.register(S.onWindowChange((L=>this._registerIntersectionObserver(L,o))))}_registerIntersectionObserver(l,o){if("IntersectionObserver"in l){const m=new l.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});m.observe(o),this._observerDisposable.value=(0,b.toDisposable)((()=>m.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,o,m=!1){this._isPaused?this._needsFullRefresh=!0:(m||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,o,this._rowCount))}_renderRows(l,o){this._renderer.value&&(l=Math.min(l,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(l,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:o}),this._onRender.fire({start:l,end:o}),this._isNextRenderRedrawOnly=!0)}resize(l,o){this._rowCount=o,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((o=>this.refreshRows(o.start,o.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,o;this._renderer.value&&((o=(l=this._renderer.value).clearTextureAtlas)==null||o.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var m;return(m=this._renderer.value)==null?void 0:m.handleResize(l,o)})):this._renderer.value.handleResize(l,o),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,o,m){var x;this._selectionState.start=l,this._selectionState.end=o,this._selectionState.columnSelectMode=m,(x=this._renderer.value)==null||x.handleSelectionChanged(l,o,m)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};n.RenderService=h=f([_(2,r.IOptionsService),_(3,g.ICharSizeService),_(4,r.IDecorationService),_(5,r.IBufferService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],h)},9312:function(j,n,u){var f=this&&this.__decorate||function(S,C,L,A){var E,T=arguments.length,H=T<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(S,C,L,A);else for(var G=S.length-1;G>=0;G--)(E=S[G])&&(H=(T<3?E(H):T>3?E(C,L,H):E(C,L))||H);return T>3&&H&&Object.defineProperty(C,L,H),H},_=this&&this.__param||function(S,C){return function(L,A){C(L,A,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const a=u(9806),g=u(9504),y=u(456),b=u(4725),c=u(8460),r=u(844),h=u(6114),l=u(4841),o=u(511),m=u(2585),x=" ",v=new RegExp(x,"g");let w=n.SelectionService=class extends r.Disposable{constructor(S,C,L,A,E,T,H,G,U){super(),this._element=S,this._screenElement=C,this._linkifier=L,this._bufferService=A,this._coreService=E,this._mouseService=T,this._optionsService=H,this._renderService=G,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new c.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new c.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new c.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new c.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 y.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 S=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!S||!C||S[0]===C[0]&&S[1]===C[1])}get selectionText(){const S=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!S||!C)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(S[0]===C[0])return"";const E=S[0]<C[0]?S[0]:C[0],T=S[0]<C[0]?C[0]:S[0];for(let H=S[1];H<=C[1];H++){const G=L.translateBufferLineToString(H,!0,E,T);A.push(G)}}else{const E=S[1]===C[1]?C[0]:void 0;A.push(L.translateBufferLineToString(S[1],!0,S[0],E));for(let T=S[1]+1;T<=C[1]-1;T++){const H=L.lines.get(T),G=L.translateBufferLineToString(T,!0);H!=null&&H.isWrapped?A[A.length-1]+=G:A.push(G)}if(S[1]!==C[1]){const T=L.lines.get(C[1]),H=L.translateBufferLineToString(C[1],!0,0,C[0]);T&&T.isWrapped?A[A.length-1]+=H:A.push(H)}}return A.map((E=>E.replace(v," "))).join(h.isWindows?`\r
54
+ `:`
55
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&S&&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(S){const C=this._getMouseBufferCoords(S),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&C)&&this._areCoordsInSelection(C,L,A)}isCellInSelection(S,C){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([S,C],L,A)}_areCoordsInSelection(S,C,L){return S[1]>C[1]&&S[1]<L[1]||C[1]===L[1]&&S[1]===C[1]&&S[0]>=C[0]&&S[0]<L[0]||C[1]<L[1]&&S[1]===L[1]&&S[0]<L[0]||C[1]<L[1]&&S[1]===C[1]&&S[0]>=C[0]}_selectWordAtCursor(S,C){var E,T;const L=(T=(E=this._linkifier.currentLink)==null?void 0:E.link)==null?void 0:T.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(S);return!!A&&(this._selectWordAt(A,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,C){this._model.clearSelection(),S=Math.max(S,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const C=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(S){let C=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,S,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(S){return h.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!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(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const C=this._getMouseBufferCoords(S);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(S){return S.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.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(S),!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(S),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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const C=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,L=!(!S||!C||S[0]===C[0]&&S[1]===C[1]);L?S&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,C,L)):this._oldHasSelection&&this._fireOnSelectionChange(S,C,L)}_fireOnSelectionChange(S,C,L){this._oldSelectionStart=S,this._oldSelectionEnd=C,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim((C=>this._handleTrim(C)))}_convertViewportColToCharacterIndex(S,C){let L=C;for(let A=0;C>=A;A++){const E=S.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:E>1&&C!==A&&(L+=E-1)}return L}setSelection(S,C,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,C],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,C,L=!0,A=!0){if(S[0]>=this._bufferService.cols)return;const E=this._bufferService.buffer,T=E.lines.get(S[1]);if(!T)return;const H=E.translateBufferLineToString(S[1],!1);let G=this._convertViewportColToCharacterIndex(T,S[0]),U=G;const P=S[0]-G;let F=0,R=0,B=0,D=0;if(H.charAt(G)===" "){for(;G>0&&H.charAt(G-1)===" ";)G--;for(;U<H.length&&H.charAt(U+1)===" ";)U++}else{let V=S[0],le=S[0];T.getWidth(V)===0&&(F++,V--),T.getWidth(le)===2&&(R++,le++);const ce=T.getString(le).length;for(ce>1&&(D+=ce-1,U+=ce-1);V>0&&G>0&&!this._isCharWordSeparator(T.loadCell(V-1,this._workCell));){T.loadCell(V-1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,V--):q>1&&(B+=q-1,G-=q-1),G--,V--}for(;le<T.length&&U+1<H.length&&!this._isCharWordSeparator(T.loadCell(le+1,this._workCell));){T.loadCell(le+1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,le++):q>1&&(D+=q-1,U+=q-1),U++,le++}}U++;let k=G+P-F+B,Y=Math.min(this._bufferService.cols,U-G+F+R-B-D);if(C||H.slice(G,U).trim()!==""){if(L&&k===0&&T.getCodePoint(0)!==32){const V=E.lines.get(S[1]-1);if(V&&T.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(le){const ce=this._bufferService.cols-le.start;k-=ce,Y+=ce}}}if(A&&k+Y===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const V=E.lines.get(S[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const le=this._getWordAt([0,S[1]+1],!1,!1,!0);le&&(Y+=le.length)}}return{start:k,length:Y}}}_selectWordAt(S,C){const L=this._getWordAt(S,C);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[L.start,S[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(S){const C=this._getWordAt(S,!0);if(C){let L=S[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(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const C=this._bufferService.buffer.getWrappedRangeForLine(S),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,l.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=w=f([_(3,m.IBufferService),_(4,m.ICoreService),_(5,b.IMouseService),_(6,m.IOptionsService),_(7,b.IRenderService),_(8,b.ICoreBrowserService)],w)},4725:(j,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 f=u(8343);n.ICharSizeService=(0,f.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),n.IMouseService=(0,f.createDecorator)("MouseService"),n.IRenderService=(0,f.createDecorator)("RenderService"),n.ISelectionService=(0,f.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,f.createDecorator)("ThemeService"),n.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(j,n,u){var f=this&&this.__decorate||function(w,S,C,L){var A,E=arguments.length,T=E<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,S,C,L);else for(var H=w.length-1;H>=0;H--)(A=w[H])&&(T=(E<3?A(T):E>3?A(S,C,T):A(S,C))||T);return E>3&&T&&Object.defineProperty(S,C,T),T},_=this&&this.__param||function(w,S){return function(C,L){S(C,L,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const a=u(7239),g=u(8055),y=u(8460),b=u(844),c=u(2585),r=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),l=g.css.toColor("#ffffff"),o=g.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let C=0;C<216;C++){const L=S[C/36%6|0],A=S[C/6%6|0],E=S[C%6];w.push({css:g.channels.toCss(L,A,E),rgba:g.channels.toRgba(L,A,E)})}for(let C=0;C<24;C++){const L=8+10*C;w.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return w})());let x=n.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:h,cursor:l,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:g.color.blend(h,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:g.color.blend(h,m),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(w={}){const S=this._colors;if(S.foreground=v(w.foreground,r),S.background=v(w.background,h),S.cursor=v(w.cursor,l),S.cursorAccent=v(w.cursorAccent,o),S.selectionBackgroundTransparent=v(w.selectionBackground,m),S.selectionBackgroundOpaque=g.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=v(w.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=g.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=w.selectionForeground?v(w.selectionForeground,g.NULL_COLOR):void 0,S.selectionForeground===g.NULL_COLOR&&(S.selectionForeground=void 0),g.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=g.color.opacity(S.selectionBackgroundTransparent,.3)),g.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=g.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=n.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=v(w.black,n.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=v(w.red,n.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=v(w.green,n.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=v(w.yellow,n.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=v(w.blue,n.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=v(w.magenta,n.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=v(w.cyan,n.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=v(w.white,n.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=v(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=v(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=v(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=v(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=v(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=v(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=v(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=v(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const C=Math.min(S.ansi.length-16,w.extendedAnsi.length);for(let L=0;L<C;L++)S.ansi[L+16]=v(w.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(w){w(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(w,S){if(w!==void 0)try{return g.css.toColor(w)}catch{}return S}n.ThemeService=x=f([_(0,c.IOptionsService)],x)},6349:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const f=u(8460),_=u(844);class a extends _.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(y){if(this._maxLength===y)return;const b=new Array(y);for(let c=0;c<Math.min(y,this.length);c++)b[c]=this._array[this._getCyclicIndex(c)];this._array=b,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let b=this._length;b<y;b++)this._array[b]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,b){this._array[this._getCyclicIndex(y)]=b}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,b,...c){if(b){for(let r=y;r<this._length-b;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+b)];this._length-=b,this.onDeleteEmitter.fire({index:y,amount:b})}for(let r=this._length-1;r>=y;r--)this._array[this._getCyclicIndex(r+c.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<c.length;r++)this._array[this._getCyclicIndex(y+r)]=c[r];if(c.length&&this.onInsertEmitter.fire({index:y,amount:c.length}),this._length+c.length>this._maxLength){const r=this._length+c.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=c.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,b,c){if(!(b<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let h=b-1;h>=0;h--)this.set(y+h+c,this.get(y+h));const r=y+b+c-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(y+r+c,this.get(y+r))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}n.CircularList=a},1439:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(f,_=5){if(typeof f!="object")return f;const a=Array.isArray(f)?[]:{};for(const g in f)a[g]=_<=1?f[g]:f[g]&&u(f[g],_-1);return a}},8055:(j,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,f=0,_=0,a=0;var g,y,b,c,r;function h(o){const m=o.toString(16);return m.length<2?"0"+m:m}function l(o,m){return o<m?(m+.05)/(o+.05):(o+.05)/(m+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(m,x,v,w){return w!==void 0?`#${h(m)}${h(x)}${h(v)}${h(w)}`:`#${h(m)}${h(x)}${h(v)}`},o.toRgba=function(m,x,v,w=255){return(m<<24|x<<16|v<<8|w)>>>0},o.toColor=function(m,x,v,w){return{css:o.toCss(m,x,v,w),rgba:o.toRgba(m,x,v,w)}}})(g||(n.channels=g={})),(function(o){function m(x,v){return a=Math.round(255*v),[u,f,_]=r.toChannels(x.rgba),{css:g.toCss(u,f,_,a),rgba:g.toRgba(u,f,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,S=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((w-L)*a),f=A+Math.round((S-A)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,f,_),rgba:g.toRgba(u,f,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const S=r.ensureContrastRatio(x.rgba,v.rgba,w);if(S)return g.toColor(S>>24&255,S>>16&255,S>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,f,_]=r.toChannels(v),{css:g.toCss(u,f,_),rgba:v}},o.opacity=m,o.multiplyOpacity=function(x,v){return a=255&x.rgba,m(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(y||(n.color=y={})),(function(o){let m,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(m=w,m.globalCompositeOperation="copy",x=m.createLinearGradient(0,0,1,1))}catch{}o.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),f=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,f,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),f=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),g.toColor(u,f,_,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 w=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(w)return u=parseInt(w[1]),f=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,f,_,a);if(!m||!x)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=x,m.fillStyle=v,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[u,f,_,a]=m.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,f,_,a),css:v}}})(b||(n.css=b={})),(function(o){function m(x,v,w){const S=x/255,C=v/255,L=w/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.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))}o.relativeLuminance=function(x){return m(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=m})(c||(n.rgb=c={})),(function(o){function m(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E>0||T>0||H>0);)E-=Math.max(0,Math.ceil(.1*E)),T-=Math.max(0,Math.ceil(.1*T)),H-=Math.max(0,Math.ceil(.1*H)),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}function x(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E<255||T<255||H<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=Math.min(255,H+Math.ceil(.1*(255-H))),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const S=w>>24&255,C=w>>16&255,L=w>>8&255,A=v>>24&255,E=v>>16&255,T=v>>8&255;return u=A+Math.round((S-A)*a),f=E+Math.round((C-E)*a),_=T+Math.round((L-T)*a),g.toRgba(u,f,_)},o.ensureContrastRatio=function(v,w,S){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<S){if(L<C){const T=m(v,w,S),H=l(C,c.relativeLuminance(T>>8));if(H<S){const G=x(v,w,S);return H>l(C,c.relativeLuminance(G>>8))?T:G}return T}const A=x(v,w,S),E=l(C,c.relativeLuminance(A>>8));if(E<S){const T=m(v,w,S);return E>l(C,c.relativeLuminance(T>>8))?A:T}return A}},o.reduceLuminance=m,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},8969:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const f=u(844),_=u(2585),a=u(4348),g=u(7866),y=u(744),b=u(7302),c=u(6975),r=u(8460),h=u(1753),l=u(1480),o=u(7994),m=u(9282),x=u(5435),v=u(5981),w=u(2660);let S=!1;class C extends f.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 f.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(y.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.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(l.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.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,T)=>this._inputHandler.parse(E,T)))),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&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!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,y.MINIMUM_COLS),E=Math.max(E,y.MINIMUM_ROWS),this._bufferService.resize(A,E))}scroll(A,E=!1){this._bufferService.scroll(A,E)}scrollLines(A,E,T){this._bufferService.scrollLines(A,E,T)}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(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const E of A)E.dispose()}))}}}n.CoreTerminal=C},8460:(j,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 f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){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,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,f){return u((_=>f.fire(_)))},n.runAndSubscribe=function(u,f){return f(void 0),u((_=>f(_)))}},5435:function(j,n,u){var f=this&&this.__decorate||function(F,R,B,D){var k,Y=arguments.length,V=Y<3?R:D===null?D=Object.getOwnPropertyDescriptor(R,B):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(F,R,B,D);else for(var le=F.length-1;le>=0;le--)(k=F[le])&&(V=(Y<3?k(V):Y>3?k(R,B,V):k(R,B))||V);return Y>3&&V&&Object.defineProperty(R,B,V),V},_=this&&this.__param||function(F,R){return function(B,D){R(B,D,F)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const a=u(2584),g=u(7116),y=u(2015),b=u(844),c=u(482),r=u(8437),h=u(8460),l=u(643),o=u(511),m=u(3734),x=u(2585),v=u(1480),w=u(6242),S=u(6351),C=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function E(F,R){if(F>24)return R.setWinLines||!1;switch(F){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var T;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(n.WindowsOptionsReportType=T={}));let H=0;class G extends b.Disposable{getAttrData(){return this._curAttrData}constructor(R,B,D,k,Y,V,le,ce,q=new y.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=B,this._coreService=D,this._logService=k,this._optionsService=Y,this._oscLinkService=V,this._coreMouseService=le,this._unicodeService=ce,this._parser=q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new o.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,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:J.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,J,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:J,data:ee})})),this._parser.setDcsHandlerFallback(((N,J,ee)=>{J==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:J,payload:ee})})),this._parser.setPrintHandler(((N,J,ee)=>this.print(N,J,ee))),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 w.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new w.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new w.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new w.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new w.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new w.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new w.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new w.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new w.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new w.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new w.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 g.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 S.DcsHandler(((N,J)=>this.requestStatusString(N,J))))}_preserveStack(R,B,D,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=D,this._parseStack.position=k}_logSlowResolvingAsync(R){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([R,new Promise(((B,D)=>setTimeout((()=>D("#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(R,B){let D,k=this._activeBuffer.x,Y=this._activeBuffer.y,V=0;const le=this._parseStack.paused;if(le){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(D),D;k=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>A&&(V=this._parseStack.position+A)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,(N=>String.fromCharCode(N))).join("")}"`),typeof R=="string"?R.split("").map((N=>N.charCodeAt(0))):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(R.length,A))),le||this._dirtyRowTracker.clearRange(),R.length>A)for(let N=V;N<R.length;N+=A){const J=N+A<R.length?N+A:R.length,ee=typeof R=="string"?this._stringDecoder.decode(R.substring(N,J),this._parseBuffer):this._utf8Decoder.decode(R.subarray(N,J),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(k,Y,ee,N),this._logSlowResolvingAsync(D),D}else if(!le){const N=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,N))return this._preserveStack(k,Y,N,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===k&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ce=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(ce,this._bufferService.rows-1))}print(R,B,D){let k,Y;const V=this._charsetService.charset,le=this._optionsService.rawOptions.screenReaderMode,ce=this._bufferService.cols,q=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,J=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-B>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let _e=this._parser.precedingJoinState;for(let fe=B;fe<D;++fe){if(k=R[fe],k<127&&V){const qe=V[String.fromCharCode(k)];qe&&(k=qe.charCodeAt(0))}const Me=this._unicodeService.charProperties(k,_e);Y=v.UnicodeService.extractWidth(Me);const ve=v.UnicodeService.extractShouldJoin(Me),Oe=ve?v.UnicodeService.extractWidth(_e):0;if(_e=Me,le&&this._onA11yChar.fire((0,c.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-Oe>ce){if(q){const qe=ee;let we=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,we,0,Oe,!1);we<ce;)qe.setCellFromCodepoint(we++,0,1,J)}else if(this._activeBuffer.x=ce-1,Y===2)continue}if(ve&&this._activeBuffer.x){const qe=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-qe,k,Y);for(let we=Y-Oe;--we>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(N&&(ee.insertCells(this._activeBuffer.x,Y-Oe,this._activeBuffer.getNullCell(J)),ee.getWidth(ce-1)===2&&ee.setCellFromCodepoint(ce-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,J)),ee.setCellFromCodepoint(this._activeBuffer.x++,k,Y,J),Y>0)for(;--Y;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ce&&D-B>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,B){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,B):this._parser.registerCsiHandler(R,(D=>!E(D.params[0],this._optionsService.rawOptions.windowOptions)||B(D)))}registerDcsHandler(R,B){return this._parser.registerDcsHandler(R,new S.DcsHandler(B))}registerEscHandler(R,B){return this._parser.registerEscHandler(R,B)}registerOscHandler(R,B){return this._parser.registerOscHandler(R,new w.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 R;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&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.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 R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=R,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+B)}cursorUp(R){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const B=R.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=R.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=R.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const B=R.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,B,D,k=!1,Y=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);V.replaceCells(B,D,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),k&&(V.isWrapped=!1)}_resetBufferLine(R,B=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),D.isWrapped=!1)}eraseInDisplay(R,B=!1){let D;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);D<this._bufferService.rows;D++)this._resetBufferLine(D,B);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,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(R,B=!1){switch(this._restrictCursor(this._bufferService.cols),R.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(R){this._restrictCursor();let B=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;B--;)this._activeBuffer.lines.splice(Y-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let B=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=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(D,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(R){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let B=R.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(R){let B=R.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(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);k.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);k.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);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(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);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(R){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const B=this._parser.precedingJoinState;if(!B)return!0;const D=R.params[0]||1,k=v.UnicodeService.extractWidth(B),Y=this._activeBuffer.x-k,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),le=new Uint32Array(V.length*D);let ce=0;for(let N=0;N<V.length;){const J=V.codePointAt(N)||0;le[ce++]=J,N+=J>65535?2:1}let q=ce;for(let N=1;N<D;++N)le.copyWithin(q,0,ce),q+=ce;return this.print(le,0,q),!0}sendDeviceAttributesPrimary(R){return R.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(R){return R.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(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let B=0;B<R.length;B++)switch(R.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let B=0;B<R.length;B++)switch(R.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(R){for(let B=0;B<R.length;B++)switch(R.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let B=0;B<R.length;B++)switch(R.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(),R.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(R,B){const D=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:Y}=this._coreMouseService,V=this._coreService,{buffers:le,cols:ce}=this._bufferService,{active:q,alt:N}=le,J=this._optionsService.rawOptions,ee=ve=>ve?1:2,_e=R.params[0];return fe=_e,Me=B?_e===2?4:_e===4?ee(V.modes.insertMode):_e===12?3:_e===20?ee(J.convertEol):0:_e===1?ee(D.applicationCursorKeys):_e===3?J.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:_e===6?ee(D.origin):_e===7?ee(D.wraparound):_e===8?3:_e===9?ee(k==="X10"):_e===12?ee(J.cursorBlink):_e===25?ee(!V.isCursorHidden):_e===45?ee(D.reverseWraparound):_e===66?ee(D.applicationKeypad):_e===67?4:_e===1e3?ee(k==="VT200"):_e===1002?ee(k==="DRAG"):_e===1003?ee(k==="ANY"):_e===1004?ee(D.sendFocus):_e===1005?4:_e===1006?ee(Y==="SGR"):_e===1015?4:_e===1016?ee(Y==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?ee(q===N):_e===2004?ee(D.bracketedPasteMode):0,V.triggerDataEvent(`${a.C0.ESC}[${B?"":"?"}${fe};${Me}$y`),!0;var fe,Me}_updateAttrColor(R,B,D,k,Y){return B===2?(R|=50331648,R&=-16777216,R|=m.AttributeData.fromColorRGB([D,k,Y])):B===5&&(R&=-50331904,R|=33554432|255&D),R}_extractColor(R,B,D){const k=[0,0,-1,0,0,0];let Y=0,V=0;do{if(k[V+Y]=R.params[B+V],R.hasSubParams(B+V)){const le=R.getSubParams(B+V);let ce=0;do k[1]===5&&(Y=1),k[V+ce+1+Y]=le[ce];while(++ce<le.length&&ce+V+1+Y<k.length);break}if(k[1]===5&&V+Y>=2||k[1]===2&&V+Y>=5)break;k[1]&&(Y=1)}while(++V+B<R.length&&V+Y<k.length);for(let le=2;le<k.length;++le)k[le]===-1&&(k[le]=0);switch(k[0]){case 38:D.fg=this._updateAttrColor(D.fg,k[1],k[3],k[4],k[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,k[1],k[3],k[4],k[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,k[1],k[3],k[4],k[5])}return V}_processUnderline(R,B){B.extended=B.extended.clone(),(!~R||R>5)&&(R=1),B.extended.underlineStyle=R,B.fg|=268435456,R===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(R){R.fg=r.DEFAULT_ATTR_DATA.fg,R.bg=r.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=R.length;let D;const k=this._curAttrData;for(let Y=0;Y<B;Y++)D=R.params[Y],D>=30&&D<=37?(k.fg&=-50331904,k.fg|=16777216|D-30):D>=40&&D<=47?(k.bg&=-50331904,k.bg|=16777216|D-40):D>=90&&D<=97?(k.fg&=-50331904,k.fg|=16777224|D-90):D>=100&&D<=107?(k.bg&=-50331904,k.bg|=16777224|D-100):D===0?this._processSGR0(k):D===1?k.fg|=134217728:D===3?k.bg|=67108864:D===4?(k.fg|=268435456,this._processUnderline(R.hasSubParams(Y)?R.getSubParams(Y)[0]:1,k)):D===5?k.fg|=536870912:D===7?k.fg|=67108864:D===8?k.fg|=1073741824:D===9?k.fg|=2147483648:D===2?k.bg|=134217728:D===21?this._processUnderline(2,k):D===22?(k.fg&=-134217729,k.bg&=-134217729):D===23?k.bg&=-67108865:D===24?(k.fg&=-268435457,this._processUnderline(0,k)):D===25?k.fg&=-536870913:D===27?k.fg&=-67108865:D===28?k.fg&=-1073741825:D===29?k.fg&=2147483647:D===39?(k.fg&=-67108864,k.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):D===49?(k.bg&=-67108864,k.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?Y+=this._extractColor(R,Y,k):D===53?k.bg|=1073741824:D===55?k.bg&=-1073741825:D===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):D===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.",D);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${B};${D}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const B=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${B};${D}R`)}return!0}softReset(R){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(R){const B=R.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 D=B%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(R){const B=R.params[0]||1;let D;return(R.length<2||(D=R.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(R){if(!E(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.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(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const B=[],D=R.split(";");for(;D.length>1;){const k=D.shift(),Y=D.shift();if(/^\d+$/.exec(k)){const V=parseInt(k);if(P(V))if(Y==="?")B.push({type:0,index:V});else{const le=(0,C.parseColor)(Y);le&&B.push({type:1,index:V,color:le})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(R){const B=R.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(R,B){this._getCurrentLinkId()&&this._finishHyperlink();const D=R.split(":");let k;const Y=D.findIndex((V=>V.startsWith("id=")));return Y!==-1&&(k=D[Y].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(R,B){const D=R.split(";");for(let k=0;k<D.length&&!(B>=this._specialColors.length);++k,++B)if(D[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Y=(0,C.parseColor)(D[k]);Y&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Y}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const B=[],D=R.split(";");for(let k=0;k<D.length;++k)if(/^\d+$/.exec(D[k])){const Y=parseInt(D[k]);P(Y)&&B.push({type:2,index:Y})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,g.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(L[R[0]],g.CHARSETS[R[1]]||g.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 R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,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(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new o.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const D=this._activeBuffer.ybase+this._activeBuffer.y+B,k=this._activeBuffer.lines.get(D);k&&(k.fill(R),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,B){const D=this._bufferService.buffer,k=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${Y}${a.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,B){this._dirtyRowTracker.markRangeDirty(R,B)}}n.InputHandler=G;let U=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,R){F>R&&(H=F,F=R,R=H),F<this.start&&(this.start=F),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(F){return 0<=F&&F<256}U=f([_(0,x.IBufferService)],U)},844:(j,n)=>{function u(f){for(const _ of f)_.dispose();f.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 f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)==null||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},n.toDisposable=function(f){return{dispose:f}},n.disposeArray=u,n.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}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(f,_,a,g,y){this._data.get(f,_)||this._data.set(f,_,new u),this._data.get(f,_).set(a,g,y)}get(f,_,a,g){var y;return(y=this._data.get(f,_))==null?void 0:y.get(a,g)}clear(){this._data.clear()}}},6114:(j,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,f=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(f),n.isIpad=f==="iPad",n.isIphone=f==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),n.isLinux=f.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const _=this._getKey(f);if(_===void 0||(u=this._search(_),u===-1)||this._getKey(this._array[u])!==_)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===_);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,_){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do _(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let _=0,a=this._array.length-1;for(;a>=_;){let g=_+a>>1;const y=this._getKey(this._array[g]);if(y>f)a=g-1;else{if(!(y<f)){for(;g>0&&this._getKey(this._array[g-1])===f;)g--;return g}_=g+1}}return _}}},7226:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const f=u(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let b=0,c=0,r=y.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),c=Math.max(b,c),h=y.timeRemaining(),1.5*c>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(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const b=Date.now()+y;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const f=u(643);n.updateWindowsModeWrappedState=function(_){const a=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),g=a==null?void 0:a.get(_.cols-1),y=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);y&&g&&(y.isWrapped=g[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&g[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(j,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 f}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 f{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,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=f},9092:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const f=u(6349),_=u(7226),a=u(3734),g=u(8437),y=u(4634),b=u(511),c=u(643),r=u(4863),h=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(l,o,m){this._hasScrollback=l,this._optionsService=o,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.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 f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,o){return new g.BufferLine(this._bufferService.cols,this.getNullCell(l),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const o=l+this._optionsService.rawOptions.scrollback;return o>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:o}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=g.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,o){const m=this.getNullCell(g.DEFAULT_ATTR_DATA);let x=0;const v=this._getCorrectBufferLength(o);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<l)for(let S=0;S<this.lines.length;S++)x+=+this.lines.get(S).resize(l,m);let w=0;if(this._rows<o)for(let S=this._rows;S<o;S++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(l,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(l,m)));else for(let S=this._rows;S>o;S--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const S=this.lines.length-v;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=v}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,o-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(l,o),this._cols>l))for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(l,m);this._cols=l,this._rows=o,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,o){this._cols!==l&&(l>this._cols?this._reflowLarger(l,o):this._reflowSmaller(l,o))}_reflowLarger(l,o){const m=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(m.length>0){const x=(0,y.reflowLargerCreateNewLayout)(this.lines,m);(0,y.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(l,o,x.countRemoved)}}_reflowLargerAdjustViewport(l,o,m){const x=this.getNullCell(g.DEFAULT_ATTR_DATA);let v=m;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new g.BufferLine(l,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(l,o){const m=this.getNullCell(g.DEFAULT_ATTR_DATA),x=[];let v=0;for(let w=this.lines.length-1;w>=0;w--){let S=this.lines.get(w);if(!S||!S.isWrapped&&S.getTrimmedLength()<=l)continue;const C=[S];for(;S.isWrapped&&w>0;)S=this.lines.get(--w),C.unshift(S);const L=this.ybase+this.y;if(L>=w&&L<w+C.length)continue;const A=C[C.length-1].getTrimmedLength(),E=(0,y.reflowSmallerGetNewLineLengths)(C,this._cols,l),T=E.length-C.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const G=[];for(let D=0;D<T;D++){const k=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);G.push(k)}G.length>0&&(x.push({start:w+C.length+v,newLines:G}),v+=G.length),C.push(...G);let U=E.length-1,P=E[U];P===0&&(U--,P=E[U]);let F=C.length-T-1,R=A;for(;F>=0;){const D=Math.min(R,P);if(C[U]===void 0)break;if(C[U].copyCellsFrom(C[F],R-D,P-D,D,!0),P-=D,P===0&&(U--,P=E[U]),R-=D,R===0){F--;const k=Math.max(F,0);R=(0,y.getWrappedLineTrimmedLength)(C,k,this._cols)}}for(let D=0;D<C.length;D++)E[D]<l&&C[D].setCell(E[D],m);let B=T-H;for(;B-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+o-1)}if(x.length>0){const w=[],S=[];for(let U=0;U<this.lines.length;U++)S.push(this.lines.get(U));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 T=0;for(let U=Math.min(this.lines.maxLength-1,C+v-1);U>=0;U--)if(E&&E.start>L+T){for(let P=E.newLines.length-1;P>=0;P--)this.lines.set(U--,E.newLines[P]);U++,w.push({index:L+1,amount:E.newLines.length}),T+=E.newLines.length,E=x[++A]}else this.lines.set(U,S[L--]);let H=0;for(let U=w.length-1;U>=0;U--)w[U].index+=H,this.lines.onInsertEmitter.fire(w[U]),H+=w[U].amount;const G=Math.max(0,C+v-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(l,o,m=0,x){const v=this.lines.get(l);return v?v.translateToString(o,m,x):""}getWrappedRangeForLine(l){let o=l,m=l;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:o,last:m}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===l&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const o=new r.Marker(l);return this.markers.push(o),o.register(this.lines.onTrim((m=>{o.line-=m,o.line<0&&o.dispose()}))),o.register(this.lines.onInsert((m=>{o.line>=m.index&&(o.line+=m.amount)}))),o.register(this.lines.onDelete((m=>{o.line>=m.index&&o.line<m.index+m.amount&&o.dispose(),o.line>m.index&&(o.line-=m.amount)}))),o.register(o.onDispose((()=>this._removeMarker(o)))),o}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const f=u(3734),_=u(511),a=u(643),g=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let y=0;class b{constructor(r,h,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const o=h||_.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let m=0;m<r;++m)this.setCell(m,o);this.length=r}get(r){const h=this._data[3*r+0],l=2097151&h;return[this._data[3*r+1],2097152&h?this._combined[r]:l?(0,g.stringFromCodePoint)(l):"",h>>22,2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):l]}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,g.stringFromCodePoint)(2097151&h):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,h){return y=3*r,h.content=this._data[y+0],h.fg=this._data[y+1],h.bg=this._data[y+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,l,o){268435456&o.bg&&(this._extendedAttrs[r]=o.extended),this._data[3*r+0]=h|l<<22,this._data[3*r+1]=o.fg,this._data[3*r+2]=o.bg}addCodepointToCell(r,h,l){let o=this._data[3*r+0];2097152&o?this._combined[r]+=(0,g.stringFromCodePoint)(h):2097151&o?(this._combined[r]=(0,g.stringFromCodePoint)(2097151&o)+(0,g.stringFromCodePoint)(h),o&=-2097152,o|=2097152):o=h|4194304,l&&(o&=-12582913,o|=l<<22),this._data[3*r+0]=o}insertCells(r,h,l){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length-r){const o=new _.CellData;for(let m=this.length-r-h-1;m>=0;--m)this.setCell(r+h+m,this.loadCell(r+m,o));for(let m=0;m<h;++m)this.setCell(r+m,l)}else for(let o=r;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(r,h,l){if(r%=this.length,h<this.length-r){const o=new _.CellData;for(let m=0;m<this.length-r-h;++m)this.setCell(r+m,this.loadCell(r+h+m,o));for(let m=this.length-h;m<this.length;++m)this.setCell(m,l)}else for(let o=r;o<this.length;++o)this.setCell(o,l);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,l)}replaceCells(r,h,l,o=!1){if(o)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,l);r<h&&r<this.length;)this.isProtected(r)||this.setCell(r,l),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,l);r<h&&r<this.length;)this.setCell(r++,l)}resize(r,h){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<r;++o)this.setCell(o,h)}else{this._data=this._data.subarray(0,l);const o=Object.keys(this._combined);for(let x=0;x<o.length;x++){const v=parseInt(o[x],10);v>=r&&delete this._combined[v]}const m=Object.keys(this._extendedAttrs);for(let x=0;x<m.length;x++){const v=parseInt(m[x],10);v>=r&&delete this._extendedAttrs[v]}}return this.length=r,4*l*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 l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,r);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,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,l,o,m){const x=r._data;if(m)for(let w=o-1;w>=0;w--){for(let S=0;S<3;S++)this._data[3*(l+w)+S]=x[3*(h+w)+S];268435456&x[3*(h+w)+2]&&(this._extendedAttrs[l+w]=r._extendedAttrs[h+w])}else for(let w=0;w<o;w++){for(let S=0;S<3;S++)this._data[3*(l+w)+S]=x[3*(h+w)+S];268435456&x[3*(h+w)+2]&&(this._extendedAttrs[l+w]=r._extendedAttrs[h+w])}const v=Object.keys(r._combined);for(let w=0;w<v.length;w++){const S=parseInt(v[w],10);S>=h&&(this._combined[S-h+l]=r._combined[S])}}translateToString(r,h,l,o){h=h??0,l=l??this.length,r&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let m="";for(;h<l;){const x=this._data[3*h+0],v=2097151&x,w=2097152&x?this._combined[h]:v?(0,g.stringFromCodePoint)(v):a.WHITESPACE_CELL_CHAR;if(m+=w,o)for(let S=0;S<w.length;++S)o.push(h);h+=x>>22||1}return o&&o.push(h),m}}n.BufferLine=b},4841:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,f){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 f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(j,n)=>{function u(f,_,a){if(_===f.length-1)return f[_].getTrimmedLength();const g=!f[_].hasContent(a-1)&&f[_].getWidth(a-1)===1,y=f[_+1].getWidth(0)===2;return g&&y?a-1:a}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(f,_,a,g,y){const b=[];for(let c=0;c<f.length-1;c++){let r=c,h=f.get(++r);if(!h.isWrapped)continue;const l=[f.get(c)];for(;r<f.length&&h.isWrapped;)l.push(h),h=f.get(++r);if(g>=c&&g<r){c+=l.length-1;continue}let o=0,m=u(l,o,_),x=1,v=0;for(;x<l.length;){const S=u(l,x,_),C=S-v,L=a-m,A=Math.min(C,L);l[o].copyCellsFrom(l[x],v,m,A,!1),m+=A,m===a&&(o++,m=0),v+=A,v===S&&(x++,v=0),m===0&&o!==0&&l[o-1].getWidth(a-1)===2&&(l[o].copyCellsFrom(l[o-1],a-1,m++,1,!1),l[o-1].setCell(a-1,y))}l[o].replaceCells(m,a,y);let w=0;for(let S=l.length-1;S>0&&(S>o||l[S].getTrimmedLength()===0);S--)w++;w>0&&(b.push(c+l.length-w),b.push(w)),c+=l.length-1}return b},n.reflowLargerCreateNewLayout=function(f,_){const a=[];let g=0,y=_[g],b=0;for(let c=0;c<f.length;c++)if(y===c){const r=_[++g];f.onDeleteEmitter.fire({index:c-b,amount:r}),c+=r-1,b+=r,y=_[++g]}else a.push(c);return{layout:a,countRemoved:b}},n.reflowLargerApplyNewLayout=function(f,_){const a=[];for(let g=0;g<_.length;g++)a.push(f.get(_[g]));for(let g=0;g<a.length;g++)f.set(g,a[g]);f.length=_.length},n.reflowSmallerGetNewLineLengths=function(f,_,a){const g=[],y=f.map(((h,l)=>u(f,l,_))).reduce(((h,l)=>h+l));let b=0,c=0,r=0;for(;r<y;){if(y-r<a){g.push(y-r);break}b+=a;const h=u(f,c,_);b>h&&(b-=h,c++);const l=f[c].getWidth(b-1)===2;l&&b--;const o=l?a-1:a;g.push(o),r+=o}return g},n.getWrappedLineTrimmedLength=u},5295:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const f=u(8460),_=u(844),a=u(9092);class g extends _.Disposable{constructor(b,c){super(),this._optionsService=b,this._bufferService=c,this._onBufferActivate=this.register(new f.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,c){this._normal.resize(b,c),this._alt.resize(b,c),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}n.BufferSet=g},511:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const f=u(482),_=u(643),a=u(3734);class g 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 c=new g;return c.setFromCharData(b),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.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 c=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)c=!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:c=!0}else c=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(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=g},643:(j,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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const f=u(8460),_=u(844);class a{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new f.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(y){return this._disposables.push(y),y}}n.Marker=a,a._nextId=1},7116:(j,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:(j,n)=>{var u,f,_;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="Ÿ"})(f||(n.C1=f={})),(function(a){a.ST=`${u.ESC}\\`})(_||(n.C1_ESCAPED=_={}))},7399:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const f=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,g,y,b){const c={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"?c.key=g?f.C0.ESC+"OA":f.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?c.key=g?f.C0.ESC+"OD":f.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?c.key=g?f.C0.ESC+"OC":f.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(c.key=g?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:c.key=a.ctrlKey?"\b":f.C0.DEL,a.altKey&&(c.key=f.C0.ESC+c.key);break;case 9:if(a.shiftKey){c.key=f.C0.ESC+"[Z";break}c.key=f.C0.HT,c.cancel=!0;break;case 13:c.key=a.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,c.cancel=!0;break;case 27:c.key=f.C0.ESC,a.altKey&&(c.key=f.C0.ESC+f.C0.ESC),c.cancel=!0;break;case 37:if(a.metaKey)break;r?(c.key=f.C0.ESC+"[1;"+(r+1)+"D",c.key===f.C0.ESC+"[1;3D"&&(c.key=f.C0.ESC+(y?"b":"[1;5D"))):c.key=g?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(c.key=f.C0.ESC+"[1;"+(r+1)+"C",c.key===f.C0.ESC+"[1;3C"&&(c.key=f.C0.ESC+(y?"f":"[1;5C"))):c.key=g?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(c.key=f.C0.ESC+"[1;"+(r+1)+"A",y||c.key!==f.C0.ESC+"[1;3A"||(c.key=f.C0.ESC+"[1;5A")):c.key=g?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(c.key=f.C0.ESC+"[1;"+(r+1)+"B",y||c.key!==f.C0.ESC+"[1;3B"||(c.key=f.C0.ESC+"[1;5B")):c.key=g?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(c.key=f.C0.ESC+"[2~");break;case 46:c.key=r?f.C0.ESC+"[3;"+(r+1)+"~":f.C0.ESC+"[3~";break;case 36:c.key=r?f.C0.ESC+"[1;"+(r+1)+"H":g?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:c.key=r?f.C0.ESC+"[1;"+(r+1)+"F":g?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:a.shiftKey?c.type=2:a.ctrlKey?c.key=f.C0.ESC+"[5;"+(r+1)+"~":c.key=f.C0.ESC+"[5~";break;case 34:a.shiftKey?c.type=3:a.ctrlKey?c.key=f.C0.ESC+"[6;"+(r+1)+"~":c.key=f.C0.ESC+"[6~";break;case 112:c.key=r?f.C0.ESC+"[1;"+(r+1)+"P":f.C0.ESC+"OP";break;case 113:c.key=r?f.C0.ESC+"[1;"+(r+1)+"Q":f.C0.ESC+"OQ";break;case 114:c.key=r?f.C0.ESC+"[1;"+(r+1)+"R":f.C0.ESC+"OR";break;case 115:c.key=r?f.C0.ESC+"[1;"+(r+1)+"S":f.C0.ESC+"OS";break;case 116:c.key=r?f.C0.ESC+"[15;"+(r+1)+"~":f.C0.ESC+"[15~";break;case 117:c.key=r?f.C0.ESC+"[17;"+(r+1)+"~":f.C0.ESC+"[17~";break;case 118:c.key=r?f.C0.ESC+"[18;"+(r+1)+"~":f.C0.ESC+"[18~";break;case 119:c.key=r?f.C0.ESC+"[19;"+(r+1)+"~":f.C0.ESC+"[19~";break;case 120:c.key=r?f.C0.ESC+"[20;"+(r+1)+"~":f.C0.ESC+"[20~";break;case 121:c.key=r?f.C0.ESC+"[21;"+(r+1)+"~":f.C0.ESC+"[21~";break;case 122:c.key=r?f.C0.ESC+"[23;"+(r+1)+"~":f.C0.ESC+"[23~";break;case 123:c.key=r?f.C0.ESC+"[24;"+(r+1)+"~":f.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(y&&!b||!a.altKey||a.metaKey)!y||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?c.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(c.key=f.C0.US),a.key==="@"&&(c.key=f.C0.NUL)):a.keyCode===65&&(c.type=1);else{const h=_[a.keyCode],l=h==null?void 0:h[a.shiftKey?1:0];if(l)c.key=f.C0.ESC+l;else if(a.keyCode>=65&&a.keyCode<=90){const o=a.ctrlKey?a.keyCode-64:a.keyCode+32;let m=String.fromCharCode(o);a.shiftKey&&(m=m.toUpperCase()),c.key=f.C0.ESC+m}else if(a.keyCode===32)c.key=f.C0.ESC+(a.ctrlKey?f.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let o=a.code.slice(3,4);a.shiftKey||(o=o.toLowerCase()),c.key=f.C0.ESC+o,c.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?c.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?c.key=f.C0.NUL:a.keyCode>=51&&a.keyCode<=55?c.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?c.key=f.C0.DEL:a.keyCode===219?c.key=f.C0.ESC:a.keyCode===220?c.key=f.C0.FS:a.keyCode===221&&(c.key=f.C0.GS)}return c}},482:(j,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,f=0,_=u.length){let a="";for(let g=f;g<_;++g){let y=u[g];y>65535?(y-=65536,a+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):a+=String.fromCharCode(y)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const y=u.charCodeAt(g++);56320<=y&&y<=57343?f[a++]=1024*(this._interim-55296)+y-56320+65536:(f[a++]=this._interim,f[a++]=y),this._interim=0}for(let y=g;y<_;++y){const b=u.charCodeAt(y);if(55296<=b&&b<=56319){if(++y>=_)return this._interim=b,a;const c=u.charCodeAt(y);56320<=c&&c<=57343?f[a++]=1024*(b-55296)+c-56320+65536:(f[a++]=b,f[a++]=c)}else b!==65279&&(f[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const _=u.length;if(!_)return 0;let a,g,y,b,c=0,r=0,h=0;if(this.interim[0]){let m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=S-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,m=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}m||(S===2?x<128?h--:f[c++]=x:S===3?x<2048||x>=55296&&x<=57343||x===65279||(f[c++]=x):x<65536||x>1114111||(f[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(y=u[o+2])||128&(b=u[o+3]));)f[c++]=a,f[c++]=g,f[c++]=y,f[c++]=b,o+=4;if(a=u[o++],a<128)f[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}f[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&y,r<2048||r>=55296&&r<=57343||r===65279)continue;f[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=y,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&y)<<6|63&b,r<65536||r>1114111)continue;f[c++]=r}}return c}}},225:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const f=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 g;n.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let y=0;y<_.length;++y)g.fill(0,_[y][0],_[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?g[y]:(function(b,c){let r,h=0,l=c.length-1;if(b<c[0][0]||b>c[l][1])return!1;for(;l>=h;)if(r=h+l>>1,b>c[r][1])h=r+1;else{if(!(b<c[r][0]))return!0;l=r-1}return!1})(y,a)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,b){let c=this.wcwidth(y),r=c===0&&b!==0;if(r){const h=f.UnicodeService.extractWidth(b);h===0?r=!1:h>c&&(c=h)}return f.UnicodeService.createPropertyValue(0,c,r)}}},5981:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const f=u(8460),_=u(844);class a extends _.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let c;for(this._isSyncWriting=!0;c=this._writeBuffer.shift();){this._action(c);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,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+=y.length,this._writeBuffer.push(y),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(b)}_innerWrite(y=0,b=!0){const c=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],h=this._action(r,b);if(h){const o=m=>Date.now()-c>=12?setTimeout((()=>this._innerWrite(0,m))):this._innerWrite(c,m);return void h.catch((m=>(queueMicrotask((()=>{throw m})),Promise.resolve(!1)))).then(o)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-c>=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:(j,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})$/,f=/^[\da-f]+$/;function _(a,g){const y=a.toString(16),b=y.length<2?"0"+y:y;switch(g){case 4:return y[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 g=a.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const y=u.exec(g);if(y){const b=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/b*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/b*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/b*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),f.exec(g)&&[3,6,9,12].includes(g.length))){const y=g.length/3,b=[0,0,0];for(let c=0;c<3;++c){const r=parseInt(g.slice(y*c,y*c+y),16);b[c]=y===1?r<<4:y===2?r:y===3?r>>4:r>>8}return b}},n.toRgbString=function(a,g=16){const[y,b,c]=a;return`rgb:${_(y,g)}/${_(b,g)}/${_(c,g)}`}},5770:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const f=u(482),_=u(8742),a=u(5770),g=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(b,c){this._handlers[b]===void 0&&(this._handlers[b]=[]);const r=this._handlers[b];return r.push(c),{dispose:()=>{const h=r.indexOf(c);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=g,this._ident=0}hook(b,c){if(this.reset(),this._ident=b,this._active=this._handlers[b]||g,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(c);else this._handlerFb(this._ident,"HOOK",c)}put(b,c,r){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(b,c,r);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(b,c,r))}unhook(b,c=!0){if(this._active.length){let r=!1,h=this._active.length-1,l=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,r=c,l=this._stack.fallThrough,this._stack.paused=!1),!l&&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=g,this._ident=0}};const y=new _.Params;y.addParam(0),n.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=y,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():y,this._data="",this._hitLimit=!1}put(b,c,r){this._hitLimit||(this._data+=(0,f.utf32ToString)(b,c,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let c=!1;if(this._hitLimit)c=!1;else if(b&&(c=this._handler(this._data,this._params),c instanceof Promise))return c.then((r=>(this._params=y,this._data="",this._hitLimit=!1,r)));return this._params=y,this._data="",this._hitLimit=!1,c}}},2015:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const f=u(844),_=u(8742),a=u(6242),g=u(6351);class y{constructor(h){this.table=new Uint8Array(h)}setDefault(h,l){this.table.fill(h<<4|l)}add(h,l,o,m){this.table[l<<8|h]=o<<4|m}addMany(h,l,o,m){for(let x=0;x<h.length;x++)this.table[l<<8|h[x]]=o<<4|m}}n.TransitionTable=y;const b=160;n.VT500_TRANSITION_TABLE=(function(){const r=new y(4095),h=Array.apply(null,Array(256)).map(((w,S)=>S)),l=(w,S)=>h.slice(w,S),o=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));const x=l(0,14);let v;for(v in r.setDefault(1,0),r.addMany(o,0,2,0),x)r.addMany([24,26,153,154],v,3,0),r.addMany(l(128,144),v,3,0),r.addMany(l(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(m,0,3,0),r.addMany(m,1,3,1),r.add(127,1,0,1),r.addMany(m,8,0,8),r.addMany(m,3,3,3),r.add(127,3,0,3),r.addMany(m,4,3,4),r.add(127,4,0,4),r.addMany(m,6,3,6),r.addMany(m,5,3,5),r.add(127,5,0,5),r.addMany(m,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(o,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(l(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(o,7,0,7),r.addMany(m,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(l(64,127),3,7,0),r.addMany(l(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(l(48,60),4,8,4),r.addMany(l(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(l(32,64),6,0,6),r.add(127,6,0,6),r.addMany(l(64,127),6,0,0),r.addMany(l(32,48),3,9,5),r.addMany(l(32,48),5,9,5),r.addMany(l(48,64),5,0,6),r.addMany(l(64,127),5,7,0),r.addMany(l(32,48),4,9,5),r.addMany(l(32,48),1,9,2),r.addMany(l(32,48),2,9,2),r.addMany(l(48,127),2,10,0),r.addMany(l(48,80),1,10,0),r.addMany(l(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(l(96,127),1,10,0),r.add(80,1,11,9),r.addMany(m,9,0,9),r.add(127,9,0,9),r.addMany(l(28,32),9,0,9),r.addMany(l(32,48),9,9,12),r.addMany(l(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(m,11,0,11),r.addMany(l(32,128),11,0,11),r.addMany(l(28,32),11,0,11),r.addMany(m,10,0,10),r.add(127,10,0,10),r.addMany(l(28,32),10,0,10),r.addMany(l(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(l(32,48),10,9,12),r.addMany(m,12,0,12),r.add(127,12,0,12),r.addMany(l(28,32),12,0,12),r.addMany(l(32,48),12,9,12),r.addMany(l(48,64),12,0,11),r.addMany(l(64,127),12,12,13),r.addMany(l(64,127),10,12,13),r.addMany(l(64,127),9,12,13),r.addMany(m,13,13,13),r.addMany(o,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 c extends f.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=(l,o,m)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,o)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.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 g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,l=[64,126]){let o=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=h.prefix.charCodeAt(0),o&&60>o||o>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");o<<=8,o|=v}}if(h.final.length!==1)throw new Error("final must be a single byte");const m=h.final.charCodeAt(0);if(l[0]>m||m>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return o<<=8,o|=m,o}identToString(h){const l=[];for(;h;)l.push(String.fromCharCode(255&h)),h>>=8;return l.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,l){const o=this._identifier(h,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const m=this._escHandlers[o];return m.push(l),{dispose:()=>{const x=m.indexOf(l);x!==-1&&m.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,l){this._executeHandlers[h.charCodeAt(0)]=l}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,l){const o=this._identifier(h);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const m=this._csiHandlers[o];return m.push(l),{dispose:()=>{const x=m.indexOf(l);x!==-1&&m.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,l){return this._dcsParser.registerHandler(this._identifier(h),l)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,l){return this._oscParser.registerHandler(h,l)}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,l,o,m,x){this._parseStack.state=h,this._parseStack.handlers=l,this._parseStack.handlerPos=o,this._parseStack.transition=m,this._parseStack.chunkPos=x}parse(h,l,o){let m,x=0,v=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&C>-1){for(;C>=0&&(m=S[C](this._params),m!==!0);C--)if(m instanceof Promise)return this._parseStack.handlerPos=C,m}this._parseStack.handlers=[];break;case 4:if(o===!1&&C>-1){for(;C>=0&&(m=S[C](),m!==!0);C--)if(m instanceof Promise)return this._parseStack.handlerPos=C,m}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],m=this._dcsParser.unhook(x!==24&&x!==26,o),m)return m;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],m=this._oscParser.end(x!==24&&x!==26,o),m)return m;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=w;S<l;++S){switch(x=h[S],v=this._transitions.table[this.currentState<<8|(x<160?x:b)],v>>4){case 2:for(let T=S+1;;++T){if(T>=l||(x=h[T])<32||x>126&&x<b){this._printHandler(h,S,T),S=T-1;break}if(++T>=l||(x=h[T])<32||x>126&&x<b){this._printHandler(h,S,T),S=T-1;break}if(++T>=l||(x=h[T])<32||x>126&&x<b){this._printHandler(h,S,T),S=T-1;break}if(++T>=l||(x=h[T])<32||x>126&&x<b){this._printHandler(h,S,T),S=T-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:S,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&&(m=C[L](this._params),m!==!0);L--)if(m instanceof Promise)return this._preserveStack(3,C,L,v,S),m;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(++S<l&&(x=h[S])>47&&x<60);S--;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&&(m=A[E](),m!==!0);E--)if(m instanceof Promise)return this._preserveStack(4,A,E,v,S),m;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 T=S+1;;++T)if(T>=l||(x=h[T])===24||x===26||x===27||x>127&&x<b){this._dcsParser.put(h,S,T),S=T-1;break}break;case 14:if(m=this._dcsParser.unhook(x!==24&&x!==26),m)return this._preserveStack(6,[],0,v,S),m;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 T=S+1;;T++)if(T>=l||(x=h[T])<32||x>127&&x<b){this._oscParser.put(h,S,T),S=T-1;break}break;case 6:if(m=this._oscParser.end(x!==24&&x!==26),m)return this._preserveStack(5,[],0,v,S),m;x===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&v}}}n.EscapeSequenceParser=c},6242:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const f=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(g,y){this._handlers[g]===void 0&&(this._handlers[g]=[]);const b=this._handlers[g];return b.push(y),{dispose:()=>{const c=b.indexOf(y);c!==-1&&b.splice(c,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].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 g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,y,b){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(g,y,b);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(g,y,b))}start(){this.reset(),this._state=1}put(g,y,b){if(this._state!==3){if(this._state===1)for(;y<b;){const c=g[y++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&b-y>0&&this._put(g,y,b)}}end(g,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,c=this._active.length-1,r=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,b=y,r=this._stack.fallThrough,this._stack.paused=!1),!r&&b===!1){for(;c>=0&&(b=this._active[c].end(g),b!==!0);c--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,b;c--}for(;c>=0;c--)if(b=this._active[c].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",g);this._active=a,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,y,b){this._hitLimit||(this._data+=(0,_.utf32ToString)(g,y,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let y=!1;if(this._hitLimit)y=!1;else if(g&&(y=this._handler(this._data),y instanceof Promise))return y.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,y}}},8742:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class f{static fromArray(a){const g=new f;if(!a.length)return g;for(let y=Array.isArray(a[0])?1:0;y<a.length;++y){const b=a[y];if(Array.isArray(b))for(let c=0;c<b.length;++c)g.addSubParam(b[c]);else g.addParam(b)}return g}constructor(a=32,g=32){if(this.maxLength=a,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new f(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 g=0;g<this.length;++g){a.push(this.params[g]);const y=this._subParamsIdx[g]>>8,b=255&this._subParamsIdx[g];b-y>0&&a.push(Array.prototype.slice.call(this._subParams,y,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 g=this._subParamsIdx[a]>>8,y=255&this._subParamsIdx[a];return y-g>0?this._subParams.subarray(g,y):null}getSubParamsAll(){const a={};for(let g=0;g<this.length;++g){const y=this._subParamsIdx[g]>>8,b=255&this._subParamsIdx[g];b-y>0&&(a[g]=this._subParams.slice(y,b))}return a}addDigit(a){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,b=y[g-1];y[g-1]=~b?Math.min(10*b+a,u):a}}n.Params=f},5741:(j,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,f){const _={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(_),f.dispose=()=>this._wrappedAddonDispose(_),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===u){f=_;break}if(f===-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(f,1)}}},8771:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const f=u(3785),_=u(511);n.BufferApiView=class{constructor(a,g){this._buffer=a,this.type=g}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 g=this._buffer.lines.get(a);if(g)return new f.BufferLineApiView(g)}getNullCell(){return new _.CellData}}},3785:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const f=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 f.CellData)}translateToString(_,a,g){return this._line.translateToString(_,a,g)}}},8285:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const f=u(8771),_=u(8460),a=u(844);class g extends a.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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=g},7975:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,(_=>f(_.toArray())))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,((_,a)=>f(_,a.toArray())))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(j,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(j,n,u){var f=this&&this.__decorate||function(r,h,l,o){var m,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(v=(x<3?m(v):x>3?m(h,l,v):m(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const a=u(8460),g=u(844),y=u(5295),b=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let c=n.BufferService=class extends g.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 y.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 l=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===r.fg&&o.getBg(0)===r.bg||(o=l.getBlankLine(r,h),this._cachedBlankLine=o),o.isWrapped=h;const m=l.ybase+l.scrollTop,x=l.ybase+l.scrollBottom;if(l.scrollTop===0){const v=l.lines.isFull;x===l.lines.length-1?v?l.lines.recycle().copyFrom(o):l.lines.push(o.clone()):l.lines.splice(x+1,0,o.clone()),v?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const v=x-m+1;l.lines.shiftElements(m+1,v-1,-1),l.lines.set(x,o.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(r,h,l){const o=this.buffer;if(r<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else r+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const m=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+r,o.ybase),0),m!==o.ydisp&&(h||this._onScroll.fire(o.ydisp))}};n.BufferService=c=f([_(0,b.IOptionsService)],c)},7994:(j,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,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(j,n,u){var f=this&&this.__decorate||function(o,m,x,v){var w,S=arguments.length,C=S<3?m:v===null?v=Object.getOwnPropertyDescriptor(m,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(o,m,x,v);else for(var L=o.length-1;L>=0;L--)(w=o[L])&&(C=(S<3?w(C):S>3?w(m,x,C):w(m,x))||C);return S>3&&C&&Object.defineProperty(m,x,C),C},_=this&&this.__param||function(o,m){return function(x,v){m(x,v,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const a=u(2585),g=u(8460),y=u(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function c(o,m){let x=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(x|=64,x|=o.action):(x|=3&o.button,4&o.button&&(x|=64),8&o.button&&(x|=128),o.action===32?x|=32:o.action!==0||m||(x|=3)),x}const r=String.fromCharCode,h={DEFAULT:o=>{const m=[c(o,!1)+32,o.col+32,o.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${r(m[0])}${r(m[1])}${r(m[2])}`},SGR:o=>{const m=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${c(o,!0)};${o.col};${o.row}${m}`},SGR_PIXELS:o=>{const m=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${c(o,!0)};${o.x};${o.y}${m}`}};let l=n.CoreMouseService=class extends y.Disposable{constructor(o,m){super(),this._bufferService=o,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.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(o,m){this._protocols[o]=m}addEncoding(o,m){this._encodings[o]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const m=this._encodings[this._activeEncoding](o);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,m,x){if(x){if(o.x!==m.x||o.y!==m.y)return!1}else if(o.col!==m.col||o.row!==m.row)return!1;return o.button===m.button&&o.action===m.action&&o.ctrl===m.ctrl&&o.alt===m.alt&&o.shift===m.shift}};n.CoreMouseService=l=f([_(0,a.IBufferService),_(1,a.ICoreService)],l)},6975:function(j,n,u){var f=this&&this.__decorate||function(l,o,m,x){var v,w=arguments.length,S=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,o,m,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(S=(w<3?v(S):w>3?v(o,m,S):v(o,m))||S);return w>3&&S&&Object.defineProperty(o,m,S),S},_=this&&this.__param||function(l,o){return function(m,x){o(m,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const a=u(1439),g=u(8460),y=u(844),b=u(2585),c=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 y.Disposable{constructor(l,o,m){super(),this._bufferService=l,this._logService=o,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(l,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((o=>o.charCodeAt(0))))),this._onBinary.fire(l))}};n.CoreService=h=f([_(0,b.IBufferService),_(1,b.ILogService),_(2,b.IOptionsService)],h)},9074:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const f=u(8055),_=u(8460),a=u(844),g=u(6106);let y=0,b=0;class c extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((l=>l==null?void 0:l.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(l){if(l.marker.isDisposed)return;const o=new r(l);if(o){const m=o.marker.onDispose((()=>o.dispose()));o.onDispose((()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),m.dispose())})),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,o,m){let x=0,v=0;for(const w of this._decorations.getKeyIterator(o))x=w.options.x??0,v=x+(w.options.width??1),l>=x&&l<v&&(!m||(w.options.layer??"bottom")===m)&&(yield w)}forEachDecorationAtCell(l,o,m,x){this._decorations.forEachByKey(o,(v=>{y=v.options.x??0,b=y+(v.options.width??1),l>=y&&l<b&&(!m||(v.options.layer??"bottom")===m)&&x(v)}))}}n.DecorationService=c;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,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=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const f=u(2585),_=u(8343);class a{constructor(...y){this._entries=new Map;for(const[b,c]of y)this.set(b,c)}set(y,b){const c=this._entries.get(y);return this._entries.set(y,b),c}forEach(y){for(const[b,c]of this._entries.entries())y(b,c)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}n.ServiceCollection=a,n.InstantiationService=class{constructor(){this._services=new a,this._services.set(f.IInstantiationService,this)}setService(g,y){this._services.set(g,y)}getService(g){return this._services.get(g)}createInstance(g,...y){const b=(0,_.getServiceDependencies)(g).sort(((h,l)=>h.index-l.index)),c=[];for(const h of b){const l=this._services.get(h.id);if(!l)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);c.push(l)}const r=b.length>0?b[0].index:y.length;if(y.length!==r)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${r+1} conflicts with ${y.length} static arguments`);return new g(...y,...c)}}},7866:function(j,n,u){var f=this&&this.__decorate||function(r,h,l,o){var m,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(v=(x<3?m(v):x>3?m(h,l,v):m(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(844),g=u(2585),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let b,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=y[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,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=f([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...m){if(b.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,m);b.trace(`GlyphRenderer#${o.name}(${m.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,m);return b.trace(`GlyphRenderer#${o.name} return`,x),x}}},7302:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const f=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 g=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends _.Disposable{constructor(c){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const h in c)if(h in r)try{const l=c[h];r[h]=this._sanitizeAndValidateOption(h,l)}catch(l){console.error(l)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(c,r){return this.onOptionChange((h=>{h===c&&r(this.rawOptions[c])}))}onMultipleOptionChange(c,r){return this.onOptionChange((h=>{c.indexOf(h)!==-1&&r()}))}_setupOptions(){const c=h=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},r=(h,l)=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);l=this._sanitizeAndValidateOption(h,l),this.rawOptions[h]!==l&&(this.rawOptions[h]=l,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const l={get:c.bind(this,h),set:r.bind(this,h)};Object.defineProperty(this.options,h,l)}}_sanitizeAndValidateOption(c,r){switch(c){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[c]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${c}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[c]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=g.includes(r)?r:n.DEFAULT_OPTIONS[c];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${c} 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(`${c} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${c} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${c} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=y},2660:function(j,n,u){var f=this&&this.__decorate||function(y,b,c,r){var h,l=arguments.length,o=l<3?b:r===null?r=Object.getOwnPropertyDescriptor(b,c):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(y,b,c,r);else for(var m=y.length-1;m>=0;m--)(h=y[m])&&(o=(l<3?h(o):l>3?h(b,c,o):h(b,c))||o);return l>3&&o&&Object.defineProperty(b,c,o),o},_=this&&this.__param||function(y,b){return function(c,r){b(c,r,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const a=u(2585);let g=n.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const b=this._bufferService.buffer;if(y.id===void 0){const m=b.addMarker(b.ybase+b.y),x={data:y,id:this._nextId++,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(x,m))),this._dataByLinkId.set(x.id,x),x.id}const c=y,r=this._getEntryIdKey(c),h=this._entriesWithId.get(r);if(h)return this.addLineToLink(h.id,b.ybase+b.y),h.id;const l=b.addMarker(b.ybase+b.y),o={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(o,l))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(y,b){const c=this._dataByLinkId.get(y);if(c&&c.lines.every((r=>r.line!==b))){const r=this._bufferService.buffer.addMarker(b);c.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(c,r)))}}getLinkData(y){var b;return(b=this._dataByLinkId.get(y))==null?void 0:b.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,b){const c=y.lines.indexOf(b);c!==-1&&(y.lines.splice(c,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};n.OscLinkService=g=f([_(0,a.IBufferService)],g)},8343:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",f="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[f]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,y,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[f].push({id:c,index:h}):(r[f]=[{id:c,index:h}],r[u]=r)})(a,g,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},2585:(j,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 f=u(8343);var _;n.IBufferService=(0,f.createDecorator)("BufferService"),n.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),n.ICoreService=(0,f.createDecorator)("CoreService"),n.ICharsetService=(0,f.createDecorator)("CharsetService"),n.IInstantiationService=(0,f.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,f.createDecorator)("LogService"),n.IOptionsService=(0,f.createDecorator)("OptionsService"),n.IOscLinkService=(0,f.createDecorator)("OscLinkService"),n.IUnicodeService=(0,f.createDecorator)("UnicodeService"),n.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const f=u(8460),_=u(225);class a{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,b,c=!1){return(16777215&y)<<3|(3&b)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const y=new _.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let b=0,c=0;const r=y.length;for(let h=0;h<r;++h){let l=y.charCodeAt(h);if(55296<=l&&l<=56319){if(++h>=r)return b+this.wcwidth(l);const x=y.charCodeAt(h);56320<=x&&x<=57343?l=1024*(l-55296)+x-56320+65536:b+=this.wcwidth(x)}const o=this.charProperties(l,c);let m=a.extractWidth(o);a.extractShouldJoin(o)&&(m-=a.extractWidth(c)),b+=m,c=o}return b}charProperties(y,b){return this._activeProvider.charProperties(y,b)}}n.UnicodeService=a}},O={};function te(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return $[j].call(u.exports,u,u.exports,te),u.exports}var ne={};return(()=>{var j=ne;Object.defineProperty(j,"__esModule",{value:!0}),j.Terminal=void 0;const n=te(9042),u=te(3236),f=te(844),_=te(5741),a=te(8285),g=te(7975),y=te(7090),b=["cols","rows"];class c extends f.Disposable{constructor(h){super(),this._core=this.register(new u.Terminal(h)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const l=m=>this._core.options[m],o=(m,x)=>{this._checkReadonlyOptions(m),this._core.options[m]=x};for(const m in this._core.options){const x={get:l.bind(this,m),set:o.bind(this,m)};Object.defineProperty(this._publicOptions,m,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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const l in h)this._publicOptions[l]=h[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,l=!0){this._core.input(h,l)}resize(h,l){this._verifyIntegers(h,l),this._core.resize(h,l)}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,l,o){this._verifyIntegers(h,l,o),this._core.select(h,l,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,l){this._verifyIntegers(h,l),this._core.selectLines(h,l)}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,l){this._core.write(h,l)}writeln(h,l){this._core.write(h),this._core.write(`\r
57
+ `,l)}paste(h){this._core.paste(h)}refresh(h,l){this._verifyIntegers(h,l),this._core.refresh(h,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return n}_verifyIntegers(...h){for(const l of h)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const l of h)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}j.Terminal=c})(),ne})()))})(Ol)),Ol.exports}var tg=eg(),kl={exports:{}},Vd;function ig(){return Vd||(Vd=1,(function(I,W){(function($,O){I.exports=O()})(self,(()=>(()=>{var $={};return(()=>{var O=$;Object.defineProperty(O,"__esModule",{value:!0}),O.FitAddon=void 0,O.FitAddon=class{activate(te){this._terminal=te}dispose(){}fit(){const te=this.proposeDimensions();if(!te||!this._terminal||isNaN(te.cols)||isNaN(te.rows))return;const ne=this._terminal._core;this._terminal.rows===te.rows&&this._terminal.cols===te.cols||(ne._renderService.clear(),this._terminal.resize(te.cols,te.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const te=this._terminal._core,ne=te._renderService.dimensions;if(ne.css.cell.width===0||ne.css.cell.height===0)return;const j=this._terminal.options.scrollback===0?0:te.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(n.getPropertyValue("height")),f=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),a=u-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),g=f-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-j;return{cols:Math.max(2,Math.floor(g/ne.css.cell.width)),rows:Math.max(1,Math.floor(a/ne.css.cell.height))}}}})(),$})()))})(kl)),kl.exports}var sg=ig(),Hl={exports:{}},Kd;function rg(){return Kd||(Kd=1,(function(I,W){(function($,O){I.exports=O()})(self,(()=>(()=>{var $={965:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const f=u(374),_=u(509),a=u(855),g=u(859),y=u(381),b=11,c=b*Float32Array.BYTES_PER_ELEMENT;let r,h=0,l=0,o=0;class m extends g.Disposable{constructor(v,w,S,C){super(),this._terminal=v,this._gl=w,this._dimensions=S,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,f.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,f.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,f.throwIfFalsy)((0,y.createProgram)(L,`#version 300 es
58
+ layout (location = 0) in vec2 a_unitquad;
59
+ layout (location = 1) in vec2 a_cellpos;
60
+ layout (location = 2) in vec2 a_offset;
61
+ layout (location = 3) in vec2 a_size;
62
+ layout (location = 4) in float a_texpage;
63
+ layout (location = 5) in vec2 a_texcoord;
64
+ layout (location = 6) in vec2 a_texsize;
65
+
66
+ uniform mat4 u_projection;
67
+ uniform vec2 u_resolution;
68
+
69
+ out vec2 v_texcoord;
70
+ flat out int v_texpage;
71
+
72
+ void main() {
73
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
74
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
75
+ v_texpage = int(a_texpage);
76
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
77
+ }`,(function(U){let P="";for(let F=1;F<U;F++)P+=` else if (v_texpage == ${F}) { outColor = texture(u_texture[${F}], v_texcoord); }`;return`#version 300 es
78
+ precision lowp float;
79
+
80
+ in vec2 v_texcoord;
81
+ flat in int v_texpage;
82
+
83
+ uniform sampler2D u_texture[${U}];
84
+
85
+ out vec4 outColor;
86
+
87
+ void main() {
88
+ if (v_texpage == 0) {
89
+ outColor = texture(u_texture[0], v_texcoord);
90
+ } ${P}
91
+ }`})(_.TextureAtlas.maxAtlasPages))),this.register((0,g.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,f.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,f.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,f.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,g.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 T=new Uint8Array([0,1,2,3]),H=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(H)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,H),L.bufferData(L.ELEMENT_ARRAY_BUFFER,T,L.STATIC_DRAW),this._attributesBuffer=(0,f.throwIfFalsy)(L.createBuffer()),this.register((0,g.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,c,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,c,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,c,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,c,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,c,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,c,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const G=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++)G[U]=U;L.uniform1iv(this._textureLocation,G),L.uniformMatrix4fv(this._projectionLocation,!1,y.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++){const P=new y.GLTexture((0,f.throwIfFalsy)(L.createTexture()));this.register((0,g.toDisposable)((()=>L.deleteTexture(P.texture)))),L.activeTexture(L.TEXTURE0+U),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[U]=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,w,S,C,L,A,E,T,H){this._updateCell(this._vertices.attributes,v,w,S,C,L,A,E,T,H)}_updateCell(v,w,S,C,L,A,E,T,H,G){h=(S*this._terminal.cols+w)*b,C!==a.NULL_CELL_CODE&&C!==void 0?this._atlas&&(r=T&&T.length>1?this._atlas.getRasterizedGlyphCombinedChar(T,L,A,E,!1):this._atlas.getRasterizedGlyph(C,L,A,E,!1),l=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==G&&r.offset.x>l?(o=r.offset.x-l,v[h]=-(r.offset.x-o)+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=(r.size.x-o)/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+o/this._atlas.pages[r.texturePage].canvas.width,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x-o/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,f.allowRescaling)(C,H,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,w=v.cols*v.rows*b;this._vertices.count!==w?this._vertices.attributes=new Float32Array(w):this._vertices.attributes.fill(0);let S=0;for(;S<this._vertices.attributesBuffers.length;S++)this._vertices.count!==w?this._vertices.attributesBuffers[S]=new Float32Array(w):this._vertices.attributesBuffers[S].fill(0);this._vertices.count=w,S=0;for(let C=0;C<v.rows;C++)for(let L=0;L<v.cols;L++)this._vertices.attributes[S+9]=L/v.cols,this._vertices.attributes[S+10]=C/v.rows,S+=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 w=this._gl;w.useProgram(this._program),w.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const S=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);S.set(E,C),C+=E.length}w.bindBuffer(w.ARRAY_BUFFER,this._attributesBuffer),w.bufferData(w.ARRAY_BUFFER,S.subarray(0,C),w.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(w,this._atlas,L);w.drawElementsInstanced(w.TRIANGLE_STRIP,4,w.UNSIGNED_BYTE,0,C/b)}setAtlas(v){this._atlas=v;for(const w of this._atlasTextures)w.version=-1}_bindAtlasPageTexture(v,w,S){v.activeTexture(v.TEXTURE0+S),v.bindTexture(v.TEXTURE_2D,this._atlasTextures[S].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,w.pages[S].canvas),v.generateMipmap(v.TEXTURE_2D),this._atlasTextures[S].version=w.pages[S].version}setDimensions(v){this._dimensions=v}}n.GlyphRenderer=m},742:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const f=u(374),_=u(859),a=u(310),g=u(381),y=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let c=0,r=0,h=0,l=0,o=0,m=0,x=0;class v extends _.Disposable{constructor(S,C,L,A){super(),this._terminal=S,this._gl=C,this._dimensions=L,this._themeService=A,this._vertices=new b,this._verticesCursor=new b;const E=this._gl;this._program=(0,f.throwIfFalsy)((0,g.createProgram)(E,`#version 300 es
92
+ layout (location = 0) in vec2 a_position;
93
+ layout (location = 1) in vec2 a_size;
94
+ layout (location = 2) in vec4 a_color;
95
+ layout (location = 3) in vec2 a_unitquad;
96
+
97
+ uniform mat4 u_projection;
98
+
99
+ out vec4 v_color;
100
+
101
+ void main() {
102
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
103
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
104
+ v_color = a_color;
105
+ }`,`#version 300 es
106
+ precision lowp float;
107
+
108
+ in vec4 v_color;
109
+
110
+ out vec4 outColor;
111
+
112
+ void main() {
113
+ outColor = v_color;
114
+ }`)),this.register((0,_.toDisposable)((()=>E.deleteProgram(this._program)))),this._projectionLocation=(0,f.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const T=new Float32Array([0,0,1,0,0,1,1,1]),H=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(H)))),E.bindBuffer(E.ARRAY_BUFFER,H),E.bufferData(E.ARRAY_BUFFER,T,E.STATIC_DRAW),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const G=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,G,E.STATIC_DRAW),this._attributesBuffer=(0,f.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,y,0),E.vertexAttribDivisor(0,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,y,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,4,E.FLOAT,!1,y,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(S){const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),C.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,S.attributes,C.DYNAMIC_DRAW),C.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,C.UNSIGNED_BYTE,0,S.count)}handleResize(){this._updateViewportRectangle()}setDimensions(S){this._dimensions=S}_updateCachedColors(S){this._bgFloat=this._colorToFloat32Array(S.background),this._cursorFloat=this._colorToFloat32Array(S.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(S){const C=this._terminal,L=this._vertices;let A,E,T,H,G,U,P,F,R,B,D,k=1;for(A=0;A<C.rows;A++){for(T=-1,H=0,G=0,U=!1,E=0;E<C.cols;E++)P=(A*C.cols+E)*a.RENDER_MODEL_INDICIES_PER_CELL,F=S.cells[P+a.RENDER_MODEL_BG_OFFSET],R=S.cells[P+a.RENDER_MODEL_FG_OFFSET],B=!!(67108864&R),(F!==H||R!==G&&(U||B))&&((H!==0||U&&G!==0)&&(D=8*k++,this._updateRectangle(L,D,G,H,T,E,A)),T=E,H=F,G=R,U=B);(H!==0||U&&G!==0)&&(D=8*k++,this._updateRectangle(L,D,G,H,T,C.cols,A))}L.count=k}updateCursor(S){const C=this._verticesCursor,L=S.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(S,C,L,A,E,T,H){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:c=(16777215&L)<<8;break;default:c=this._themeService.colors.foreground.rgba}else switch(50331648&A){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&A].rgba;break;case 50331648:c=(16777215&A)<<8;break;default:c=this._themeService.colors.background.rgba}S.attributes.length<C+4&&(S.attributes=(0,g.expandFloat32Array)(S.attributes,this._terminal.rows*this._terminal.cols*8)),r=E*this._dimensions.device.cell.width,h=H*this._dimensions.device.cell.height,l=(c>>24&255)/255,o=(c>>16&255)/255,m=(c>>8&255)/255,x=1,this._addRectangle(S.attributes,C,r,h,(T-E)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,o,m,x)}_addRectangle(S,C,L,A,E,T,H,G,U,P){S[C]=L/this._dimensions.device.canvas.width,S[C+1]=A/this._dimensions.device.canvas.height,S[C+2]=E/this._dimensions.device.canvas.width,S[C+3]=T/this._dimensions.device.canvas.height,S[C+4]=H,S[C+5]=G,S[C+6]=U,S[C+7]=P}_addRectangleFloat(S,C,L,A,E,T,H){S[C]=L/this._dimensions.device.canvas.width,S[C+1]=A/this._dimensions.device.canvas.height,S[C+2]=E/this._dimensions.device.canvas.width,S[C+3]=T/this._dimensions.device.canvas.height,S[C+4]=H[0],S[C+5]=H[1],S[C+6]=H[2],S[C+7]=H[3]}_colorToFloat32Array(S){return new Float32Array([(S.rgba>>24&255)/255,(S.rgba>>16&255)/255,(S.rgba>>8&255)/255,(255&S.rgba)/255])}}n.RectangleRenderer=v},310:(j,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 f=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,f.createSelectionRenderModel)()}resize(_,a){const g=_*a*n.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const f=u(820),_=u(274),a=u(627),g=u(457),y=u(56),b=u(374),c=u(345),r=u(859),h=u(147),l=u(782),o=u(855),m=u(965),x=u(742),v=u(310),w=u(733);class S extends r.Disposable{constructor(E,T,H,G,U,P,F,R,B){super(),this._terminal=E,this._characterJoinerService=T,this._charSizeService=H,this._coreBrowserService=G,this._coreService=U,this._decorationService=P,this._optionsService=F,this._themeService=R,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 l.CellData,this._workCell2=new l.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new c.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new c.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new c.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new c.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new c.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 w.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,F,this._themeService)],this.dimensions=(0,b.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(F.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const D={antialias:!1,depth:!1,preserveDrawingBuffer:B};if(this._gl=this._canvas.getContext("webgl2",D),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,f.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,f.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,y.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((k,Y)=>this._setCanvasDevicePixelDimensions(k,Y))),this.register(this._coreBrowserService.onWindowChange((k=>{this._observerDisposable.value=(0,y.observeDevicePixelDimensions)(this._canvas,k,((Y,V)=>this._setCanvasDevicePixelDimensions(Y,V)))}))),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 Y of this._renderLayers)Y.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,T){var H,G,U,P;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const F of this._renderLayers)F.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`,(H=this._rectangleRenderer.value)==null||H.setDimensions(this.dimensions),(G=this._rectangleRenderer.value)==null||G.handleResize(),(U=this._glyphRenderer.value)==null||U.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 T of this._renderLayers)T.handleBlur(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.pause(),this._requestRedrawViewport()}handleFocus(){var E;for(const T of this._renderLayers)T.handleFocus(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.resume(),this._requestRedrawViewport()}handleSelectionChanged(E,T,H){for(const G of this._renderLayers)G.handleSelectionChanged(this._terminal,E,T,H);this._model.selection.update(this._core,E,T,H),this._requestRedrawViewport()}handleCursorMove(){var E;for(const T of this._renderLayers)T.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 m.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var T;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,c.forwardEvent)(E.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,c.forwardEvent)(E.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=E,this._charAtlas.warmUp(),(T=this._glyphRenderer.value)==null||T.setAtlas(this._charAtlas)}_clearModel(E){var T;this._model.clear(),E&&((T=this._glyphRenderer.value)==null||T.clear())}clearTextureAtlas(){var E;(E=this._charAtlas)==null||E.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var E;this._clearModel(!0);for(const T of this._renderLayers)T.reset(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(E){return-1}deregisterCharacterJoiner(E){return!1}renderRows(E,T){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 H of this._renderLayers)H.handleGridChanged(this._terminal,E,T);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(E,T),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 g.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(E,T){const H=this._core;let G,U,P,F,R,B,D,k,Y,V,le,ce,q,N,J=this._workCell;E=L(E,H.rows-1,0),T=L(T,H.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=ee-H.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,H.cols-1);let Me=-1;const ve=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<=T;U++)for(P=U+H.buffer.ydisp,F=H.buffer.lines.get(P),this._model.lineLengths[U]=0,R=this._characterJoinerService.getJoinedCharacters(P),q=0;q<H.cols;q++)if(G=this._cellColorResolver.result.bg,F.loadCell(q,J),q===0&&(G=this._cellColorResolver.result.bg),B=!1,D=q,R.length>0&&q===R[0][0]&&(B=!0,k=R.shift(),J=new C(J,F.translateToString(!0,k[0],k[1]),k[1]-k[0]),D=k[1]-1),Y=J.getChars(),V=J.getCode(),ce=(U*H.cols+q)*v.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(J,q,P,this.dimensions.device.cell.width),ve&&P===ee&&(q===fe&&(this._model.cursor={x:fe,y:_e,width:J.getWidth(),style:this._coreBrowserService.isFocused?H.options.cursorStyle||"block":H.options.cursorInactiveStyle,cursorWidth:H.options.cursorWidth,dpr:this._devicePixelRatio},Me=fe+J.getWidth()-1),q>=fe&&q<=Me&&(this._coreBrowserService.isFocused&&(H.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&H.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)),V!==o.NULL_CELL_CODE&&(this._model.lineLengths[U]=q+1),(this._model.cells[ce]!==V||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,Y.length>1&&(V|=v.COMBINED_CHAR_BIT_MASK),this._model.cells[ce]=V,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,le=J.getWidth(),this._glyphRenderer.value.updateCell(q,U,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Y,le,G),B))for(J=this._workCell,q++;q<D;q++)N=(U*H.cols+q)*v.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(q,U,o.NULL_CELL_CODE,0,0,0,o.NULL_CELL_CHAR,0,0),this._model.cells[N]=o.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,T){this._canvas.width===E&&this._canvas.height===T||(this._canvas.width=E,this._canvas.height=T,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=S;class C extends h.AttributeData{constructor(E,T,H){super(),this.content=0,this.combinedData="",this.fg=E.fg,this.bg=E.bg,this.combinedData=T,this._width=H}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,T=0){return Math.max(Math.min(A,E),T)}n.JoinedCellData=C},381:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const f=u(374);function _(a,g,y){const b=(0,f.throwIfFalsy)(a.createShader(g));if(a.shaderSource(b,y),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,g,y){const b=(0,f.throwIfFalsy)(a.createProgram());if(a.attachShader(b,(0,f.throwIfFalsy)(_(a,a.VERTEX_SHADER,g))),a.attachShader(b,(0,f.throwIfFalsy)(_(a,a.FRAGMENT_SHADER,y))),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,g){const y=Math.min(2*a.length,g),b=new Float32Array(y);for(let c=0;c<a.length;c++)b[c]=a[c];return b},n.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const f=u(627),_=u(237),a=u(374),g=u(859);class y extends g.Disposable{constructor(c,r,h,l,o,m,x,v){super(),this._container=r,this._alpha=o,this._coreBrowserService=m,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=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((w=>{this._refreshCharAtlas(c,w),this.reset(c)}))),this.register((0,g.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(c){}handleFocus(c){}handleCursorMove(c){}handleGridChanged(c,r,h){}handleSelectionChanged(c,r,h,l=!1){}_setTransparency(c,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(c,this._themeService.colors),this.handleGridChanged(c,0,c.rows-1)}_refreshCharAtlas(c,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,f.acquireTextureAtlas)(c,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(c,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(c,this._themeService.colors)}_fillBottomLineAtCells(c,r,h=1){this._ctx.fillRect(c*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(c,r,h,l){this._alpha?this._ctx.clearRect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(c,r,h,l){this._ctx.font=this._getFont(c,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(h,l,r.getWidth()),this._ctx.fillText(r.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(c,r,h){this._ctx.beginPath(),this._ctx.rect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(c,r,h){return`${h?"italic":""} ${r?c.options.fontWeightBold:c.options.fontWeight} ${c.options.fontSize*this._coreBrowserService.dpr}px ${c.options.fontFamily}`}}n.BaseRenderLayer=y},733:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const f=u(197),_=u(237),a=u(592);class g extends a.BaseRenderLayer{constructor(b,c,r,h,l,o,m){super(r,b,"link",c,!0,l,o,m),this.register(h.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(h.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(b,c){super.resize(b,c),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,f.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 c=b.y1+1;c<b.y2;c++)this._fillBottomLineAtCells(0,c,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=g},820:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,f,_,a){u.addEventListener(f,_,a);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(f,_,a))}}}},274:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const f=u(855),_=u(160),a=u(374);let g,y=0,b=0,c=!1,r=!1,h=!1,l=0;n.CellColorResolver=class{constructor(o,m,x,v,w,S){this._terminal=o,this._optionService=m,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=w,this._themeService=S,this.result={fg:0,bg:0,ext:0}}resolve(o,m,x,v){if(this.result.bg=o.bg,this.result.fg=o.fg,this.result.ext=268435456&o.bg?o.extended.ext:0,b=0,y=0,r=!1,c=!1,h=!1,g=this._themeService.colors,l=0,o.getCode()!==f.NULL_CELL_CODE&&o.extended.underlineStyle===4){const w=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=m*v%(2*Math.round(w))}if(this._decorationService.forEachDecorationAtCell(m,x,"bottom",(w=>{w.backgroundColorRGB&&(b=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(y=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,m,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?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,g.selectionForeground&&(y=g.selectionForeground.rgba>>8&16777215,c=!0),(0,a.treatGlyphAsBackgroundColor)(o.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)y=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}y=_.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}c=!0}}this._decorationService.forEachDecorationAtCell(m,x,"top",(w=>{w.backgroundColorRGB&&(b=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(y=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),r&&(b=h?-16777216&o.bg&-134217729|b|50331648:-16777216&o.bg|b|50331648),c&&(y=-16777216&o.fg&-67108865|y|50331648),67108864&this.result.fg&&(r&&!c&&(y=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,c=!0),!r&&c&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),g=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=c?y:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const f=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(g,y,b,c,r,h,l,o){const m=(0,_.generateConfig)(c,r,h,l,y,b,o);for(let w=0;w<a.length;w++){const S=a[w],C=S.ownedBy.indexOf(g);if(C>=0){if((0,_.configEquals)(S.config,m))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),a.splice(w,1)):S.ownedBy.splice(C,1);break}}for(let w=0;w<a.length;w++){const S=a[w];if((0,_.configEquals)(S.config,m))return S.ownedBy.push(g),S.atlas}const x=g._core,v={atlas:new f.TextureAtlas(document,m,x.unicodeService),config:m,ownedBy:[g]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(g){for(let y=0;y<a.length;y++){const b=a[y].ownedBy.indexOf(g);if(b!==-1){a[y].ownedBy.length===1?(a[y].atlas.dispose(),a.splice(y,1)):a[y].ownedBy.splice(b,1);break}}}},197:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const f=u(160);n.generateConfig=function(_,a,g,y,b,c,r){const h={foreground:c.foreground,background:c.background,cursor:f.NULL_COLOR,cursorAccent:f.NULL_COLOR,selectionForeground:f.NULL_COLOR,selectionBackgroundTransparent:f.NULL_COLOR,selectionBackgroundOpaque:f.NULL_COLOR,selectionInactiveBackgroundTransparent:f.NULL_COLOR,selectionInactiveBackgroundOpaque:f.NULL_COLOR,ansi:c.ansi.slice(),contrastCache:c.contrastCache,halfContrastCache:c.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:g,deviceCharHeight:y,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 g=0;g<_.colors.ansi.length;g++)if(_.colors.ansi[g].rgba!==a.colors.ansi[g].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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const f=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},457:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,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 f=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,f>0)return void this._restartInterval(f)}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 f=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(f)}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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const f=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:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╒":{1:(c,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(c,r)=>`M${.5-c},1 L${.5-c},.5 L1,.5 M${.5+c},.5 L${.5+c},1`},"╔":{1:(c,r)=>`M1,${.5-r} L${.5-c},${.5-r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╕":{1:(c,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(c,r)=>`M${.5+c},1 L${.5+c},.5 L0,.5 M${.5-c},.5 L${.5-c},1`},"╗":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5+c},${.5-r} L${.5+c},1`},"╘":{1:(c,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(c,r)=>`M1,.5 L${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╚":{1:(c,r)=>`M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0 M1,${.5+r} L${.5-c},${.5+r} L${.5-c},0`},"╛":{1:(c,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(c,r)=>`M0,.5 L${.5+c},.5 L${.5+c},0 M${.5-c},.5 L${.5-c},0`},"╝":{1:(c,r)=>`M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M0,${.5+r} L${.5+c},${.5+r} L${.5+c},0`},"╞":{1:(c,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1 M${.5+c},.5 L1,.5`},"╠":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╡":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(c,r)=>`M0,.5 L${.5-c},.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╣":{1:(c,r)=>`M${.5+c},0 L${.5+c},1 M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0`},"╤":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},1 M${.5+c},.5 L${.5+c},1`},"╦":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╧":{1:(c,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╩":{1:(c,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╪":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╬":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},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:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(c,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(c,r,h,l,o,m,x,v){const w=n.blockElementDefinitions[r];if(w)return(function(A,E,T,H,G,U){for(let P=0;P<E.length;P++){const F=E[P],R=G/8,B=U/8;A.fillRect(T+F.x*R,H+F.y*B,F.w*R,F.h*B)}})(c,w,h,l,o,m),!0;const S=_[r];if(S)return(function(A,E,T,H,G,U){let P=a.get(E);P||(P=new Map,a.set(E,P));const F=A.fillStyle;if(typeof F!="string")throw new Error(`Unexpected fillStyle type "${F}"`);let R=P.get(F);if(!R){const B=E[0].length,D=E.length,k=A.canvas.ownerDocument.createElement("canvas");k.width=B,k.height=D;const Y=(0,f.throwIfFalsy)(k.getContext("2d")),V=new ImageData(B,D);let le,ce,q,N;if(F.startsWith("#"))le=parseInt(F.slice(1,3),16),ce=parseInt(F.slice(3,5),16),q=parseInt(F.slice(5,7),16),N=F.length>7&&parseInt(F.slice(7,9),16)||1;else{if(!F.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${F}" when drawing pattern glyph`);[le,ce,q,N]=F.substring(5,F.length-1).split(",").map((J=>parseFloat(J)))}for(let J=0;J<D;J++)for(let ee=0;ee<B;ee++)V.data[4*(J*B+ee)]=le,V.data[4*(J*B+ee)+1]=ce,V.data[4*(J*B+ee)+2]=q,V.data[4*(J*B+ee)+3]=E[J][ee]*(255*N);Y.putImageData(V,0,0),R=(0,f.throwIfFalsy)(A.createPattern(k,null)),P.set(F,R)}A.fillStyle=R,A.fillRect(T,H,G,U)})(c,S,h,l,o,m),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(A,E,T,H,G,U,P){A.strokeStyle=A.fillStyle;for(const[F,R]of Object.entries(E)){let B;A.beginPath(),A.lineWidth=P*Number.parseInt(F),B=typeof R=="function"?R(.15,.15/U*G):R;for(const D of B.split(" ")){const k=D[0],Y=y[k];if(!Y){console.error(`Could not find drawing instructions for "${k}"`);continue}const V=D.substring(1).split(",");V[0]&&V[1]&&Y(A,b(V,G,U,T,H,!0,P))}A.stroke(),A.closePath()}})(c,C,h,l,o,m,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(A,E,T,H,G,U,P,F){const R=new Path2D;R.rect(T,H,G,U),A.clip(R),A.beginPath();const B=P/12;A.lineWidth=F*B;for(const D of E.d.split(" ")){const k=D[0],Y=y[k];if(!Y){console.error(`Could not find drawing instructions for "${k}"`);continue}const V=D.substring(1).split(",");V[0]&&V[1]&&Y(A,b(V,G,U,T,H,!1,F,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()})(c,L,h,l,o,m,x,v),!0)};const a=new Map;function g(c,r,h=0){return Math.max(Math.min(c,r),h)}const y={C:(c,r)=>c.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(c,r)=>c.lineTo(r[0],r[1]),M:(c,r)=>c.moveTo(r[0],r[1])};function b(c,r,h,l,o,m,x,v=0,w=0){const S=c.map((C=>parseFloat(C)||parseInt(C)));if(S.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<S.length;C+=2)S[C]*=r-v*x-w*x,m&&S[C]!==0&&(S[C]=g(Math.round(S[C]+.5)-.5,r,0)),S[C]+=l+v*x;for(let C=1;C<S.length;C+=2)S[C]*=h,m&&S[C]!==0&&(S[C]=g(Math.round(S[C]+.5)-.5,h,0)),S[C]+=o;return S}},56:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const f=u(859);n.observeDevicePixelDimensions=function(_,a,g){let y=new a.ResizeObserver((b=>{const c=b.find((l=>l.target===_));if(!c)return;if(!("devicePixelContentBoxSize"in c))return y==null||y.disconnect(),void(y=void 0);const r=c.devicePixelContentBoxSize[0].inlineSize,h=c.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&g(r,h)}));try{y.observe(_,{box:["device-pixel-content-box"]})}catch{y.disconnect(),y=void 0}return(0,f.toDisposable)((()=>y==null?void 0:y.disconnect()))}},374:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function f(_){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=f,n.allowRescaling=function(_,a,g,y){return a===1&&g>Math.ceil(1.5*y)&&_!==void 0&&_>255&&!f(_)&&!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,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},296:(j,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,g,y=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const b=_.buffers.active.ydisp,c=a[1]-b,r=g[1]-b,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const f=u(237),_=u(860),a=u(374),g=u(160),y=u(345),b=u(485),c=u(385),r=u(147),h=u(855),l={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 o;class m{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 y.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new y.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=w(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 c.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(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(m.maxTextureSize||4096))).sort(((P,F)=>F.canvas.width!==P.canvas.width?F.canvas.width-P.canvas.width:F.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 T=L.slice(A,A+4),H=T.map((P=>P.glyphs[0].texturePage)).sort(((P,F)=>P>F?1:-1)),G=this.pages.length-T.length,U=this._mergePages(T,G);U.version++;for(let P=H.length-1;P>=0;P--)this._deletePage(H[P]);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 A=2*C[0].canvas.width,E=new x(this._document,A,C);for(const[T,H]of C.entries()){const G=T*H.canvas.width%A,U=Math.floor(T/2)*H.canvas.height;E.ctx.drawImage(H.canvas,G,U);for(const F of H.glyphs)F.texturePage=L,F.sizeClipSpace.x=F.size.x/A,F.sizeClipSpace.y=F.size.y/A,F.texturePosition.x+=G,F.texturePosition.y+=U,F.texturePositionClipSpace.x=F.texturePosition.x/A,F.texturePositionClipSpace.y=F.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(H.canvas);const P=this._activePages.indexOf(H);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,T){return this._getFromCacheMap(this._cacheMapCombined,C,L,A,E,T)}getRasterizedGlyph(C,L,A,E,T){return this._getFromCacheMap(this._cacheMap,C,L,A,E,T)}_getFromCacheMap(C,L,A,E,T,H=!1){return o=C.get(L,A,E,T),o||(o=this._drawToCache(L,A,E,T,H),C.set(L,A,E,T,o)),o}_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 g.NULL_COLOR;let T;switch(C){case 16777216:case 33554432:T=this._getColorFromAnsiIndex(L);break;case 50331648:const H=r.AttributeData.toColorRGB(L);T=g.channels.toColor(H[0],H[1],H[2]);break;default:T=A?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return T}_getForegroundColor(C,L,A,E,T,H,G,U,P,F){const R=this._getMinimumContrastColor(C,L,A,E,T,H,G,P,U,F);if(R)return R;let B;switch(T){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&H<8&&(H+=8),B=this._getColorFromAnsiIndex(H);break;case 50331648:const D=r.AttributeData.toColorRGB(H);B=g.channels.toColor(D[0],D[1],D[2]);break;default:B=G?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=g.color.opaque(B)),U&&(B=g.color.multiplyOpacity(B,f.DIM_OPACITY)),B}_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,T,H,G,U,P,F){if(this._config.minimumContrastRatio===1||F)return;const R=this._getContrastCache(P),B=R.getColor(C,E);if(B!==void 0)return B||void 0;const D=this._resolveBackgroundRgba(L,A,G),k=this._resolveForegroundRgba(T,H,G,U),Y=g.rgba.ensureContrastRatio(D,k,this._config.minimumContrastRatio/(P?2:1));if(!Y)return void R.setColor(C,E,null);const V=g.channels.toColor(Y>>24&255,Y>>16&255,Y>>8&255);return R.setColor(C,E,V),V}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,A,E,T=!1){const H=typeof C=="number"?String.fromCharCode(C):C,G=Math.min(this._config.deviceCellWidth*Math.max(H.length,2)+4,this._textureSize);this._tmpCanvas.width<G&&(this._tmpCanvas.width=G);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=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return l;const P=!!this._workAttributeData.isBold(),F=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),D=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),Y=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),le=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(F){const ue=V;V=ce,ce=ue;const ge=le;le=q,q=ge}const N=this._getBackgroundColor(q,ce,F,R);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 J=P?this._config.fontWeightBold:this._config.fontWeight,ee=B?"italic":"";this._tmpCtx.font=`${ee} ${J} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=f.TEXT_BASELINE;const _e=H.length===1&&(0,a.isPowerlineGlyph)(H.charCodeAt(0)),fe=H.length===1&&(0,a.isRestrictedPowerlineGlyph)(H.charCodeAt(0)),Me=this._getForegroundColor(L,q,ce,A,le,V,F,R,P,(0,a.treatGlyphAsBackgroundColor)(H.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const ve=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,H,ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,we=!_e;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),D){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())we=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{we=!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=ve,Re=Math.ceil(ve+this._config.deviceCharHeight)-ge-(T?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(ve+this._config.deviceCharHeight-ue/2)-ge,vt=ue<=1?Re:Math.ceil(ve+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,Ft=Le-Ae,ri=Math.floor(tr*Ft),ni=Math.floor(ir*Ft),Jt=Ft-ri-ni;this._tmpCtx.setLineDash([ri,ni,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&&H!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(H);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=N.css,this._tmpCtx.strokeText(H,ve,ve+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Y){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(ve,ve+ge),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*qe,ve+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(H,ve,ve+this._config.deviceCharHeight),H==="_"&&!this._config.allowTransparency){let ue=v(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,we);if(ue)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(H,ve,ve+this._config.deviceCharHeight-ge),ue=v(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,we),ue);ge++);}if(k){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(ve,ve+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*qe,ve+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,N,Me,we),Ot)return l;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,G,fe,Oe,ve);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(m.maxAtlasPages&&this._pages.length>=m.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,T,H){L.top=0;const G=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:A;let P=!1;for(let F=0;F<G;F++){for(let R=0;R<U;R++){const B=F*this._tmpCanvas.width*4+4*R+3;if(C.data[B]!==0){L.top=F,P=!0;break}}if(P)break}L.left=0,P=!1;for(let F=0;F<H+U;F++){for(let R=0;R<G;R++){const B=R*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.left=F,P=!0;break}}if(P)break}L.right=U,P=!1;for(let F=H+U-1;F>=H;F--){for(let R=0;R<G;R++){const B=R*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.right=F,P=!0;break}}if(P)break}L.bottom=G,P=!1;for(let F=G-1;F>=0;F--){for(let R=0;R<U;R++){const B=F*this._tmpCanvas.width*4+4*R+3;if(C.data[B]!==0){L.bottom=F,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+H+(E||T?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+H+(E||T?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=m;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=w(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(S,C,L,A){const E=C.rgba>>>24,T=C.rgba>>>16&255,H=C.rgba>>>8&255,G=L.rgba>>>24,U=L.rgba>>>16&255,P=L.rgba>>>8&255,F=Math.floor((Math.abs(E-G)+Math.abs(T-U)+Math.abs(H-P))/12);let R=!0;for(let B=0;B<S.data.length;B+=4)S.data[B]===E&&S.data[B+1]===T&&S.data[B+2]===H||A&&Math.abs(S.data[B]-E)+Math.abs(S.data[B+1]-T)+Math.abs(S.data[B+2]-H)<F?S.data[B+3]=0:R=!1;return R}function w(S,C,L){const A=S.createElement("canvas");return A.width=C,A.height=L,A}},160:(j,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,f=0,_=0,a=0;var g,y,b,c,r;function h(o){const m=o.toString(16);return m.length<2?"0"+m:m}function l(o,m){return o<m?(m+.05)/(o+.05):(o+.05)/(m+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(m,x,v,w){return w!==void 0?`#${h(m)}${h(x)}${h(v)}${h(w)}`:`#${h(m)}${h(x)}${h(v)}`},o.toRgba=function(m,x,v,w=255){return(m<<24|x<<16|v<<8|w)>>>0},o.toColor=function(m,x,v,w){return{css:o.toCss(m,x,v,w),rgba:o.toRgba(m,x,v,w)}}})(g||(n.channels=g={})),(function(o){function m(x,v){return a=Math.round(255*v),[u,f,_]=r.toChannels(x.rgba),{css:g.toCss(u,f,_,a),rgba:g.toRgba(u,f,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,S=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((w-L)*a),f=A+Math.round((S-A)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,f,_),rgba:g.toRgba(u,f,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const S=r.ensureContrastRatio(x.rgba,v.rgba,w);if(S)return g.toColor(S>>24&255,S>>16&255,S>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,f,_]=r.toChannels(v),{css:g.toCss(u,f,_),rgba:v}},o.opacity=m,o.multiplyOpacity=function(x,v){return a=255&x.rgba,m(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(y||(n.color=y={})),(function(o){let m,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(m=w,m.globalCompositeOperation="copy",x=m.createLinearGradient(0,0,1,1))}catch{}o.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),f=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,f,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),f=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),g.toColor(u,f,_,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 w=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(w)return u=parseInt(w[1]),f=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,f,_,a);if(!m||!x)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=x,m.fillStyle=v,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[u,f,_,a]=m.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,f,_,a),css:v}}})(b||(n.css=b={})),(function(o){function m(x,v,w){const S=x/255,C=v/255,L=w/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.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))}o.relativeLuminance=function(x){return m(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=m})(c||(n.rgb=c={})),(function(o){function m(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E>0||T>0||H>0);)E-=Math.max(0,Math.ceil(.1*E)),T-=Math.max(0,Math.ceil(.1*T)),H-=Math.max(0,Math.ceil(.1*H)),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}function x(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E<255||T<255||H<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=Math.min(255,H+Math.ceil(.1*(255-H))),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const S=w>>24&255,C=w>>16&255,L=w>>8&255,A=v>>24&255,E=v>>16&255,T=v>>8&255;return u=A+Math.round((S-A)*a),f=E+Math.round((C-E)*a),_=T+Math.round((L-T)*a),g.toRgba(u,f,_)},o.ensureContrastRatio=function(v,w,S){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<S){if(L<C){const T=m(v,w,S),H=l(C,c.relativeLuminance(T>>8));if(H<S){const G=x(v,w,S);return H>l(C,c.relativeLuminance(G>>8))?T:G}return T}const A=x(v,w,S),E=l(C,c.relativeLuminance(A>>8));if(E<S){const T=m(v,w,S);return E>l(C,c.relativeLuminance(T>>8))?A:T}return A}},o.reduceLuminance=m,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},345:(j,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 f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){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,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,f){return u((_=>f.fire(_)))},n.runAndSubscribe=function(u,f){return f(void 0),u((_=>f(_)))}},859:(j,n)=>{function u(f){for(const _ of f)_.dispose();f.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 f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)==null||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},n.toDisposable=function(f){return{dispose:f}},n.disposeArray=u,n.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},485:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}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(f,_,a,g,y){this._data.get(f,_)||this._data.set(f,_,new u),this._data.get(f,_).set(a,g,y)}get(f,_,a,g){var y;return(y=this._data.get(f,_))==null?void 0:y.get(a,g)}clear(){this._data.clear()}}},399:(j,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,f=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(f),n.isIpad=f==="iPad",n.isIphone=f==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),n.isLinux=f.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const f=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let b=0,c=0,r=y.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),c=Math.max(b,c),h=y.timeRemaining(),1.5*c>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(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const b=Date.now()+y;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(j,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 f}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 f{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,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=f},782:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const f=u(133),_=u(855),a=u(147);class g 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 c=new g;return c.setFromCharData(b),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.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 c=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)c=!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:c=!0}else c=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(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=g},855:(j,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:(j,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,f=0,_=u.length){let a="";for(let g=f;g<_;++g){let y=u[g];y>65535?(y-=65536,a+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):a+=String.fromCharCode(y)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const y=u.charCodeAt(g++);56320<=y&&y<=57343?f[a++]=1024*(this._interim-55296)+y-56320+65536:(f[a++]=this._interim,f[a++]=y),this._interim=0}for(let y=g;y<_;++y){const b=u.charCodeAt(y);if(55296<=b&&b<=56319){if(++y>=_)return this._interim=b,a;const c=u.charCodeAt(y);56320<=c&&c<=57343?f[a++]=1024*(b-55296)+c-56320+65536:(f[a++]=b,f[a++]=c)}else b!==65279&&(f[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const _=u.length;if(!_)return 0;let a,g,y,b,c=0,r=0,h=0;if(this.interim[0]){let m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=S-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,m=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}m||(S===2?x<128?h--:f[c++]=x:S===3?x<2048||x>=55296&&x<=57343||x===65279||(f[c++]=x):x<65536||x>1114111||(f[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(y=u[o+2])||128&(b=u[o+3]));)f[c++]=a,f[c++]=g,f[c++]=y,f[c++]=b,o+=4;if(a=u[o++],a<128)f[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}f[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&y,r<2048||r>=55296&&r<=57343||r===65279)continue;f[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=y,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&y)<<6|63&b,r<65536||r>1114111)continue;f[c++]=r}}return c}}},776:function(j,n,u){var f=this&&this.__decorate||function(r,h,l,o){var m,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(v=(x<3?m(v):x>3?m(h,l,v):m(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),g=u(97),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let b,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=y[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,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=f([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...m){if(b.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,m);b.trace(`GlyphRenderer#${o.name}(${m.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,m);return b.trace(`GlyphRenderer#${o.name} return`,x),x}}},726:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",f="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[f]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,y,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[f].push({id:c,index:h}):(r[f]=[{id:c,index:h}],r[u]=r)})(a,g,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(j,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 f=u(726);var _;n.IBufferService=(0,f.createDecorator)("BufferService"),n.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),n.ICoreService=(0,f.createDecorator)("CoreService"),n.ICharsetService=(0,f.createDecorator)("CharsetService"),n.IInstantiationService=(0,f.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,f.createDecorator)("LogService"),n.IOptionsService=(0,f.createDecorator)("OptionsService"),n.IOscLinkService=(0,f.createDecorator)("OscLinkService"),n.IUnicodeService=(0,f.createDecorator)("UnicodeService"),n.IDecorationService=(0,f.createDecorator)("DecorationService")}},O={};function te(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return $[j].call(u.exports,u,u.exports,te),u.exports}var ne={};return(()=>{var j=ne;Object.defineProperty(j,"__esModule",{value:!0}),j.WebglAddon=void 0;const n=te(345),u=te(859),f=te(399),_=te(666),a=te(776);class g extends u.Disposable{constructor(b){if(f.isSafari&&(0,f.getSafariVersion)()<16){const c={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",c))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 c=b._core;if(!b.element)return void this.register(c.onWillOpen((()=>this.activate(b))));this._terminal=b;const r=c.coreService,h=c.optionsService,l=c,o=l._renderService,m=l._characterJoinerService,x=l._charSizeService,v=l._coreBrowserService,w=l._decorationService,S=l._logService,C=l._themeService;(0,a.setTraceLogger)(S),this._renderer=this.register(new _.WebglRenderer(b,m,x,v,r,w,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)),o.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()}}j.WebglAddon=g})(),ne})()))})(Hl)),Hl.exports}var ng=rg(),zl={exports:{}},Qd;function ag(){return Qd||(Qd=1,(function(I,W){(function($,O){I.exports=O()})(self,(()=>(()=>{var $={903:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const f=u(274),_=u(627),a=u(237),g=u(860),y=u(374),b=u(296),c=u(345),r=u(859),h=u(399),l=u(855);class o 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,w,S,C,L,A,E,T,H,G){super(),this._terminal=v,this._container=w,this._alpha=L,this._themeService=A,this._bufferService=E,this._optionsService=T,this._decorationService=H,this._coreBrowserService=G,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 c.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new f.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-${S}-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,y.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(v,w){}handleSelectionChanged(v,w,S=!1){this._selectionModel.update(this._terminal._core,v,w,S)}_setTransparency(v){if(v===this._alpha)return;const w=this._canvas;this._alpha=v,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,w),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,c.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let w=0;w<this._charAtlas.pages.length;w++)this._bitmapGenerator[w]=new m(this._charAtlas.pages[w].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,w,S,C){this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,S*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(v,w,S=1){const C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(v*this._deviceCellWidth,(w+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,S*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(v,w,S=1,C=0){this._ctx.fillRect(v*this._deviceCellWidth,(w+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,S*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(v,w,S=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<S;L++){const A=(v+L)*this._deviceCellWidth,E=(v+L+.5)*this._deviceCellWidth,T=(v+L+1)*this._deviceCellWidth,H=(w+1)*this._deviceCellHeight-C-1,G=H-C,U=H+C;this._ctx.moveTo(A,H),this._ctx.bezierCurveTo(A,G,E,G,E,H),this._ctx.bezierCurveTo(E,U,T,U,T,H)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(v,w,S=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=(w+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,A);for(let E=0;E<S;E++){const T=(v+S+E)*this._deviceCellWidth;this._ctx.lineTo(T,A)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(v,w,S=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+S)*this._deviceCellWidth,E=(w+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,w,S){this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,this._coreBrowserService.dpr*S,this._deviceCellHeight)}_strokeRectAtCell(v,w,S,C){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(v*this._deviceCellWidth+L/2,w*this._deviceCellHeight+L/2,S*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,w,S,C){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,w*this._deviceCellHeight,S*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,S*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(v,w,S){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(S);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,g.tryDrawCustomChar)(this._ctx,v.getChars(),w*this._deviceCellWidth,S*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(v.getChars(),w*this._deviceCellWidth+this._deviceCharLeft,S*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(v,w,S){var H,G,U,P;const C=v.getChars(),L=v.getCode(),A=v.getWidth();if(this._cellColorResolver.resolve(v,w,this._bufferService.buffer.ydisp+S,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()||l.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(S),this._bitmapGenerator[E.texturePage]&&this._charAtlas.pages[E.texturePage].canvas!==this._bitmapGenerator[E.texturePage].canvas&&((G=(H=this._bitmapGenerator[E.texturePage])==null?void 0:H.bitmap)==null||G.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 m(this._charAtlas.pages[E.texturePage].canvas)),this._bitmapGenerator[E.texturePage].refresh(),this._bitmapGenerator[E.texturePage].version=this._charAtlas.pages[E.texturePage].version);let T=E.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,y.allowRescaling)(L,A,E.size.x,this._deviceCellWidth)&&(T=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,w*this._deviceCellWidth+this._deviceCharLeft-E.offset.x,S*this._deviceCellHeight+this._deviceCharTop-E.offset.y,T,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,w){return`${w?"italic":""} ${v?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}n.BaseRenderLayer=o;class m{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((w=>{this._state===2?this.refresh():this._bitmap=w,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasRenderer=void 0;const f=u(627),_=u(56),a=u(374),g=u(345),y=u(859),b=u(873),c=u(43),r=u(630),h=u(744);class l extends y.Disposable{constructor(m,x,v,w,S,C,L,A,E,T,H){super(),this._terminal=m,this._screenElement=x,this._bufferService=w,this._charSizeService=S,this._optionsService=C,this._coreBrowserService=E,this._themeService=H,this._observerDisposable=this.register(new y.MutableDisposable),this._onRequestRedraw=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new g.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new g.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const G=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new h.TextRenderLayer(this._terminal,this._screenElement,0,G,this._bufferService,this._optionsService,L,T,this._coreBrowserService,H),new r.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,T,this._optionsService,H),new c.LinkRenderLayer(this._terminal,this._screenElement,2,v,this._bufferService,this._optionsService,T,this._coreBrowserService,H),new b.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,A,this._coreBrowserService,T,H)];for(const U of this._renderLayers)(0,g.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,P)=>this._setCanvasDevicePixelDimensions(U,P))),this.register(this._coreBrowserService.onWindowChange((U=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,U,((P,F)=>this._setCanvasDevicePixelDimensions(P,F)))}))),this.register((0,y.toDisposable)((()=>{for(const U of this._renderLayers)U.dispose();(0,f.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(m,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((m=>m.handleBlur()))}handleFocus(){this._runOperation((m=>m.handleFocus()))}handleSelectionChanged(m,x,v=!1){this._runOperation((w=>w.handleSelectionChanged(m,x,v))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((m=>m.handleCursorMove()))}clear(){this._runOperation((m=>m.reset()))}_runOperation(m){for(const x of this._renderLayers)m(x)}renderRows(m,x){for(const v of this._renderLayers)v.handleGridChanged(m,x)}clearTextureAtlas(){for(const m of this._renderLayers)m.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const m=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*m),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*m),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/m),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/m),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(m,x){this.dimensions.device.canvas.height=x,this.dimensions.device.canvas.width=m;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=l},873:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorRenderLayer=void 0;const f=u(457),_=u(859),a=u(399),g=u(782),y=u(903);class b extends y.BaseRenderLayer{constructor(r,h,l,o,m,x,v,w,S,C){super(r,h,"cursor",l,!0,C,m,x,S,w),this._onRequestRedraw=o,this._coreService=v,this._cursorBlinkStateManager=this.register(new _.MutableDisposable),this._cell=new g.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 f.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,l=h-this._bufferService.buffer.ydisp;if(l<0||l>=this._bufferService.rows)return void this._clearCursor();const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(h).loadCell(o,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 m=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;return x&&x!=="none"&&this._cursorRenderers[x](o,l,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=l,this._state.isFocused=!1,this._state.style=m,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===o&&this._state.y===l&&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"](o,l,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=l,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,l){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,l){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(r,h,l.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(l,r,h),this._ctx.restore()}_renderUnderlineCursor(r,h,l){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(r,h),this._ctx.restore()}_renderOutlineCursor(r,h,l){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(r,h,l.getWidth(),1),this._ctx.restore()}}n.CursorRenderLayer=b},574:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GridCache=void 0,n.GridCache=class{constructor(){this.cache=[]}resize(u,f){for(let _=0;_<u;_++){this.cache.length<=_&&this.cache.push([]);for(let a=this.cache[_].length;a<f;a++)this.cache[_].push(void 0);this.cache[_].length=f}this.cache.length=u}clear(){for(let u=0;u<this.cache.length;u++)for(let f=0;f<this.cache[u].length;f++)this.cache[u][f]=void 0}}},43:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const f=u(197),_=u(237),a=u(903);class g extends a.BaseRenderLayer{constructor(b,c,r,h,l,o,m,x,v){super(b,c,"link",r,!0,v,l,o,m,x),this.register(h.onShowLinkUnderline((w=>this._handleShowLinkUnderline(w)))),this.register(h.onHideLinkUnderline((w=>this._handleHideLinkUnderline(w))))}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,f.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 c=b.y1+1;c<b.y2;c++)this._fillBottomLineAtCells(0,c,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}n.LinkRenderLayer=g},630:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionRenderLayer=void 0;const f=u(903);class _ extends f.BaseRenderLayer{constructor(g,y,b,c,r,h,l,o){super(g,y,"selection",b,!0,o,c,l,h,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(g){super.resize(g),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(g,y,b){super.handleSelectionChanged(g,y,b),this._redrawSelection(g,y,b)}_redrawSelection(g,y,b){if(!this._didStateChange(g,y,b,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!g||!y)return void this._clearState();const c=g[1]-this._bufferService.buffer.ydisp,r=y[1]-this._bufferService.buffer.ydisp,h=Math.max(c,0),l=Math.min(r,this._bufferService.rows-1);if(h>=this._bufferService.rows||l<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 o=g[0],m=y[0]-o,x=l-h+1;this._fillCells(o,h,m,x)}else{const o=c===h?g[0]:0,m=h===r?y[0]:this._bufferService.cols;this._fillCells(o,h,m-o,1);const x=Math.max(l-h-1,0);if(this._fillCells(0,h+1,this._bufferService.cols,x),h!==l){const v=r===l?y[0]:this._bufferService.cols;this._fillCells(0,l,v,1)}}this._state.start=[g[0],g[1]],this._state.end=[y[0],y[1]],this._state.columnSelectMode=b,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(g,y,b,c){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(y,this._state.end)||b!==this._state.columnSelectMode||c!==this._state.ydisp}_areCoordinatesEqual(g,y){return!(!g||!y)&&g[0]===y[0]&&g[1]===y[1]}}n.SelectionRenderLayer=_},744:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextRenderLayer=void 0;const f=u(577),_=u(147),a=u(782),g=u(855),y=u(903),b=u(574);class c extends y.BaseRenderLayer{constructor(h,l,o,m,x,v,w,S,C,L){super(h,l,"text",o,m,L,x,v,S,C),this._characterJoinerService=w,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 l=this._getFont(!1,!1);this._characterWidth===h.device.char.width&&this._characterFont===l||(this._characterWidth=h.device.char.width,this._characterFont=l,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(h,l,o){for(let m=h;m<=l;m++){const x=m+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(x),w=this._characterJoinerService.getJoinedCharacters(x);for(let S=0;S<this._bufferService.cols;S++){v.loadCell(S,this._workCell);let C=this._workCell,L=!1,A=S;if(C.getWidth()!==0){if(w.length>0&&S===w[0][0]){L=!0;const E=w.shift();C=new f.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)===g.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),o(C,S,m),S=A}}}}_drawBackground(h,l){const o=this._ctx,m=this._bufferService.cols;let x=0,v=0,w=null;o.save(),this._forEachCell(h,l,((S,C,L)=>{let A=null;S.isInverse()?A=S.isFgDefault()?this._themeService.colors.foreground.css:S.isFgRGB()?`rgb(${_.AttributeData.toColorRGB(S.getFgColor()).join(",")})`:this._themeService.colors.ansi[S.getFgColor()].css:S.isBgRGB()?A=`rgb(${_.AttributeData.toColorRGB(S.getBgColor()).join(",")})`:S.isBgPalette()&&(A=this._themeService.colors.ansi[S.getBgColor()].css);let E=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+L,void 0,(T=>{T.options.layer!=="top"&&E||(T.backgroundColorRGB&&(A=T.backgroundColorRGB.css),E=T.options.layer==="top")})),w===null&&(x=C,v=L),L!==v?(o.fillStyle=w||"",this._fillCells(x,v,m-x,1),x=C,v=L):w!==A&&(o.fillStyle=w||"",this._fillCells(x,v,C-x,1),x=C,v=L),w=A})),w!==null&&(o.fillStyle=w,this._fillCells(x,v,m-x,1)),o.restore()}_drawForeground(h,l){this._forEachCell(h,l,((o,m,x)=>this._drawChars(o,m,x)))}handleGridChanged(h,l){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,h,this._bufferService.cols,l-h+1),this._drawBackground(h,l),this._drawForeground(h,l))}_isOverlapping(h){if(h.getWidth()!==1||h.getCode()<256)return!1;const l=h.getChars();if(this._characterOverlapCache.hasOwnProperty(l))return this._characterOverlapCache[l];this._ctx.save(),this._ctx.font=this._characterFont;const o=Math.floor(this._ctx.measureText(l).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[l]=o,o}}n.TextRenderLayer=c},274:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const f=u(855),_=u(160),a=u(374);let g,y=0,b=0,c=!1,r=!1,h=!1,l=0;n.CellColorResolver=class{constructor(o,m,x,v,w,S){this._terminal=o,this._optionService=m,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=w,this._themeService=S,this.result={fg:0,bg:0,ext:0}}resolve(o,m,x,v){if(this.result.bg=o.bg,this.result.fg=o.fg,this.result.ext=268435456&o.bg?o.extended.ext:0,b=0,y=0,r=!1,c=!1,h=!1,g=this._themeService.colors,l=0,o.getCode()!==f.NULL_CELL_CODE&&o.extended.underlineStyle===4){const w=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=m*v%(2*Math.round(w))}if(this._decorationService.forEachDecorationAtCell(m,x,"bottom",(w=>{w.backgroundColorRGB&&(b=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(y=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,m,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?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,g.selectionForeground&&(y=g.selectionForeground.rgba>>8&16777215,c=!0),(0,a.treatGlyphAsBackgroundColor)(o.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)y=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}y=_.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}c=!0}}this._decorationService.forEachDecorationAtCell(m,x,"top",(w=>{w.backgroundColorRGB&&(b=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(y=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),r&&(b=h?-16777216&o.bg&-134217729|b|50331648:-16777216&o.bg|b|50331648),c&&(y=-16777216&o.fg&-67108865|y|50331648),67108864&this.result.fg&&(r&&!c&&(y=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,c=!0),!r&&c&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),g=void 0,this.result.bg=r?b:this.result.bg,this.result.fg=c?y:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const f=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(g,y,b,c,r,h,l,o){const m=(0,_.generateConfig)(c,r,h,l,y,b,o);for(let w=0;w<a.length;w++){const S=a[w],C=S.ownedBy.indexOf(g);if(C>=0){if((0,_.configEquals)(S.config,m))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),a.splice(w,1)):S.ownedBy.splice(C,1);break}}for(let w=0;w<a.length;w++){const S=a[w];if((0,_.configEquals)(S.config,m))return S.ownedBy.push(g),S.atlas}const x=g._core,v={atlas:new f.TextureAtlas(document,m,x.unicodeService),config:m,ownedBy:[g]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(g){for(let y=0;y<a.length;y++){const b=a[y].ownedBy.indexOf(g);if(b!==-1){a[y].ownedBy.length===1?(a[y].atlas.dispose(),a.splice(y,1)):a[y].ownedBy.splice(b,1);break}}}},197:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const f=u(160);n.generateConfig=function(_,a,g,y,b,c,r){const h={foreground:c.foreground,background:c.background,cursor:f.NULL_COLOR,cursorAccent:f.NULL_COLOR,selectionForeground:f.NULL_COLOR,selectionBackgroundTransparent:f.NULL_COLOR,selectionBackgroundOpaque:f.NULL_COLOR,selectionInactiveBackgroundTransparent:f.NULL_COLOR,selectionInactiveBackgroundOpaque:f.NULL_COLOR,ansi:c.ansi.slice(),contrastCache:c.contrastCache,halfContrastCache:c.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:r,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:g,deviceCharHeight:y,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 g=0;g<_.colors.ansi.length;g++)if(_.colors.ansi[g].rgba!==a.colors.ansi[g].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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const f=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},457:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,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 f=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,f>0)return void this._restartInterval(f)}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 f=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(f)}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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const f=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:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╒":{1:(c,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(c,r)=>`M${.5-c},1 L${.5-c},.5 L1,.5 M${.5+c},.5 L${.5+c},1`},"╔":{1:(c,r)=>`M1,${.5-r} L${.5-c},${.5-r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╕":{1:(c,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(c,r)=>`M${.5+c},1 L${.5+c},.5 L0,.5 M${.5-c},.5 L${.5-c},1`},"╗":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5+c},${.5-r} L${.5+c},1`},"╘":{1:(c,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(c,r)=>`M1,.5 L${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╚":{1:(c,r)=>`M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0 M1,${.5+r} L${.5-c},${.5+r} L${.5-c},0`},"╛":{1:(c,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(c,r)=>`M0,.5 L${.5+c},.5 L${.5+c},0 M${.5-c},.5 L${.5-c},0`},"╝":{1:(c,r)=>`M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M0,${.5+r} L${.5+c},${.5+r} L${.5+c},0`},"╞":{1:(c,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1 M${.5+c},.5 L1,.5`},"╠":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╡":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(c,r)=>`M0,.5 L${.5-c},.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╣":{1:(c,r)=>`M${.5+c},0 L${.5+c},1 M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0`},"╤":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},1 M${.5+c},.5 L${.5+c},1`},"╦":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╧":{1:(c,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╩":{1:(c,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╪":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╬":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},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:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(c,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(c,r,h,l,o,m,x,v){const w=n.blockElementDefinitions[r];if(w)return(function(A,E,T,H,G,U){for(let P=0;P<E.length;P++){const F=E[P],R=G/8,B=U/8;A.fillRect(T+F.x*R,H+F.y*B,F.w*R,F.h*B)}})(c,w,h,l,o,m),!0;const S=_[r];if(S)return(function(A,E,T,H,G,U){let P=a.get(E);P||(P=new Map,a.set(E,P));const F=A.fillStyle;if(typeof F!="string")throw new Error(`Unexpected fillStyle type "${F}"`);let R=P.get(F);if(!R){const B=E[0].length,D=E.length,k=A.canvas.ownerDocument.createElement("canvas");k.width=B,k.height=D;const Y=(0,f.throwIfFalsy)(k.getContext("2d")),V=new ImageData(B,D);let le,ce,q,N;if(F.startsWith("#"))le=parseInt(F.slice(1,3),16),ce=parseInt(F.slice(3,5),16),q=parseInt(F.slice(5,7),16),N=F.length>7&&parseInt(F.slice(7,9),16)||1;else{if(!F.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${F}" when drawing pattern glyph`);[le,ce,q,N]=F.substring(5,F.length-1).split(",").map((J=>parseFloat(J)))}for(let J=0;J<D;J++)for(let ee=0;ee<B;ee++)V.data[4*(J*B+ee)]=le,V.data[4*(J*B+ee)+1]=ce,V.data[4*(J*B+ee)+2]=q,V.data[4*(J*B+ee)+3]=E[J][ee]*(255*N);Y.putImageData(V,0,0),R=(0,f.throwIfFalsy)(A.createPattern(k,null)),P.set(F,R)}A.fillStyle=R,A.fillRect(T,H,G,U)})(c,S,h,l,o,m),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(A,E,T,H,G,U,P){A.strokeStyle=A.fillStyle;for(const[F,R]of Object.entries(E)){let B;A.beginPath(),A.lineWidth=P*Number.parseInt(F),B=typeof R=="function"?R(.15,.15/U*G):R;for(const D of B.split(" ")){const k=D[0],Y=y[k];if(!Y){console.error(`Could not find drawing instructions for "${k}"`);continue}const V=D.substring(1).split(",");V[0]&&V[1]&&Y(A,b(V,G,U,T,H,!0,P))}A.stroke(),A.closePath()}})(c,C,h,l,o,m,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(A,E,T,H,G,U,P,F){const R=new Path2D;R.rect(T,H,G,U),A.clip(R),A.beginPath();const B=P/12;A.lineWidth=F*B;for(const D of E.d.split(" ")){const k=D[0],Y=y[k];if(!Y){console.error(`Could not find drawing instructions for "${k}"`);continue}const V=D.substring(1).split(",");V[0]&&V[1]&&Y(A,b(V,G,U,T,H,!1,F,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()})(c,L,h,l,o,m,x,v),!0)};const a=new Map;function g(c,r,h=0){return Math.max(Math.min(c,r),h)}const y={C:(c,r)=>c.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(c,r)=>c.lineTo(r[0],r[1]),M:(c,r)=>c.moveTo(r[0],r[1])};function b(c,r,h,l,o,m,x,v=0,w=0){const S=c.map((C=>parseFloat(C)||parseInt(C)));if(S.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<S.length;C+=2)S[C]*=r-v*x-w*x,m&&S[C]!==0&&(S[C]=g(Math.round(S[C]+.5)-.5,r,0)),S[C]+=l+v*x;for(let C=1;C<S.length;C+=2)S[C]*=h,m&&S[C]!==0&&(S[C]=g(Math.round(S[C]+.5)-.5,h,0)),S[C]+=o;return S}},56:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const f=u(859);n.observeDevicePixelDimensions=function(_,a,g){let y=new a.ResizeObserver((b=>{const c=b.find((l=>l.target===_));if(!c)return;if(!("devicePixelContentBoxSize"in c))return y==null||y.disconnect(),void(y=void 0);const r=c.devicePixelContentBoxSize[0].inlineSize,h=c.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&g(r,h)}));try{y.observe(_,{box:["device-pixel-content-box"]})}catch{y.disconnect(),y=void 0}return(0,f.toDisposable)((()=>y==null?void 0:y.disconnect()))}},374:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function f(_){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=f,n.allowRescaling=function(_,a,g,y){return a===1&&g>Math.ceil(1.5*y)&&_!==void 0&&_>255&&!f(_)&&!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,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},296:(j,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,g,y=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const b=_.buffers.active.ydisp,c=a[1]-b,r=g[1]-b,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const f=u(237),_=u(860),a=u(374),g=u(160),y=u(345),b=u(485),c=u(385),r=u(147),h=u(855),l={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 o;class m{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 y.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new y.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=w(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 c.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(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(m.maxTextureSize||4096))).sort(((P,F)=>F.canvas.width!==P.canvas.width?F.canvas.width-P.canvas.width:F.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 T=L.slice(A,A+4),H=T.map((P=>P.glyphs[0].texturePage)).sort(((P,F)=>P>F?1:-1)),G=this.pages.length-T.length,U=this._mergePages(T,G);U.version++;for(let P=H.length-1;P>=0;P--)this._deletePage(H[P]);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 A=2*C[0].canvas.width,E=new x(this._document,A,C);for(const[T,H]of C.entries()){const G=T*H.canvas.width%A,U=Math.floor(T/2)*H.canvas.height;E.ctx.drawImage(H.canvas,G,U);for(const F of H.glyphs)F.texturePage=L,F.sizeClipSpace.x=F.size.x/A,F.sizeClipSpace.y=F.size.y/A,F.texturePosition.x+=G,F.texturePosition.y+=U,F.texturePositionClipSpace.x=F.texturePosition.x/A,F.texturePositionClipSpace.y=F.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(H.canvas);const P=this._activePages.indexOf(H);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,T){return this._getFromCacheMap(this._cacheMapCombined,C,L,A,E,T)}getRasterizedGlyph(C,L,A,E,T){return this._getFromCacheMap(this._cacheMap,C,L,A,E,T)}_getFromCacheMap(C,L,A,E,T,H=!1){return o=C.get(L,A,E,T),o||(o=this._drawToCache(L,A,E,T,H),C.set(L,A,E,T,o)),o}_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 g.NULL_COLOR;let T;switch(C){case 16777216:case 33554432:T=this._getColorFromAnsiIndex(L);break;case 50331648:const H=r.AttributeData.toColorRGB(L);T=g.channels.toColor(H[0],H[1],H[2]);break;default:T=A?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return T}_getForegroundColor(C,L,A,E,T,H,G,U,P,F){const R=this._getMinimumContrastColor(C,L,A,E,T,H,G,P,U,F);if(R)return R;let B;switch(T){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&H<8&&(H+=8),B=this._getColorFromAnsiIndex(H);break;case 50331648:const D=r.AttributeData.toColorRGB(H);B=g.channels.toColor(D[0],D[1],D[2]);break;default:B=G?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=g.color.opaque(B)),U&&(B=g.color.multiplyOpacity(B,f.DIM_OPACITY)),B}_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,T,H,G,U,P,F){if(this._config.minimumContrastRatio===1||F)return;const R=this._getContrastCache(P),B=R.getColor(C,E);if(B!==void 0)return B||void 0;const D=this._resolveBackgroundRgba(L,A,G),k=this._resolveForegroundRgba(T,H,G,U),Y=g.rgba.ensureContrastRatio(D,k,this._config.minimumContrastRatio/(P?2:1));if(!Y)return void R.setColor(C,E,null);const V=g.channels.toColor(Y>>24&255,Y>>16&255,Y>>8&255);return R.setColor(C,E,V),V}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,A,E,T=!1){const H=typeof C=="number"?String.fromCharCode(C):C,G=Math.min(this._config.deviceCellWidth*Math.max(H.length,2)+4,this._textureSize);this._tmpCanvas.width<G&&(this._tmpCanvas.width=G);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=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return l;const P=!!this._workAttributeData.isBold(),F=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),D=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),Y=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),le=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(F){const ue=V;V=ce,ce=ue;const ge=le;le=q,q=ge}const N=this._getBackgroundColor(q,ce,F,R);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 J=P?this._config.fontWeightBold:this._config.fontWeight,ee=B?"italic":"";this._tmpCtx.font=`${ee} ${J} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=f.TEXT_BASELINE;const _e=H.length===1&&(0,a.isPowerlineGlyph)(H.charCodeAt(0)),fe=H.length===1&&(0,a.isRestrictedPowerlineGlyph)(H.charCodeAt(0)),Me=this._getForegroundColor(L,q,ce,A,le,V,F,R,P,(0,a.treatGlyphAsBackgroundColor)(H.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const ve=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,H,ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,we=!_e;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),D){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())we=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{we=!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=ve,Re=Math.ceil(ve+this._config.deviceCharHeight)-ge-(T?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(ve+this._config.deviceCharHeight-ue/2)-ge,vt=ue<=1?Re:Math.ceil(ve+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,Ft=Le-Ae,ri=Math.floor(tr*Ft),ni=Math.floor(ir*Ft),Jt=Ft-ri-ni;this._tmpCtx.setLineDash([ri,ni,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&&H!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(H);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=N.css,this._tmpCtx.strokeText(H,ve,ve+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Y){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(ve,ve+ge),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*qe,ve+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(H,ve,ve+this._config.deviceCharHeight),H==="_"&&!this._config.allowTransparency){let ue=v(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,we);if(ue)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(H,ve,ve+this._config.deviceCharHeight-ge),ue=v(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),N,Me,we),ue);ge++);}if(k){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(ve,ve+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*qe,ve+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,N,Me,we),Ot)return l;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,G,fe,Oe,ve);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(m.maxAtlasPages&&this._pages.length>=m.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,T,H){L.top=0;const G=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:A;let P=!1;for(let F=0;F<G;F++){for(let R=0;R<U;R++){const B=F*this._tmpCanvas.width*4+4*R+3;if(C.data[B]!==0){L.top=F,P=!0;break}}if(P)break}L.left=0,P=!1;for(let F=0;F<H+U;F++){for(let R=0;R<G;R++){const B=R*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.left=F,P=!0;break}}if(P)break}L.right=U,P=!1;for(let F=H+U-1;F>=H;F--){for(let R=0;R<G;R++){const B=R*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.right=F,P=!0;break}}if(P)break}L.bottom=G,P=!1;for(let F=G-1;F>=0;F--){for(let R=0;R<U;R++){const B=F*this._tmpCanvas.width*4+4*R+3;if(C.data[B]!==0){L.bottom=F,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+H+(E||T?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+H+(E||T?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=m;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=w(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(S,C,L,A){const E=C.rgba>>>24,T=C.rgba>>>16&255,H=C.rgba>>>8&255,G=L.rgba>>>24,U=L.rgba>>>16&255,P=L.rgba>>>8&255,F=Math.floor((Math.abs(E-G)+Math.abs(T-U)+Math.abs(H-P))/12);let R=!0;for(let B=0;B<S.data.length;B+=4)S.data[B]===E&&S.data[B+1]===T&&S.data[B+2]===H||A&&Math.abs(S.data[B]-E)+Math.abs(S.data[B+1]-T)+Math.abs(S.data[B+2]-H)<F?S.data[B+3]=0:R=!1;return R}function w(S,C,L){const A=S.createElement("canvas");return A.width=C,A.height=L,A}},577:function(j,n,u){var f=this&&this.__decorate||function(h,l,o,m){var x,v=arguments.length,w=v<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,o):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,m);else for(var S=h.length-1;S>=0;S--)(x=h[S])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,m){l(o,m,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(147),g=u(855),y=u(782),b=u(97);class c extends a.AttributeData{constructor(l,o,m){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=o,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=c;let r=n.CharacterJoinerService=class of{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(l){const o={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(o),o.id}deregister(l){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===l)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(l);if(!o||o.length===0)return[];const m=[],x=o.translateToString(!0);let v=0,w=0,S=0,C=o.getFg(0),L=o.getBg(0);for(let A=0;A<o.getTrimmedLength();A++)if(o.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,S,w,o,v);for(let T=0;T<E.length;T++)m.push(E[T])}v=A,S=w,C=this._workCell.fg,L=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const A=this._getJoinedRanges(x,S,w,o,v);for(let E=0;E<A.length;E++)m.push(A[E])}return m}_getJoinedRanges(l,o,m,x,v){const w=l.substring(o,m);let S=[];try{S=this._characterJoiners[0].handler(w)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(w);for(let A=0;A<L.length;A++)of._mergeRanges(S,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(S,x,v),S}_stringRangesToCellRanges(l,o,m){let x=0,v=!1,w=0,S=l[x];if(S){for(let C=m;C<this._bufferService.cols;C++){const L=o.getWidth(C),A=o.getString(C).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&S[0]<=w&&(S[0]=C,v=!0),S[1]<=w){if(S[1]=C,S=l[++x],!S)break;S[0]<=w?(S[0]=C,v=!0):v=!1}w+=A}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(l,o){let m=!1;for(let x=0;x<l.length;x++){const v=l[x];if(m){if(o[1]<=v[0])return l[x-1][1]=o[1],l;if(o[1]<=v[1])return l[x-1][1]=Math.max(o[1],v[1]),l.splice(x,1),l;l.splice(x,1),x--}else{if(o[1]<=v[0])return l.splice(x,0,o),l;if(o[1]<=v[1])return v[0]=Math.min(o[0],v[0]),l;o[0]<v[1]&&(v[0]=Math.min(o[0],v[0]),m=!0)}}return m?l[l.length-1][1]=o[1]:l.push(o),l}};n.CharacterJoinerService=r=f([_(0,b.IBufferService)],r)},160:(j,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,f=0,_=0,a=0;var g,y,b,c,r;function h(o){const m=o.toString(16);return m.length<2?"0"+m:m}function l(o,m){return o<m?(m+.05)/(o+.05):(o+.05)/(m+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(m,x,v,w){return w!==void 0?`#${h(m)}${h(x)}${h(v)}${h(w)}`:`#${h(m)}${h(x)}${h(v)}`},o.toRgba=function(m,x,v,w=255){return(m<<24|x<<16|v<<8|w)>>>0},o.toColor=function(m,x,v,w){return{css:o.toCss(m,x,v,w),rgba:o.toRgba(m,x,v,w)}}})(g||(n.channels=g={})),(function(o){function m(x,v){return a=Math.round(255*v),[u,f,_]=r.toChannels(x.rgba),{css:g.toCss(u,f,_,a),rgba:g.toRgba(u,f,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,S=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((w-L)*a),f=A+Math.round((S-A)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,f,_),rgba:g.toRgba(u,f,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const S=r.ensureContrastRatio(x.rgba,v.rgba,w);if(S)return g.toColor(S>>24&255,S>>16&255,S>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,f,_]=r.toChannels(v),{css:g.toCss(u,f,_),rgba:v}},o.opacity=m,o.multiplyOpacity=function(x,v){return a=255&x.rgba,m(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(y||(n.color=y={})),(function(o){let m,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(m=w,m.globalCompositeOperation="copy",x=m.createLinearGradient(0,0,1,1))}catch{}o.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),f=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,f,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),f=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),g.toColor(u,f,_,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 w=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(w)return u=parseInt(w[1]),f=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,f,_,a);if(!m||!x)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=x,m.fillStyle=v,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[u,f,_,a]=m.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,f,_,a),css:v}}})(b||(n.css=b={})),(function(o){function m(x,v,w){const S=x/255,C=v/255,L=w/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.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))}o.relativeLuminance=function(x){return m(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=m})(c||(n.rgb=c={})),(function(o){function m(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E>0||T>0||H>0);)E-=Math.max(0,Math.ceil(.1*E)),T-=Math.max(0,Math.ceil(.1*T)),H-=Math.max(0,Math.ceil(.1*H)),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}function x(v,w,S){const C=v>>24&255,L=v>>16&255,A=v>>8&255;let E=w>>24&255,T=w>>16&255,H=w>>8&255,G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));for(;G<S&&(E<255||T<255||H<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=Math.min(255,H+Math.ceil(.1*(255-H))),G=l(c.relativeLuminance2(E,T,H),c.relativeLuminance2(C,L,A));return(E<<24|T<<16|H<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const S=w>>24&255,C=w>>16&255,L=w>>8&255,A=v>>24&255,E=v>>16&255,T=v>>8&255;return u=A+Math.round((S-A)*a),f=E+Math.round((C-E)*a),_=T+Math.round((L-T)*a),g.toRgba(u,f,_)},o.ensureContrastRatio=function(v,w,S){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<S){if(L<C){const T=m(v,w,S),H=l(C,c.relativeLuminance(T>>8));if(H<S){const G=x(v,w,S);return H>l(C,c.relativeLuminance(G>>8))?T:G}return T}const A=x(v,w,S),E=l(C,c.relativeLuminance(A>>8));if(E<S){const T=m(v,w,S);return E>l(C,c.relativeLuminance(T>>8))?A:T}return A}},o.reduceLuminance=m,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},345:(j,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 f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){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,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,f){return u((_=>f.fire(_)))},n.runAndSubscribe=function(u,f){return f(void 0),u((_=>f(_)))}},859:(j,n)=>{function u(f){for(const _ of f)_.dispose();f.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 f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)==null||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},n.toDisposable=function(f){return{dispose:f}},n.disposeArray=u,n.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},485:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}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(f,_,a,g,y){this._data.get(f,_)||this._data.set(f,_,new u),this._data.get(f,_).set(a,g,y)}get(f,_,a,g){var y;return(y=this._data.get(f,_))==null?void 0:y.get(a,g)}clear(){this._data.clear()}}},399:(j,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,f=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(f),n.isIpad=f==="iPad",n.isIphone=f==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),n.isLinux=f.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const f=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let b=0,c=0,r=y.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),c=Math.max(b,c),h=y.timeRemaining(),1.5*c>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(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const b=Date.now()+y;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(j,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 f}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 f{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,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=f},782:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const f=u(133),_=u(855),a=u(147);class g 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 c=new g;return c.setFromCharData(b),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.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 c=!1;if(b[_.CHAR_DATA_CHAR_INDEX].length>2)c=!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:c=!0}else c=!0}else this.content=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(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=g},855:(j,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:(j,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,f=0,_=u.length){let a="";for(let g=f;g<_;++g){let y=u[g];y>65535?(y-=65536,a+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):a+=String.fromCharCode(y)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const y=u.charCodeAt(g++);56320<=y&&y<=57343?f[a++]=1024*(this._interim-55296)+y-56320+65536:(f[a++]=this._interim,f[a++]=y),this._interim=0}for(let y=g;y<_;++y){const b=u.charCodeAt(y);if(55296<=b&&b<=56319){if(++y>=_)return this._interim=b,a;const c=u.charCodeAt(y);56320<=c&&c<=57343?f[a++]=1024*(b-55296)+c-56320+65536:(f[a++]=b,f[a++]=c)}else b!==65279&&(f[a++]=b)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const _=u.length;if(!_)return 0;let a,g,y,b,c=0,r=0,h=0;if(this.interim[0]){let m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=S-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,m=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}m||(S===2?x<128?h--:f[c++]=x:S===3?x<2048||x>=55296&&x<=57343||x===65279||(f[c++]=x):x<65536||x>1114111||(f[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(y=u[o+2])||128&(b=u[o+3]));)f[c++]=a,f[c++]=g,f[c++]=y,f[c++]=b,o+=4;if(a=u[o++],a<128)f[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}f[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&y,r<2048||r>=55296&&r<=57343||r===65279)continue;f[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(y=u[o++],(192&y)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=y,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&y)<<6|63&b,r<65536||r>1114111)continue;f[c++]=r}}return c}}},776:function(j,n,u){var f=this&&this.__decorate||function(r,h,l,o){var m,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(v=(x<3?m(v):x>3?m(h,l,v):m(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),g=u(97),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let b,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=y[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,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=f([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){b=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...m){if(b.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,m);b.trace(`GlyphRenderer#${o.name}(${m.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,m);return b.trace(`GlyphRenderer#${o.name} return`,x),x}}},726:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",f="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[f]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,y,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[f].push({id:c,index:h}):(r[f]=[{id:c,index:h}],r[u]=r)})(a,g,b)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(j,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 f=u(726);var _;n.IBufferService=(0,f.createDecorator)("BufferService"),n.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),n.ICoreService=(0,f.createDecorator)("CoreService"),n.ICharsetService=(0,f.createDecorator)("CharsetService"),n.IInstantiationService=(0,f.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,f.createDecorator)("LogService"),n.IOptionsService=(0,f.createDecorator)("OptionsService"),n.IOscLinkService=(0,f.createDecorator)("OscLinkService"),n.IUnicodeService=(0,f.createDecorator)("UnicodeService"),n.IDecorationService=(0,f.createDecorator)("DecorationService")}},O={};function te(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return $[j].call(u.exports,u,u.exports,te),u.exports}var ne={};return(()=>{var j=ne;Object.defineProperty(j,"__esModule",{value:!0}),j.CanvasAddon=void 0;const n=te(345),u=te(859),f=te(776),_=te(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 y;return(y=this._renderer)==null?void 0:y.textureAtlas}activate(y){const b=y._core;if(!y.element)return void this.register(b.onWillOpen((()=>this.activate(y))));this._terminal=y;const c=b.coreService,r=b.optionsService,h=b.screenElement,l=b.linkifier,o=b,m=o._bufferService,x=o._renderService,v=o._characterJoinerService,w=o._charSizeService,S=o._coreBrowserService,C=o._decorationService,L=o._logService,A=o._themeService;(0,f.setTraceLogger)(L),this._renderer=new _.CanvasRenderer(y,h,l,m,w,r,v,c,S,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(m.cols,m.rows),this.register((0,u.toDisposable)((()=>{var E;x.setRenderer(this._terminal._core._createRenderer()),x.handleResize(y.cols,y.rows),(E=this._renderer)==null||E.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}j.CanvasAddon=a})(),ne})()))})(zl)),zl.exports}var og=ag();/**
115
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
116
+ * @license MIT
117
+ *
118
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
119
+ * @license MIT
120
+ *
121
+ * Originally forked from (with the author's permission):
122
+ * Fabrice Bellard's javascript vt100 for jslinux:
123
+ * http://bellard.org/jslinux/
124
+ * Copyright (c) 2011 Fabrice Bellard
125
+ */var lg=class{constructor(I,W,$,O={}){this._terminal=I,this._regex=W,this._handler=$,this._options=O}provideLinks(I,W){let $=hg.computeLink(I,this._regex,this._terminal,this._handler);W(this._addCallbacks($))}_addCallbacks(I){return I.map(W=>(W.leave=this._options.leave,W.hover=($,O)=>{if(this._options.hover){let{range:te}=W;this._options.hover($,O,te)}},W))}};function cg(I){try{let W=new URL(I),$=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 I.toLocaleLowerCase().startsWith($.toLocaleLowerCase())}catch{return!1}}var hg=class ua{static computeLink(W,$,O,te){let ne=new RegExp($.source,($.flags||"")+"g"),[j,n]=ua._getWindowedLineStrings(W-1,O),u=j.join(""),f,_=[];for(;f=ne.exec(u);){let a=f[0];if(!cg(a))continue;let[g,y]=ua._mapStrIdx(O,n,0,f.index),[b,c]=ua._mapStrIdx(O,g,y,a.length);if(g===-1||y===-1||b===-1||c===-1)continue;let r={start:{x:y+1,y:g+1},end:{x:c,y:b+1}};_.push({range:r,text:a,activate:te})}return _}static _getWindowedLineStrings(W,$){let O,te=W,ne=W,j=0,n="",u=[];if(O=$.buffer.active.getLine(W)){let f=O.translateToString(!0);if(O.isWrapped&&f[0]!==" "){for(j=0;(O=$.buffer.active.getLine(--te))&&j<2048&&(n=O.translateToString(!0),j+=n.length,u.push(n),!(!O.isWrapped||n.indexOf(" ")!==-1)););u.reverse()}for(u.push(f),j=0;(O=$.buffer.active.getLine(++ne))&&O.isWrapped&&j<2048&&(n=O.translateToString(!0),j+=n.length,u.push(n),n.indexOf(" ")===-1););}return[u,te]}static _mapStrIdx(W,$,O,te){let ne=W.buffer.active,j=ne.getNullCell(),n=O;for(;te;){let u=ne.getLine($);if(!u)return[-1,-1];for(let f=n;f<u.length;++f){u.getCell(f,j);let _=j.getChars();if(j.getWidth()&&(te-=_.length||1,f===u.length-1&&_==="")){let a=ne.getLine($+1);a&&a.isWrapped&&(a.getCell(0,j),j.getWidth()===2&&(te+=1))}if(te<0)return[$,f]}$++,n=0}return[$,n]}},ug=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function dg(I,W){let $=window.open();if($){try{$.opener=null}catch{}$.location.href=W}else console.warn("Opening link blocked as opener could not be cleared")}var fg=class{constructor(I=dg,W={}){this._handler=I,this._options=W}activate(I){this._terminal=I;let W=this._options,$=W.urlRegex||ug;this._linkProvider=this._terminal.registerLinkProvider(new lg(this._terminal,$,this._handler,W))}dispose(){var I;(I=this._linkProvider)==null||I.dispose()}};const fa=new RegExp("(?<![a-zA-Z]:\\/\\/)(?:^|[\\s\"'`(\\[{])([./]?[\\w./-]+\\.[a-zA-Z]{1,10})(?::(\\d+)(?::(\\d+))?|\\((\\d+),(\\d+)\\))?","g");function lf(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 _g=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC");class vg{constructor(W,$,O,te){this.terminal=W,this.onFileOpen=$,this.terminalId=O,this.decorationManager=te}provideLinks(W,$){const O=this.terminal.buffer.active.getLine(W-1);if(!O){$(void 0);return}const te=O.translateToString(),ne=new RegExp(fa.source,fa.flags),j=[];let n;for(;(n=ne.exec(te))!==null;){const u=n[1];if(!u||!lf(u))continue;const f=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],g=a.indexOf(u),y=n.index+g,b=n.index+a.length,c=y,r=W-1;j.push({range:{start:{x:y+1,y:W},end:{x:b,y:W}},text:a.substring(g),decorations:{pointerCursor:!0,underline:!0},activate:(h,l)=>{(_g?!h.metaKey:!h.ctrlKey)||this.onFileOpen(u,f,_,this.terminalId)},hover:()=>{var h;(h=this.decorationManager)==null||h.highlightAt(r,c)},leave:()=>{var h;(h=this.decorationManager)==null||h.unhighlightAll()}})}$(j.length>0?j:void 0)}}class gg{constructor(W){ha(this,"disposables",[]);ha(this,"entries",[]);ha(this,"lastScannedLine",-1);this.terminal=W,this.disposables.push(W.onWriteParsed(()=>this.scanNewLines()))}highlightAt(W,$){for(const O of this.entries)O.marker.line===W&&O.x===$&&O.element&&O.element.classList.add("file-path-decoration-hover")}unhighlightAll(){var W;for(const $ of this.entries)(W=$.element)==null||W.classList.remove("file-path-decoration-hover")}scanNewLines(){const W=this.terminal.buffer.active,$=W.baseY+W.cursorY;for(let O=this.lastScannedLine+1;O<=$;O++)this.decorateLine(O);this.lastScannedLine=$}decorateLine(W){const $=this.terminal.buffer.active,O=$.getLine(W);if(!O)return;const te=O.translateToString(),ne=new RegExp(fa.source,fa.flags);let j;for(;(j=ne.exec(te))!==null;){const n=j[1];if(!n||!lf(n))continue;const u=j[0],f=u.indexOf(n),_=j.index+f,a=u.length-f,g=$.baseY+$.cursorY,y=W-g,b=this.terminal.registerMarker(y);if(!b||b.line===-1)continue;const c={marker:b,x:_},r=this.terminal.registerDecoration({marker:b,x:_,width:a});r&&(r.onRender(h=>{h.classList.add("file-path-decoration"),c.element=h}),this.disposables.push(r)),this.entries.push(c),this.disposables.push(b)}}dispose(){for(const W of this.disposables)W.dispose();this.disposables=[],this.entries=[],this.lastScannedLine=-1}}const pg=1;function Zd(I,W){if(!I||I.readyState!==WebSocket.OPEN)return;const $=new TextEncoder().encode(W),O=new Uint8Array(1+$.length);O[0]=pg,O.set($,1),I.send(O.buffer)}function mg({wsRef:I,modifierRef:W}){const[$,O]=ye.useState(null);ye.useEffect(()=>(W.current.clearCallback=()=>O(null),()=>{W.current.clearCallback=null}),[W]);const te=ye.useCallback(u=>{u.preventDefault(),Zd(I.current,"\x1B")},[I]),ne=ye.useCallback(u=>{u.preventDefault(),Zd(I.current," ")},[I]),j=ye.useCallback(u=>{u.preventDefault();const f=$==="ctrl"?null:"ctrl";O(f),W.current.ctrl=f==="ctrl",W.current.cmd=!1},[$,W]),n=ye.useCallback(u=>{u.preventDefault();const f=$==="cmd"?null:"cmd";O(f),W.current.cmd=f==="cmd",W.current.ctrl=!1},[$,W]);return Q.jsxs("div",{className:"virtual-keyboard",role:"toolbar","aria-label":"Virtual modifier keys",children:[Q.jsx("button",{className:"virtual-key",onPointerDown:te,tabIndex:-1,children:"Esc"}),Q.jsx("button",{className:"virtual-key",onPointerDown:ne,tabIndex:-1,children:"Tab"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${$==="ctrl"?" virtual-key-active":""}`,onPointerDown:j,tabIndex:-1,"aria-pressed":$==="ctrl",children:"Ctrl"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${$==="cmd"?" virtual-key-active":""}`,onPointerDown:n,tabIndex:-1,"aria-pressed":$==="cmd",children:"Cmd"})]})}function Sg({fitRef:I,wsRef:W,xtermRef:$,connStatus:O}){const te=j=>{var h,l,o,m,x;j.preventDefault();const n=I.current,u=W.current,f=$.current;if(!n||!u||u.readyState!==WebSocket.OPEN||!f)return;const _=f.cols,a=f.rows,g=(h=f.element)==null?void 0:h.parentElement,y=g?window.getComputedStyle(g):null;console.log("[refresh] before:",{cols:_,rows:a,containerW:y==null?void 0:y.width,containerH:y==null?void 0:y.height});const b=(o=(l=f.buffer)==null?void 0:l.active)==null?void 0:o.baseY,c=(x=(m=f.buffer)==null?void 0:m.active)==null?void 0:x.viewportY,r=!b||c==null||c>=b;n.fit(),r?f.scrollToBottom():f.scrollToLine(c),console.log("[refresh] after fit():",{cols:f.cols,rows:f.rows,changed:f.cols!==_||f.rows!==a}),da(u,"resize",{cols:f.cols,rows:f.rows}),console.log("[refresh] sent resize control frame:",{cols:f.cols,rows:f.rows})},ne=j=>{var n;j.preventDefault(),(n=$.current)==null||n.scrollToBottom()};return Q.jsxs("div",{className:"terminal-controls",children:[O!=="connected"&&Q.jsx("span",{className:`terminal-status-dot ${O==="reconnecting"?"terminal-status-reconnecting":"terminal-status-disconnected"}`,title:O==="reconnecting"?"Reconnecting…":"Disconnected"}),Q.jsx("button",{className:"terminal-control-btn",onPointerDown:te,tabIndex:-1,"aria-label":"Refresh terminal",children:Q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[Q.jsx("path",{d:"M13.5 2.5v4h-4"}),Q.jsx("path",{d:"M2.5 8a5.5 5.5 0 0 1 9.35-3.5L13.5 6.5"}),Q.jsx("path",{d:"M2.5 13.5v-4h4"}),Q.jsx("path",{d:"M13.5 8a5.5 5.5 0 0 1-9.35 3.5L2.5 9.5"})]})}),Q.jsx("button",{className:"terminal-control-btn",onPointerDown:ne,tabIndex:-1,"aria-label":"Scroll to bottom",children:Q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[Q.jsx("path",{d:"M8 3v8"}),Q.jsx("path",{d:"M4 8l4 4 4-4"}),Q.jsx("line",{x1:"4",y1:"13",x2:"12",y2:"13"})]})})]})}const cf=0,hf=1,uf=["image/png","image/jpeg","image/gif","image/webp","image/bmp"];async function Cg(I){var $;if(!(($=navigator.clipboard)!=null&&$.read))return!1;let W=!1;try{const O=await navigator.clipboard.read();for(const te of O){const ne=te.types.find(j=>uf.includes(j));if(ne){W=!0;const j=await te.getType(ne);I.write(`\r
126
+ \x1B[90m[Uploading image...]\x1B[0m`);const{path:n}=await sf(j);return I.write("\r\x1B[2K"),I.paste(n),!0}}}catch{if(W)return I.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
127
+ `),!0}return!1}async function yg(I){var W;if(!await Cg(I))try{const $=await((W=navigator.clipboard)==null?void 0:W.readText());$&&I.paste($)}catch{}}function bg(I,W){var O;const $=(O=I.clipboardData)==null?void 0:O.items;if($){for(const te of Array.from($))if(uf.includes(te.type)){const ne=te.getAsFile();if(!ne)continue;I.preventDefault(),W.write(`\r
128
+ \x1B[90m[Uploading image...]\x1B[0m`),sf(ne).then(({path:j})=>{W.write("\r\x1B[2K"),W.paste(j)}).catch(()=>{W.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
129
+ `)});return}}}function Jd({wsPath:I,onFileOpen:W,persistent:$}){const O=ye.useRef(null),te=ye.useRef(null),ne=ye.useRef(null),j=ye.useRef(null),n=ye.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=rf(`(max-width: ${ef}px)`),[f,_]=ye.useState("connected");return ye.useEffect(()=>{if(!O.current)return;const a=new tg.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,linkHandler:{activate:(B,D)=>{window.open(D,"_blank","noopener")}}});te.current=a;const g=new sg.FitAddon;j.current=g,a.loadAddon(g),a.open(O.current);const y=()=>{try{a.loadAddon(new og.CanvasAddon)}catch{}};try{const B=new ng.WebglAddon;B.onContextLoss(()=>{B.dispose(),y()}),a.loadAddon(B)}catch{y()}const b=new fg((B,D)=>{B.preventDefault(),window.open(D,"_blank")});a.loadAddon(b);const c=I.split("/").pop();let r=null,h=null;if(W){h=new gg(a);const B=new vg(a,(D,k,Y,V)=>{W(D,k,Y,V)},c,h);r=a.registerLinkProvider(B)}const l=navigator.platform.toUpperCase().includes("MAC");a.attachCustomKeyEventHandler(B=>{if(B.type!=="keydown")return!0;if(B.key==="Enter"&&B.shiftKey)return B.preventDefault(),a.paste(`\\
130
+ `),!1;if(!(l?B.metaKey:B.ctrlKey&&B.shiftKey))return!0;if(B.key==="c"||B.key==="C"){const k=a.getSelection();return k?(B.preventDefault(),navigator.clipboard.writeText(k).catch(()=>{}),!1):!0}return B.key==="v"||B.key==="V"?(B.preventDefault(),yg(a),!1):!0});const o=B=>bg(B,a);O.current.addEventListener("paste",o);const m=()=>{var V,le,ce;const B=(V=O.current)==null?void 0:V.getBoundingClientRect();if(!B||B.width===0||B.height===0)return;const D=(ce=(le=a.buffer)==null?void 0:le.active)==null?void 0:ce.baseY;if(!D){g.fit();return}const k=a.buffer.active.viewportY,Y=k==null||k>=D;g.fit(),Y?a.scrollToBottom():a.scrollToLine(k)};let x=null;const v=()=>{x&&clearTimeout(x),x=setTimeout(()=>{x=null,m()},150)};m();const w=setTimeout(v,300),C=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${I}`,L={lastSeq:0,attempts:0,timer:null,disposed:!1,initialPhase:!0,initialBuffer:"",flushTimer:null},A=50,E=3e4,T=B=>(B=B.replace(/\x1b\[[\?>][\d;]*c/g,""),B=B.replace(/\[[\?>][\d;]*c/g,""),B),H=B=>{const D=B!==void 0?`${C}?resume=${B}`:C,k=new WebSocket(D);k.binaryType="arraybuffer",ne.current=k,L.initialPhase=!0,L.initialBuffer="",L.flushTimer&&(clearTimeout(L.flushTimer),L.flushTimer=null);const Y=()=>{if(L.initialPhase=!1,L.flushTimer=null,L.initialBuffer){const V=T(L.initialBuffer);V&&a.write(V,()=>{a.scrollToBottom()}),L.initialBuffer=""}v(),setTimeout(()=>{var V;((V=ne.current)==null?void 0:V.readyState)===WebSocket.OPEN&&da(ne.current,"resize",{cols:a.cols,rows:a.rows}),a.scrollToBottom()},350)};k.onopen=()=>{L.attempts=0,_("connected"),da(k,"resize",{cols:a.cols,rows:a.rows})},k.onmessage=V=>{var N;const le=new Uint8Array(V.data);if(le.length===0)return;const ce=le[0],q=le.subarray(1);if(ce===hf){const J=new TextDecoder().decode(q);if(L.initialPhase)L.initialBuffer+=J,L.flushTimer||(L.flushTimer=setTimeout(Y,500));else{const ee=T(J);ee&&a.write(ee)}}else if(ce===cf)try{const J=JSON.parse(new TextDecoder().decode(q));J.type==="seq"&&typeof((N=J.payload)==null?void 0:N.seq)=="number"&&(L.lastSeq=J.payload.seq)}catch{}},k.onclose=()=>{if(L.disposed)return;if(L.attempts>=A){_("disconnected"),a.write(`\r
131
+ \x1B[90m[Session ended — unable to reconnect]\x1B[0m\r
132
+ `);return}_("reconnecting"),L.attempts===0&&a.write(`\r
133
+ \x1B[33m[Connection lost — reconnecting...]\x1B[0m`);const V=Math.min(1e3*Math.pow(2,L.attempts),E);L.attempts++,L.timer=setTimeout(()=>{L.disposed||H(L.lastSeq||void 0)},V)},k.onerror=()=>{}},G=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);let U="",P=0;a.onData(B=>{var Y,V,le,ce,q,N;const D=ne.current;if(!D||D.readyState!==WebSocket.OPEN)return;if(G){const J=Date.now();if(B===U&&J-P<150)return;U=B,P=J}if(L.initialPhase){const J=B.replace(/\x1b\[[\?>][\d;]*c/g,"").replace(/\x1b\[\d+;\d+R/g,"").replace(/\x1b\[\?[\d;]*\$y/g,"");if(!J)return;B=J}const k=n.current;if((k.ctrl||k.cmd)&&B.length===1){const J=B.charCodeAt(0);if(k.ctrl)J>=97&&J<=122?B=String.fromCharCode(J-96):J>=65&&J<=90&&(B=String.fromCharCode(J-64)),k.ctrl=!1,k.cmd=!1,(Y=k.clearCallback)==null||Y.call(k);else if(k.cmd){const ee=B.toLowerCase();if(ee==="v"){(V=navigator.clipboard)==null||V.readText().then(_e=>{_e&&a.paste(_e)}).catch(()=>{}),k.ctrl=!1,k.cmd=!1,(le=k.clearCallback)==null||le.call(k);return}if(ee==="c"){const _e=a.getSelection();_e&&((ce=navigator.clipboard)==null||ce.writeText(_e).catch(()=>{})),k.ctrl=!1,k.cmd=!1,(q=k.clearCallback)==null||q.call(k);return}k.ctrl=!1,k.cmd=!1,(N=k.clearCallback)==null||N.call(k)}}wg(D,B)}),a.onResize(({cols:B,rows:D})=>{const k=ne.current;(k==null?void 0:k.readyState)===WebSocket.OPEN&&da(k,"resize",{cols:B,rows:D})}),H();const F=new ResizeObserver(v);F.observe(O.current);const R=()=>{document.hidden||v()};return document.addEventListener("visibilitychange",R),()=>{var B,D;L.disposed=!0,L.timer&&clearTimeout(L.timer),L.flushTimer&&clearTimeout(L.flushTimer),clearTimeout(w),x&&clearTimeout(x),h==null||h.dispose(),r==null||r.dispose(),(B=O.current)==null||B.removeEventListener("paste",o),F.disconnect(),document.removeEventListener("visibilitychange",R),(D=ne.current)==null||D.close(),a.dispose(),te.current=null,ne.current=null,j.current=null}},[I]),Q.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",position:"relative"},children:[$===!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:O,className:"terminal-container",style:{width:"100%",flex:1,minHeight:0,overflow:"hidden",backgroundColor:"#1a1a1a"}}),Q.jsx(Sg,{fitRef:j,wsRef:ne,xtermRef:te,connStatus:f}),u&&Q.jsx(mg,{wsRef:ne,modifierRef:n})]})}function wg(I,W){const $=new TextEncoder().encode(W),O=new Uint8Array(1+$.length);O[0]=hf,O.set($,1),I.send(O.buffer)}function da(I,W,$){const O=JSON.stringify({type:W,payload:$}),te=new TextEncoder().encode(O),ne=new Uint8Array(1+te.length);ne[0]=cf,ne.set(te,1),I.send(ne.buffer)}const xg=5e3;function Lg(){const[I,W]=ye.useState(null),[$,O]=ye.useState(null),te=ye.useRef(!1),ne=ye.useCallback(async()=>{try{const n=await jv();W(u=>u!==null&&JSON.stringify(u)===JSON.stringify(n)?u:n),O(null)}catch(n){O(n instanceof Error?n.message:"Failed to fetch overview")}},[]);ye.useEffect(()=>{if(typeof EventSource>"u")return;const n=$v(),u=new EventSource(n);return u.onmessage=f=>{try{JSON.parse(f.data).type==="overview-changed"&&!te.current&&(te.current=!0,ne().finally(()=>{te.current=!1}))}catch{}},u.onerror=()=>{},()=>u.close()},[ne]),ye.useEffect(()=>{ne();const n=setInterval(ne,xg);return()=>clearInterval(n)},[ne]);const j=ye.useCallback(async()=>{await qv(),await ne()},[ne]);return{data:I,error:$,refresh:j}}function Eg(I){if(I.blocked)return`Blocked: ${I.blocked}`;if(I.mode==="soft")return"running";if(!I.phase)return"starting";const W=I.planPhases;if(W.length===0)return I.phase;const $=W.findIndex(O=>O.id===I.phase);return $===-1?I.phase:`${I.phase} (${$+1}/${W.length})`}function Nl(I){if(I<0)return"-";const W=Math.floor(I/6e4);if(W<60)return`${W}m`;const $=Math.floor(W/60),O=W%60;return $<24?`${$}h ${O}m`:`${Math.floor($/24)}d ${$%24}h`}function Mg(I,W){if(!I)return"-";const $=Date.now()-new Date(I).getTime();if($<0)return"-";const O=Math.max(0,$-W);return W===0?Nl($):`${Nl($)} wc / ${Nl(O)} ag`}function Ag({builder:I,onOpen:W}){const $=I.issueNumber?`#${I.issueNumber}`:I.id,O=I.issueTitle||I.id,te=I.blocked!==null&&I.blocked!=="",ne=Math.min(100,Math.max(0,Math.round(I.progress??0)));return Q.jsxs("tr",{className:`builder-row${te?" builder-row--blocked":""}`,children:[Q.jsx("td",{className:"builder-col-id",children:$}),Q.jsx("td",{className:"builder-col-title",children:O}),Q.jsx("td",{className:"builder-col-state",children:Q.jsx("span",{className:te?"builder-state-blocked":"builder-state-active",children:Eg(I)})}),Q.jsxs("td",{className:"builder-col-progress",children:[Q.jsx("div",{className:"progress-bar",children:Q.jsx("div",{className:`progress-fill${te?" progress-fill--blocked":""}`,style:{width:`${ne}%`}})}),Q.jsxs("span",{className:"progress-pct",children:[ne,"%"]})]}),Q.jsx("td",{className:"builder-col-elapsed",children:Mg(I.startedAt,I.idleMs??0)}),Q.jsx("td",{className:"builder-col-actions",children:W&&Q.jsx("button",{className:"builder-row-open",onClick:()=>W(I),children:"Open"})})]})}function Rg(I){const W=Date.now()-new Date(I).getTime(),$=Math.floor(W/6e4);if($<60)return`${Math.max(1,$)}m`;const O=Math.floor($/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}function Dg(I,W){const $=[];for(const O of I)$.push({key:`pr-${O.number}`,issueOrPR:`#${O.number}`,title:O.title,kind:"PR review",kindClass:"attention-kind--pr",waitingSince:O.createdAt,url:O.url});for(const O of W){if(!O.blocked||!O.blockedSince||O.blocked==="PR review")continue;const te=O.issueNumber?`#${O.issueNumber}`:O.id;$.push({key:`gate-${O.id}`,issueOrPR:te,title:O.issueTitle||O.id,kind:O.blocked,kindClass:O.blocked==="spec review"?"attention-kind--spec":"attention-kind--plan",waitingSince:O.blockedSince})}return $.sort((O,te)=>new Date(O.waitingSince).getTime()-new Date(te.waitingSince).getTime()),$}function Tg({prs:I,builders:W}){const $=Dg(I,W);return $.length===0?Q.jsx("p",{className:"work-empty",children:"Nothing needs attention"}):Q.jsx("div",{className:"attention-rows",children:$.map(O=>{const te=Q.jsxs(Q.Fragment,{children:[Q.jsx("span",{className:"attention-row-id",children:O.issueOrPR}),Q.jsx("span",{className:"attention-row-title",children:O.title}),Q.jsx("span",{className:`attention-row-kind ${O.kindClass}`,children:O.kind}),Q.jsx("span",{className:"attention-row-age",children:Rg(O.waitingSince)})]});return O.url?Q.jsx("a",{className:"attention-row",href:O.url,target:"_blank",rel:"noopener noreferrer",children:te},O.key):Q.jsx("div",{className:"attention-row",children:te},O.key)})})}function Bg(I){const W=Date.now()-new Date(I).getTime(),$=Math.floor(W/6e4);if($<60)return`${Math.max(1,$)}m`;const O=Math.floor($/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}const Og={high:"priority-dot--high",medium:"priority-dot--med",low:"priority-dot--low"},kg={bug:"type-tag--bug",project:"type-tag--project"};function Ul({label:I,filePath:W,onRefresh:$}){return Q.jsx("button",{className:"backlog-artifact-link",onClick:async O=>{O.preventDefault(),O.stopPropagation(),await Pl(W),$==null||$()},children:I})}function Hg({items:I,onRefresh:W}){const $=I.filter(O=>!O.hasBuilder);return $.length===0?Q.jsx("p",{className:"work-empty",children:"No open issues"}):Q.jsx("div",{className:"backlog-rows",children:$.map(O=>Q.jsxs("div",{className:"backlog-row",children:[Q.jsxs("a",{className:"backlog-row-main",href:O.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:`backlog-priority-dot ${Og[O.priority]??"priority-dot--low"}`}),Q.jsxs("span",{className:"backlog-row-number",children:["#",O.number]}),Q.jsx("span",{className:`backlog-type-tag ${kg[O.type]??""}`,children:O.type}),Q.jsx("span",{className:"backlog-row-title",children:O.title}),Q.jsx("span",{className:"backlog-row-age",children:Bg(O.createdAt)})]}),(O.specPath||O.planPath||O.reviewPath)&&Q.jsxs("span",{className:"backlog-artifacts",children:[O.specPath&&Q.jsx(Ul,{label:"spec",filePath:O.specPath,onRefresh:W}),O.planPath&&Q.jsx(Ul,{label:"plan",filePath:O.planPath,onRefresh:W}),O.reviewPath&&Q.jsx(Ul,{label:"review",filePath:O.reviewPath,onRefresh:W})]})]},O.number))})}function zg(I){const W=Date.now()-new Date(I).getTime(),$=Math.floor(W/6e4);if($<60)return`${Math.max(1,$)}m ago`;const O=Math.floor($/60);return O<24?`${O}h ago`:`${Math.floor(O/24)}d ago`}const Ng={bug:"type-tag--bug",project:"type-tag--project"};function Ug({items:I}){return I.length===0?null:Q.jsx("div",{className:"recently-closed-rows",children:I.map(W=>Q.jsxs("a",{className:"recently-closed-row",href:W.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:"recently-closed-check",children:"✓"}),Q.jsxs("span",{className:"backlog-row-number",children:["#",W.number]}),Q.jsx("span",{className:`backlog-type-tag ${Ng[W.type]??""}`,children:W.type}),Q.jsx("span",{className:"backlog-row-title",children:W.title}),Q.jsx("span",{className:"backlog-row-age",children:zg(W.closedAt)})]},W.number))})}function Ig(I,W){const $=I.replace(/^\//,"");return W.staged.some(O=>$.endsWith(O)||O.endsWith($))?{indicator:"A",className:"git-staged"}:W.modified.some(O=>$.endsWith(O)||O.endsWith($))?{indicator:"M",className:"git-modified"}:W.untracked.some(O=>$.endsWith(O)||O.endsWith($))?{indicator:"?",className:"git-untracked"}:null}function df({entry:I,expanded:W,gitStatus:$,onToggle:O,onOpen:te,depth:ne=0}){var f;const j=I.type==="directory",n=W.has(I.path),u=j?null:Ig(I.path,$);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{className:`file-node ${j?"directory":"file"}`,style:{paddingLeft:`${ne*16+8}px`},onClick:()=>j?O(I.path):te(I.path),role:"treeitem","aria-expanded":j?n:void 0,tabIndex:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),j?O(I.path):te(I.path))},children:[Q.jsx("span",{className:"file-icon",children:j?n?"📂":"📁":"📄"}),Q.jsx("span",{className:"file-name",children:I.name}),u&&Q.jsx("span",{className:`git-indicator ${u.className}`,children:u.indicator})]}),j&&n&&((f=I.children)==null?void 0:f.map(_=>Q.jsx(df,{entry:_,expanded:W,gitStatus:$,onToggle:O,onOpen:te,depth:ne+1},_.path)))]})}function ff(I,W=[]){for(const $ of I)$.type==="file"&&W.push($),$.children&&ff($.children,W);return W}function Pg({onRefresh:I}){const[W,$]=ye.useState([]),[O,te]=ye.useState(new Set),[ne,j]=ye.useState(null),[n,u]=ye.useState(!1),[f,_]=ye.useState({modified:[],staged:[],untracked:[]}),[a,g]=ye.useState([]),[y,b]=ye.useState(""),[c,r]=ye.useState(!1),h=ye.useRef(null),l=ye.useCallback(async()=>{try{const E=await Xv();$(E),j(null),u(!0)}catch(E){j(E.message)}},[]),o=ye.useCallback(async()=>{try{const E=await Yv();_(E)}catch(E){console.error("Failed to load git status:",E)}},[]),m=ye.useCallback(async()=>{try{const E=await Vv();g(E)}catch(E){console.error("Failed to load recent files:",E)}},[]);ye.useEffect(()=>{n||(l(),o(),m())},[n,l,o,m]),ye.useEffect(()=>{const E=setInterval(()=>{l(),o()},5e3);return()=>clearInterval(E)},[l,o]);const x=E=>{te(T=>{const H=new Set(T);return H.has(E)?H.delete(E):H.add(E),H})},v=async E=>{try{await Pl(E),I(),m()}catch(T){console.error("Failed to open file:",T)}},w=ye.useMemo(()=>ff(W),[W]),S=ye.useMemo(()=>{if(!y.trim())return[];const E=y.toLowerCase();return w.filter(T=>T.name.toLowerCase().includes(E)||T.path.toLowerCase().includes(E)).slice(0,10)},[w,y]),C=E=>{b(E.target.value),r(!0)},L=E=>{E.key==="Escape"?(r(!1),b("")):E.key==="Enter"&&S.length>0&&(v(S[0].path),b(""),r(!1))},A=E=>{v(E),b(""),r(!1)};return ne?Q.jsxs("div",{className:"file-tree-error",children:["Error: ",ne]}):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:y,onChange:C,onKeyDown:L,onFocus:()=>r(!0),onBlur:()=>setTimeout(()=>r(!1),200)}),c&&S.length>0&&Q.jsx("div",{className:"file-search-suggestions",children:S.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:T=>{(T.key==="Enter"||T.key===" ")&&(T.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(df,{entry:E,expanded:O,gitStatus:f,onToggle:x,onOpen:v},E.path))})]})]}):Q.jsx("div",{className:"file-tree-loading",children:"Loading files..."})}const er=['Use `af spawn --task "description"` for quick one-off tasks that don\'t need a spec',"Run `af status` to see all active builders and their current phase",'Use `af send architect "message"` to notify the architect when you need guidance',"Run `af cleanup --project 0042` after merging a PR to clean up the worktree","Use `af spawn --soft -p 42` for flexible, protocol-guided work without strict porch orchestration","Run `af dash start` to launch the architect dashboard","Use `af spawn 42 --resume` to resume an existing builder worktree instead of recreating it","Use `af open file.ts` to open a file in the dashboard annotation viewer","Run `af tower start` to start the Tower server — there is no `restart` command, use stop then start","Check `af-config.json` at your project root to customize builder and architect commands","Run `porch pending` to see all gates waiting for your approval across all projects","Use `porch status 42` to see detailed phase status for a specific project","Run `porch next 42` to get the next tasks for a project","Use `porch done 42` to signal that the current phase work is complete","Gates like `spec-approval` and `plan-approval` require explicit human approval before advancing","Porch tracks state in `codev/projects/<id>/status.yaml` — never edit this file directly","Use `porch approve 42 spec-approval` to approve a gate (human only)","Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with automatic consultations","Use `consult -m gemini --type integration` for integration reviews with Gemini","Run `consult -m gemini --protocol spir --type spec` to get a Gemini review of your specification","Use `consult -m codex --protocol spir --type spec` for a focused specification review","Run `consult -m claude --protocol spir --type plan` to get feedback on your implementation plan","The `consult` CLI supports three models: `gemini`, `codex`, and `claude`",'Use `consult -m gemini --prompt "your question"` to ask Gemini a general question with codebase context','Say "cmap the PR" to run all three consultations in parallel in the background','Consultations are enabled by default in SPIR — say "without consultation" to skip them',"Commit specs and plans to `main` before spawning — builders branch from HEAD","Always add files explicitly with `git add file1 file2` — never use `git add .` or `git add -A`","Use SPIR for new features, TICK for amendments to existing specs, and BUGFIX for issue fixes","Each SPIR feature produces exactly three documents: spec, plan, and review","Specs define WHAT to build, plans define HOW — keep them as separate documents","Add YAML frontmatter with `approved` and `validated` fields to skip phases in porch","Run `codev doctor` to check that your environment is set up correctly","Use `--merge` (not squash) when merging PRs — individual commits document the development process","The TICK protocol modifies spec and plan in-place and creates a new review file","BUGFIX protocol uses GitHub Issues as source of truth — no spec/plan artifacts needed",'Run `tokei -e "node_modules" -e ".git" -e "dist" .` to measure codebase size',"Use `codev adopt` to set up Codev in an existing project","Click a builder card in the Work view to jump to its terminal tab","The file panel in Work view lets you browse project files without leaving the dashboard","Use the Refresh button to update builder status, PRs, and backlog data","The dashboard shows active builders, pending PRs, and backlog items in one view","Click the file panel toggle arrow to expand or collapse the file browser","The dashboard supports both desktop split-pane and mobile single-pane layouts","Tab indicators show builder status at a glance — active, waiting, or implementing","Use the `+ Shell` button to quickly open a new shell terminal tab","The SPIR protocol has four phases: Specify, Plan, Implement (IDE loop), and Review","Each implementation phase follows the IDE cycle: Implement, Defend (test), Evaluate","The EXPERIMENT protocol is for testing new approaches — use it for proof-of-concept work","The MAINTAIN protocol handles code hygiene and documentation sync","Run 3-way consultations at each SPIR checkpoint for spec, plan, and implementation reviews"];function Fg(I){const W=new Date(I.getFullYear(),0,0);return Math.floor((I.getTime()-W.getTime())/864e5)}function _f(I){const W=I.getFullYear(),$=String(I.getMonth()+1).padStart(2,"0"),O=String(I.getDate()).padStart(2,"0");return`tip-dismissed-${W}-${$}-${O}`}function jg(){try{return localStorage.getItem(_f(new Date))==="1"}catch{return!1}}function $g(){try{localStorage.setItem(_f(new Date),"1")}catch{}}function qg(I){return I.split("`").map(($,O)=>O%2===1?Q.jsx("code",{children:$},O):Q.jsx("span",{children:$},O))}function Wg(){const I=Fg(new Date)%er.length,[W,$]=ye.useState(I),[O,te]=ye.useState(jg);if(O||er.length===0)return null;const ne=()=>{$((W-1+er.length)%er.length)},j=()=>{$((W+1)%er.length)},n=()=>{$g(),te(!0)};return Q.jsxs("div",{className:"tip-banner",children:[Q.jsx("button",{className:"tip-banner-nav",onClick:ne,"aria-label":"Previous tip",children:"‹"}),Q.jsx("span",{className:"tip-banner-label",children:"Tip:"}),Q.jsx("span",{className:"tip-banner-text",children:qg(er[W])}),Q.jsx("button",{className:"tip-banner-nav",onClick:j,"aria-label":"Next tip",children:"›"}),Q.jsx("button",{className:"tip-banner-dismiss",onClick:n,"aria-label":"Dismiss tip",children:"×"})]})}function Gg({state:I,onRefresh:W,onSelectTab:$}){var _,a;const{data:O,error:te,refresh:ne}=Lg(),[j,n]=ye.useState(!1),u=ye.useCallback(async()=>{try{await Wv(),W()}catch(g){console.error("Failed to create shell:",g)}},[W]),f=ye.useCallback(g=>{var b;const y=(b=I==null?void 0:I.builders)==null?void 0:b.find(c=>{var r,h,l,o;return g.issueNumber?((r=c.name)==null?void 0:r.includes(String(g.issueNumber)))||((h=c.id)==null?void 0:h.includes(String(g.issueNumber))):((l=c.id)==null?void 0:l.includes(g.id))||((o=c.name)==null?void 0:o.includes(g.id))});y&&($==null||$(y.id))},[I==null?void 0:I.builders,$]);return I?Q.jsxs("div",{className:`work-view ${j?"file-panel-open":""}`,children:[Q.jsxs("div",{className:"work-content",children:[Q.jsxs("div",{className:"work-header",children:[Q.jsx("h2",{className:"work-title",children:"Work"}),Q.jsxs("div",{className:"work-actions",children:[Q.jsx("button",{className:"work-btn",onClick:u,children:"+ Shell"}),Q.jsx("button",{className:"work-btn work-btn-secondary",onClick:ne,children:"Refresh"})]})]}),te&&Q.jsxs("div",{className:"work-error",children:["Failed to load overview: ",te]}),Q.jsx(Wg,{}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Builders"}),O!=null&&O.builders&&O.builders.length>0?Q.jsxs("table",{className:"builder-table",children:[Q.jsx("thead",{children:Q.jsxs("tr",{children:[Q.jsx("th",{children:"Issue"}),Q.jsx("th",{children:"Title"}),Q.jsx("th",{children:"State"}),Q.jsx("th",{children:"Progress"}),Q.jsx("th",{children:"Elapsed"}),Q.jsx("th",{})]})}),Q.jsx("tbody",{children:O.builders.map(g=>Q.jsx(Ag,{builder:g,onOpen:f},g.id))})]}):Q.jsx("p",{className:"work-empty",children:"No active builders"})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Needs Attention"}),(_=O==null?void 0:O.errors)!=null&&_.prs?Q.jsx("p",{className:"work-unavailable",children:O.errors.prs}):Q.jsx(Tg,{prs:(O==null?void 0:O.pendingPRs)??[],builders:(O==null?void 0:O.builders)??[]})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Projects and Bugs"}),(a=O==null?void 0:O.errors)!=null&&a.issues?Q.jsx("p",{className:"work-unavailable",children:O.errors.issues}):Q.jsx(Hg,{items:(O==null?void 0:O.backlog)??[],onRefresh:W})]}),(O==null?void 0:O.recentlyClosed)&&O.recentlyClosed.length>0&&Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Recently Closed"}),Q.jsx(Ug,{items:O.recentlyClosed})]})]}),Q.jsxs("div",{className:`work-file-panel ${j?"expanded":"collapsed"}`,children:[Q.jsxs("div",{className:"work-file-panel-header",children:[Q.jsx("span",{className:"work-file-panel-toggle",onClick:()=>n(!j),children:j?"▼":"▲"}),Q.jsx("span",{className:"work-file-panel-label",onClick:()=>n(!j),children:"Files"}),!j&&Q.jsx("input",{className:"work-file-panel-search",type:"text",placeholder:"Search files...",onFocus:()=>n(!0)})]}),j&&Q.jsx("div",{className:"work-file-panel-content",children:Q.jsx(Pg,{onRefresh:W})})]})]}):Q.jsx("div",{className:"work-view",children:Q.jsx("p",{className:"work-loading",children:"Loading..."})})}function Xg({tabs:I,activeTabId:W,onSelectTab:$,onRefresh:O,children:te}){return Q.jsxs("div",{className:"mobile-layout",children:[Q.jsx(nf,{tabs:I,activeTabId:W,onSelectTab:$,onRefresh:O}),Q.jsx("div",{className:"mobile-content",children:te})]})}function Yg({tabId:I,initialLine:W}){let O=`${tf()}api/annotate/${I}/`;return W&&(O+=`?line=${W}`),Q.jsx("div",{className:"file-viewer",style:{width:"100%",height:"100%"},children:Q.jsx("iframe",{src:O,style:{width:"100%",height:"100%",border:"none"},title:"File Annotator"})})}function Vg(I,W){const $=I==null?void 0:I.trim(),O=W==null?void 0:W.trim();return $&&O&&$.toLowerCase()!==O.toLowerCase()?`${$} ${O} dashboard`:O?`${O} dashboard`:"dashboard"}function Kg(){const{state:I,refresh:W}=Kv(),{tabs:$,activeTab:O,activeTabId:te,selectTab:ne}=Zv(I),j=rf(`(max-width: ${ef}px)`),[n,u]=ye.useState(new Set),f=ye.useRef(new Map),_=ye.useCallback(async(l,o,m,x)=>{try{const v=await Pl(l,o,x);o&&o>0&&f.current.set(v.id,o),W()}catch(v){console.error("Failed to open file:",v)}},[W]),a=Vg(I==null?void 0:I.hostname,I==null?void 0:I.workspaceName);ye.useEffect(()=>{document.title=a},[a]);const[g]=ye.useState(()=>new URLSearchParams(window.location.search).get("fullscreen")==="1");ye.useEffect(()=>{if(!O)return;(O.type==="architect"||O.type==="builder"||O.type==="shell")&&u(o=>{if(o.has(O.id))return o;const m=new Set(o);return m.add(O.id),m})},[O==null?void 0:O.id,O==null?void 0:O.type]);const y=l=>{const o=Xd(l);return o?Q.jsx(Jd,{wsPath:o,onFileOpen:_,persistent:l.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},b=l=>{if(!l.annotationId||!I)return Q.jsx("div",{className:"no-terminal",children:"No file viewer"});if(!I.annotations.find(x=>x.id===l.annotationId))return Q.jsx("div",{className:"no-terminal",children:"Annotation not found"});const m=f.current.get(l.annotationId);return m!==void 0&&f.current.delete(l.annotationId),Q.jsx(Yg,{tabId:l.annotationId,initialLine:m??l.initialLine})},c=l=>{const o=$.filter(m=>l.includes(m.type)&&n.has(m.id));return Q.jsxs(Q.Fragment,{children:[o.map(m=>{const x=Xd(m);return Q.jsx("div",{className:"terminal-tab-pane",style:{display:te===m.id?void 0:"none"},children:x?Q.jsx(Jd,{wsPath:x,onFileOpen:_,persistent:m.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},m.id)}),Q.jsx("div",{style:{display:(O==null?void 0:O.type)==="work"?void 0:"none"},children:Q.jsx(Gg,{state:I,onRefresh:W,onSelectTab:ne})}),(O==null?void 0:O.type)==="file"&&b(O)]})};if(g)return O&&(O.type==="architect"||O.type==="builder"||O.type==="shell")?Q.jsx("div",{className:"fullscreen-terminal",children:y(O)}):Q.jsx("div",{className:"fullscreen-terminal"});if(j)return Q.jsx("div",{className:"mobile-wrapper",children:Q.jsx(Xg,{tabs:$,activeTabId:te,onSelectTab:ne,onRefresh:W,children:c(["architect","builder","shell"])})});const r=$.find(l=>l.type==="architect"),h=r?y(r):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:a}),(I==null?void 0:I.version)&&Q.jsxs("span",{className:"header-version",children:["v",I.version]})]}),Q.jsx("div",{className:"app-body",children:Q.jsx(Jv,{left:h,right:Q.jsxs("div",{className:"right-panel",children:[Q.jsx(nf,{tabs:$.filter(l=>l.type!=="architect"),activeTabId:te,onSelectTab:ne,onRefresh:W}),Q.jsx("div",{className:"tab-content",role:"tabpanel",children:c(["builder","shell"])})]})})})]})}Iv.createRoot(document.getElementById("root")).render(Q.jsx(ye.StrictMode,{children:Q.jsx(Kg,{})}));
134
+ //# sourceMappingURL=index-BYfmVwKi.js.map