hop2 0.8.0

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 (50) hide show
  1. package/.hop-tmux.conf +18 -0
  2. package/INTEGRATION.md +92 -0
  3. package/README.md +260 -0
  4. package/hay/CHANGELOG.md +46 -0
  5. package/hay/DEV_NOTES.md +39 -0
  6. package/hay/README.md +290 -0
  7. package/hay/apps/cli/package.json +25 -0
  8. package/hay/apps/cli/src/index.ts +1250 -0
  9. package/hay/apps/cli/tsconfig.json +8 -0
  10. package/hay/apps/server/package.json +37 -0
  11. package/hay/apps/server/src/index.ts +103 -0
  12. package/hay/apps/server/src/lib.ts +161 -0
  13. package/hay/apps/server/src/pty.ts +68 -0
  14. package/hay/apps/server/src/rooms.ts +421 -0
  15. package/hay/apps/server/src/utils.ts +20 -0
  16. package/hay/apps/server/test/rooms.test.ts +146 -0
  17. package/hay/apps/server/tsconfig.json +9 -0
  18. package/hay/apps/web/index.html +12 -0
  19. package/hay/apps/web/package.json +32 -0
  20. package/hay/apps/web/scripts/run-e2e.mjs +130 -0
  21. package/hay/apps/web/src/App.tsx +1302 -0
  22. package/hay/apps/web/src/components/MobileKeyboard.tsx +701 -0
  23. package/hay/apps/web/src/main.tsx +13 -0
  24. package/hay/apps/web/src/setupTests.ts +1 -0
  25. package/hay/apps/web/src/styles.css +1198 -0
  26. package/hay/apps/web/src/utils/optimisticEcho.ts +115 -0
  27. package/hay/apps/web/src/utils/presence.ts +24 -0
  28. package/hay/apps/web/src/vite-env.d.ts +10 -0
  29. package/hay/apps/web/test/optimisticEcho.test.ts +39 -0
  30. package/hay/apps/web/test/presence.test.ts +18 -0
  31. package/hay/apps/web/tsconfig.json +8 -0
  32. package/hay/apps/web/vite.config.ts +13 -0
  33. package/hay/apps/web/vitest.config.ts +12 -0
  34. package/hay/package-lock.json +5988 -0
  35. package/hay/package.json +18 -0
  36. package/hay/packages/shared/package.json +27 -0
  37. package/hay/packages/shared/src/colors.ts +16 -0
  38. package/hay/packages/shared/src/index.ts +2 -0
  39. package/hay/packages/shared/src/protocol.ts +90 -0
  40. package/hay/packages/shared/test/protocol.test.ts +33 -0
  41. package/hay/packages/shared/tsconfig.json +7 -0
  42. package/hay/tsconfig.base.json +15 -0
  43. package/hay-web/assets/index-CTTzApRp.css +32 -0
  44. package/hay-web/assets/index-FDfdolCs.js +60 -0
  45. package/hay-web/assets/index-FDfdolCs.js.map +1 -0
  46. package/hay-web/index.html +13 -0
  47. package/hop +3717 -0
  48. package/package.json +52 -0
  49. package/sessions.html +243 -0
  50. package/tunnel-shell.js +254 -0
@@ -0,0 +1,60 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const _ of a.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function Xd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cu={exports:{}},Xn={},wu={exports:{}},fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 As=Symbol.for("react.element"),Gd=Symbol.for("react.portal"),Yd=Symbol.for("react.fragment"),Qd=Symbol.for("react.strict_mode"),Jd=Symbol.for("react.profiler"),ef=Symbol.for("react.provider"),tf=Symbol.for("react.context"),rf=Symbol.for("react.forward_ref"),sf=Symbol.for("react.suspense"),nf=Symbol.for("react.memo"),of=Symbol.for("react.lazy"),Ql=Symbol.iterator;function af(e){return e===null||typeof e!="object"?null:(e=Ql&&e[Ql]||e["@@iterator"],typeof e=="function"?e:null)}var ku={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bu=Object.assign,Eu={};function ji(e,t,r){this.props=e,this.context=t,this.refs=Eu,this.updater=r||ku}ji.prototype.isReactComponent={};ji.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ji.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xu(){}xu.prototype=ji.prototype;function Wa(e,t,r){this.props=e,this.context=t,this.refs=Eu,this.updater=r||ku}var $a=Wa.prototype=new xu;$a.constructor=Wa;bu($a,ji.prototype);$a.isPureReactComponent=!0;var Jl=Array.isArray,Lu=Object.prototype.hasOwnProperty,Va={current:null},Ru={key:!0,ref:!0,__self:!0,__source:!0};function Tu(e,t,r){var i,s={},a=null,_=null;if(t!=null)for(i in t.ref!==void 0&&(_=t.ref),t.key!==void 0&&(a=""+t.key),t)Lu.call(t,i)&&!Ru.hasOwnProperty(i)&&(s[i]=t[i]);var n=arguments.length-2;if(n===1)s.children=r;else if(1<n){for(var u=Array(n),d=0;d<n;d++)u[d]=arguments[d+2];s.children=u}if(e&&e.defaultProps)for(i in n=e.defaultProps,n)s[i]===void 0&&(s[i]=n[i]);return{$$typeof:As,type:e,key:a,ref:_,props:s,_owner:Va.current}}function lf(e,t){return{$$typeof:As,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ka(e){return typeof e=="object"&&e!==null&&e.$$typeof===As}function cf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ec=/\/+/g;function vo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?cf(""+e.key):t.toString(36)}function sn(e,t,r,i,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var _=!1;if(e===null)_=!0;else switch(a){case"string":case"number":_=!0;break;case"object":switch(e.$$typeof){case As:case Gd:_=!0}}if(_)return _=e,s=s(_),e=i===""?"."+vo(_,0):i,Jl(s)?(r="",e!=null&&(r=e.replace(ec,"$&/")+"/"),sn(s,t,r,"",function(d){return d})):s!=null&&(Ka(s)&&(s=lf(s,r+(!s.key||_&&_.key===s.key?"":(""+s.key).replace(ec,"$&/")+"/")+e)),t.push(s)),1;if(_=0,i=i===""?".":i+":",Jl(e))for(var n=0;n<e.length;n++){a=e[n];var u=i+vo(a,n);_+=sn(a,t,r,u,s)}else if(u=af(e),typeof u=="function")for(e=u.call(e),n=0;!(a=e.next()).done;)a=a.value,u=i+vo(a,n++),_+=sn(a,t,r,u,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return _}function js(e,t,r){if(e==null)return e;var i=[],s=0;return sn(e,i,"","",function(a){return t.call(r,a,s++)}),i}function uf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var st={current:null},nn={transition:null},hf={ReactCurrentDispatcher:st,ReactCurrentBatchConfig:nn,ReactCurrentOwner:Va};function Du(){throw Error("act(...) is not supported in production builds of React.")}fe.Children={map:js,forEach:function(e,t,r){js(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return js(e,function(){t++}),t},toArray:function(e){return js(e,function(t){return t})||[]},only:function(e){if(!Ka(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Component=ji;fe.Fragment=Yd;fe.Profiler=Jd;fe.PureComponent=Wa;fe.StrictMode=Qd;fe.Suspense=sf;fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hf;fe.act=Du;fe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=bu({},e.props),s=e.key,a=e.ref,_=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,_=Va.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(u in t)Lu.call(t,u)&&!Ru.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&n!==void 0?n[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){n=Array(u);for(var d=0;d<u;d++)n[d]=arguments[d+2];i.children=n}return{$$typeof:As,type:e.type,key:s,ref:a,props:i,_owner:_}};fe.createContext=function(e){return e={$$typeof:tf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ef,_context:e},e.Consumer=e};fe.createElement=Tu;fe.createFactory=function(e){var t=Tu.bind(null,e);return t.type=e,t};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:rf,render:e}};fe.isValidElement=Ka;fe.lazy=function(e){return{$$typeof:of,_payload:{_status:-1,_result:e},_init:uf}};fe.memo=function(e,t){return{$$typeof:nf,type:e,compare:t===void 0?null:t}};fe.startTransition=function(e){var t=nn.transition;nn.transition={};try{e()}finally{nn.transition=t}};fe.unstable_act=Du;fe.useCallback=function(e,t){return st.current.useCallback(e,t)};fe.useContext=function(e){return st.current.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e){return st.current.useDeferredValue(e)};fe.useEffect=function(e,t){return st.current.useEffect(e,t)};fe.useId=function(){return st.current.useId()};fe.useImperativeHandle=function(e,t,r){return st.current.useImperativeHandle(e,t,r)};fe.useInsertionEffect=function(e,t){return st.current.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return st.current.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return st.current.useMemo(e,t)};fe.useReducer=function(e,t,r){return st.current.useReducer(e,t,r)};fe.useRef=function(e){return st.current.useRef(e)};fe.useState=function(e){return st.current.useState(e)};fe.useSyncExternalStore=function(e,t,r){return st.current.useSyncExternalStore(e,t,r)};fe.useTransition=function(){return st.current.useTransition()};fe.version="18.3.1";wu.exports=fe;var Z=wu.exports;const df=Xd(Z);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 ff=Z,_f=Symbol.for("react.element"),pf=Symbol.for("react.fragment"),vf=Object.prototype.hasOwnProperty,mf=ff.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gf={key:!0,ref:!0,__self:!0,__source:!0};function Au(e,t,r){var i,s={},a=null,_=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(_=t.ref);for(i in t)vf.call(t,i)&&!gf.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:_f,type:e,key:a,ref:_,props:s,_owner:mf.current}}Xn.Fragment=pf;Xn.jsx=Au;Xn.jsxs=Au;Cu.exports=Xn;var j=Cu.exports,Mu={exports:{}},St={},Pu={exports:{}},Ou={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(E,T){var D=E.length;E.push(T);e:for(;0<D;){var P=D-1>>>1,W=E[P];if(0<s(W,T))E[P]=T,E[D]=W,D=P;else break e}}function r(E){return E.length===0?null:E[0]}function i(E){if(E.length===0)return null;var T=E[0],D=E.pop();if(D!==T){E[0]=D;e:for(var P=0,W=E.length,G=W>>>1;P<G;){var re=2*(P+1)-1,ee=E[re],_e=re+1,L=E[_e];if(0>s(ee,D))_e<W&&0>s(L,ee)?(E[P]=L,E[_e]=D,P=_e):(E[P]=ee,E[re]=D,P=re);else if(_e<W&&0>s(L,D))E[P]=L,E[_e]=D,P=_e;else break e}}return T}function s(E,T){var D=E.sortIndex-T.sortIndex;return D!==0?D:E.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var _=Date,n=_.now();e.unstable_now=function(){return _.now()-n}}var u=[],d=[],y=1,f=null,m=3,C=!1,k=!1,S=!1,h=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(E){for(var T=r(d);T!==null;){if(T.callback===null)i(d);else if(T.startTime<=E)i(d),T.sortIndex=T.expirationTime,t(u,T);else break;T=r(d)}}function p(E){if(S=!1,c(E),!k)if(r(u)!==null)k=!0,I(g);else{var T=r(d);T!==null&&H(p,T.startTime-E)}}function g(E,T){k=!1,S&&(S=!1,l(v),v=-1),C=!0;var D=m;try{for(c(T),f=r(u);f!==null&&(!(f.expirationTime>T)||E&&!O());){var P=f.callback;if(typeof P=="function"){f.callback=null,m=f.priorityLevel;var W=P(f.expirationTime<=T);T=e.unstable_now(),typeof W=="function"?f.callback=W:f===r(u)&&i(u),c(T)}else i(u);f=r(u)}if(f!==null)var G=!0;else{var re=r(d);re!==null&&H(p,re.startTime-T),G=!1}return G}finally{f=null,m=D,C=!1}}var w=!1,x=null,v=-1,b=5,R=-1;function O(){return!(e.unstable_now()-R<b)}function A(){if(x!==null){var E=e.unstable_now();R=E;var T=!0;try{T=x(!0,E)}finally{T?M():(w=!1,x=null)}}else w=!1}var M;if(typeof o=="function")M=function(){o(A)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,U=F.port2;F.port1.onmessage=A,M=function(){U.postMessage(null)}}else M=function(){h(A,0)};function I(E){x=E,w||(w=!0,M())}function H(E,T){v=h(function(){E(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_continueExecution=function(){k||C||(k=!0,I(g))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(E){switch(m){case 1:case 2:case 3:var T=3;break;default:T=m}var D=m;m=T;try{return E()}finally{m=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,T){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var D=m;m=E;try{return T()}finally{m=D}},e.unstable_scheduleCallback=function(E,T,D){var P=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?P+D:P):D=P,E){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=D+W,E={id:y++,callback:T,priorityLevel:E,startTime:D,expirationTime:W,sortIndex:-1},D>P?(E.sortIndex=D,t(d,E),r(u)===null&&E===r(d)&&(S?(l(v),v=-1):S=!0,H(p,D-P))):(E.sortIndex=W,t(u,E),k||C||(k=!0,I(g))),E},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(E){var T=m;return function(){var D=m;m=T;try{return E.apply(this,arguments)}finally{m=D}}}})(Ou);Pu.exports=Ou;var yf=Pu.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Sf=Z,gt=yf;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var Bu=new Set,ds={};function ni(e,t){Ai(e,t),Ai(e+"Capture",t)}function Ai(e,t){for(ds[e]=t,e=0;e<t.length;e++)Bu.add(t[e])}var ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$o=Object.prototype.hasOwnProperty,Cf=/^[: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]*$/,tc={},rc={};function wf(e){return $o.call(rc,e)?!0:$o.call(tc,e)?!1:Cf.test(e)?rc[e]=!0:(tc[e]=!0,!1)}function kf(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bf(e,t,r,i){if(t===null||typeof t>"u"||kf(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nt(e,t,r,i,s,a,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=_}var Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ze[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ze[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Za=/[\-:]([a-z])/g;function qa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Za,qa);Ze[t]=new nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Za,qa);Ze[t]=new nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Za,qa);Ze[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xa(e,t,r,i){var s=Ze.hasOwnProperty(t)?Ze[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(bf(t,r,s,i)&&(r=null),i||s===null?wf(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,i=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var lr=Sf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zs=Symbol.for("react.element"),fi=Symbol.for("react.portal"),_i=Symbol.for("react.fragment"),Ga=Symbol.for("react.strict_mode"),Vo=Symbol.for("react.profiler"),Iu=Symbol.for("react.provider"),Nu=Symbol.for("react.context"),Ya=Symbol.for("react.forward_ref"),Ko=Symbol.for("react.suspense"),Zo=Symbol.for("react.suspense_list"),Qa=Symbol.for("react.memo"),dr=Symbol.for("react.lazy"),Hu=Symbol.for("react.offscreen"),ic=Symbol.iterator;function $i(e){return e===null||typeof e!="object"?null:(e=ic&&e[ic]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Object.assign,mo;function Qi(e){if(mo===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);mo=t&&t[1]||""}return`
34
+ `+mo+e}var go=!1;function yo(e,t){if(!e||go)return"";go=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var i=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){i=d}e.call(t.prototype)}else{try{throw Error()}catch(d){i=d}e()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var s=d.stack.split(`
35
+ `),a=i.stack.split(`
36
+ `),_=s.length-1,n=a.length-1;1<=_&&0<=n&&s[_]!==a[n];)n--;for(;1<=_&&0<=n;_--,n--)if(s[_]!==a[n]){if(_!==1||n!==1)do if(_--,n--,0>n||s[_]!==a[n]){var u=`
37
+ `+s[_].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=_&&0<=n);break}}}finally{go=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Qi(e):""}function Ef(e){switch(e.tag){case 5:return Qi(e.type);case 16:return Qi("Lazy");case 13:return Qi("Suspense");case 19:return Qi("SuspenseList");case 0:case 2:case 15:return e=yo(e.type,!1),e;case 11:return e=yo(e.type.render,!1),e;case 1:return e=yo(e.type,!0),e;default:return""}}function qo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _i:return"Fragment";case fi:return"Portal";case Vo:return"Profiler";case Ga:return"StrictMode";case Ko:return"Suspense";case Zo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nu:return(e.displayName||"Context")+".Consumer";case Iu:return(e._context.displayName||"Context")+".Provider";case Ya:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qa:return t=e.displayName||null,t!==null?t:qo(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return qo(e(t))}catch{}}return null}function xf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qo(t);case 8:return t===Ga?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Tr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lf(e){var t=Fu(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(_){i=""+_,a.call(this,_)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(_){i=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Us(e){e._valueTracker||(e._valueTracker=Lf(e))}function ju(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Fu(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function vn(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}}function Xo(e,t){var r=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sc(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Tr(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zu(e,t){t=t.checked,t!=null&&Xa(e,"checked",t,!1)}function Go(e,t){zu(e,t);var r=Tr(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yo(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yo(e,t.type,Tr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Yo(e,t,r){(t!=="number"||vn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ji=Array.isArray;function Ei(e,t,r,i){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Tr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Qo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oc(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(q(92));if(Ji(r)){if(1<r.length)throw Error(q(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Tr(r)}}function Uu(e,t){var r=Tr(t.value),i=Tr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ac(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Jo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ws,$u=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ws=Ws||document.createElement("div"),Ws.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ws.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var is={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rf=["Webkit","ms","Moz","O"];Object.keys(is).forEach(function(e){Rf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),is[t]=is[e]})});function Vu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||is.hasOwnProperty(e)&&is[e]?(""+t).trim():t+"px"}function Ku(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=Vu(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var Tf=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ea(e,t){if(t){if(Tf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function ta(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 ra=null;function Ja(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ia=null,xi=null,Li=null;function lc(e){if(e=Os(e)){if(typeof ia!="function")throw Error(q(280));var t=e.stateNode;t&&(t=eo(t),ia(e.stateNode,e.type,t))}}function Zu(e){xi?Li?Li.push(e):Li=[e]:xi=e}function qu(){if(xi){var e=xi,t=Li;if(Li=xi=null,lc(e),t)for(e=0;e<t.length;e++)lc(t[e])}}function Xu(e,t){return e(t)}function Gu(){}var So=!1;function Yu(e,t,r){if(So)return e(t,r);So=!0;try{return Xu(e,t,r)}finally{So=!1,(xi!==null||Li!==null)&&(Gu(),qu())}}function _s(e,t){var r=e.stateNode;if(r===null)return null;var i=eo(r);if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(q(231,t,typeof r));return r}var sa=!1;if(ir)try{var Vi={};Object.defineProperty(Vi,"passive",{get:function(){sa=!0}}),window.addEventListener("test",Vi,Vi),window.removeEventListener("test",Vi,Vi)}catch{sa=!1}function Df(e,t,r,i,s,a,_,n,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(y){this.onError(y)}}var ss=!1,mn=null,gn=!1,na=null,Af={onError:function(e){ss=!0,mn=e}};function Mf(e,t,r,i,s,a,_,n,u){ss=!1,mn=null,Df.apply(Af,arguments)}function Pf(e,t,r,i,s,a,_,n,u){if(Mf.apply(this,arguments),ss){if(ss){var d=mn;ss=!1,mn=null}else throw Error(q(198));gn||(gn=!0,na=d)}}function oi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Qu(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 cc(e){if(oi(e)!==e)throw Error(q(188))}function Of(e){var t=e.alternate;if(!t){if(t=oi(e),t===null)throw Error(q(188));return t!==e?null:e}for(var r=e,i=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return cc(s),e;if(a===i)return cc(s),t;a=a.sibling}throw Error(q(188))}if(r.return!==i.return)r=s,i=a;else{for(var _=!1,n=s.child;n;){if(n===r){_=!0,r=s,i=a;break}if(n===i){_=!0,i=s,r=a;break}n=n.sibling}if(!_){for(n=a.child;n;){if(n===r){_=!0,r=a,i=s;break}if(n===i){_=!0,i=a,r=s;break}n=n.sibling}if(!_)throw Error(q(189))}}if(r.alternate!==i)throw Error(q(190))}if(r.tag!==3)throw Error(q(188));return r.stateNode.current===r?e:t}function Ju(e){return e=Of(e),e!==null?eh(e):null}function eh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=eh(e);if(t!==null)return t;e=e.sibling}return null}var th=gt.unstable_scheduleCallback,uc=gt.unstable_cancelCallback,Bf=gt.unstable_shouldYield,If=gt.unstable_requestPaint,Oe=gt.unstable_now,Nf=gt.unstable_getCurrentPriorityLevel,el=gt.unstable_ImmediatePriority,rh=gt.unstable_UserBlockingPriority,yn=gt.unstable_NormalPriority,Hf=gt.unstable_LowPriority,ih=gt.unstable_IdlePriority,Gn=null,$t=null;function Ff(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Gn,e,void 0,(e.current.flags&128)===128)}catch{}}var Bt=Math.clz32?Math.clz32:Uf,jf=Math.log,zf=Math.LN2;function Uf(e){return e>>>=0,e===0?32:31-(jf(e)/zf|0)|0}var $s=64,Vs=4194304;function es(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sn(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,a=e.pingedLanes,_=r&268435455;if(_!==0){var n=_&~s;n!==0?i=es(n):(a&=_,a!==0&&(i=es(a)))}else _=r&~s,_!==0?i=es(_):a!==0&&(i=es(a));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Bt(t),s=1<<r,i|=e[r],t&=~s;return i}function Wf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $f(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var _=31-Bt(a),n=1<<_,u=s[_];u===-1?(!(n&r)||n&i)&&(s[_]=Wf(n,t)):u<=t&&(e.expiredLanes|=n),a&=~n}}function oa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function sh(){var e=$s;return $s<<=1,!($s&4194240)&&($s=64),e}function Co(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ms(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bt(t),e[t]=r}function Vf(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Bt(r),a=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~a}}function tl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Bt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var we=0;function nh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var oh,rl,ah,lh,ch,aa=!1,Ks=[],Cr=null,wr=null,kr=null,ps=new Map,vs=new Map,pr=[],Kf="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 submit".split(" ");function hc(e,t){switch(e){case"focusin":case"focusout":Cr=null;break;case"dragenter":case"dragleave":wr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(t.pointerId)}}function Ki(e,t,r,i,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:a,targetContainers:[s]},t!==null&&(t=Os(t),t!==null&&rl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Zf(e,t,r,i,s){switch(t){case"focusin":return Cr=Ki(Cr,e,t,r,i,s),!0;case"dragenter":return wr=Ki(wr,e,t,r,i,s),!0;case"mouseover":return kr=Ki(kr,e,t,r,i,s),!0;case"pointerover":var a=s.pointerId;return ps.set(a,Ki(ps.get(a)||null,e,t,r,i,s)),!0;case"gotpointercapture":return a=s.pointerId,vs.set(a,Ki(vs.get(a)||null,e,t,r,i,s)),!0}return!1}function uh(e){var t=$r(e.target);if(t!==null){var r=oi(t);if(r!==null){if(t=r.tag,t===13){if(t=Qu(r),t!==null){e.blockedOn=t,ch(e.priority,function(){ah(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function on(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=la(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);ra=i,r.target.dispatchEvent(i),ra=null}else return t=Os(r),t!==null&&rl(t),e.blockedOn=r,!1;t.shift()}return!0}function dc(e,t,r){on(e)&&r.delete(t)}function qf(){aa=!1,Cr!==null&&on(Cr)&&(Cr=null),wr!==null&&on(wr)&&(wr=null),kr!==null&&on(kr)&&(kr=null),ps.forEach(dc),vs.forEach(dc)}function Zi(e,t){e.blockedOn===t&&(e.blockedOn=null,aa||(aa=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,qf)))}function ms(e){function t(s){return Zi(s,e)}if(0<Ks.length){Zi(Ks[0],e);for(var r=1;r<Ks.length;r++){var i=Ks[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Cr!==null&&Zi(Cr,e),wr!==null&&Zi(wr,e),kr!==null&&Zi(kr,e),ps.forEach(t),vs.forEach(t),r=0;r<pr.length;r++)i=pr[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<pr.length&&(r=pr[0],r.blockedOn===null);)uh(r),r.blockedOn===null&&pr.shift()}var Ri=lr.ReactCurrentBatchConfig,Cn=!0;function Xf(e,t,r,i){var s=we,a=Ri.transition;Ri.transition=null;try{we=1,il(e,t,r,i)}finally{we=s,Ri.transition=a}}function Gf(e,t,r,i){var s=we,a=Ri.transition;Ri.transition=null;try{we=4,il(e,t,r,i)}finally{we=s,Ri.transition=a}}function il(e,t,r,i){if(Cn){var s=la(e,t,r,i);if(s===null)Ao(e,t,i,wn,r),hc(e,i);else if(Zf(s,e,t,r,i))i.stopPropagation();else if(hc(e,i),t&4&&-1<Kf.indexOf(e)){for(;s!==null;){var a=Os(s);if(a!==null&&oh(a),a=la(e,t,r,i),a===null&&Ao(e,t,i,wn,r),a===s)break;s=a}s!==null&&i.stopPropagation()}else Ao(e,t,i,null,r)}}var wn=null;function la(e,t,r,i){if(wn=null,e=Ja(i),e=$r(e),e!==null)if(t=oi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Qu(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wn=e,null}function hh(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Nf()){case el:return 1;case rh:return 4;case yn:case Hf:return 16;case ih:return 536870912;default:return 16}default:return 16}}var mr=null,sl=null,an=null;function dh(){if(an)return an;var e,t=sl,r=t.length,i,s="value"in mr?mr.value:mr.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var _=r-e;for(i=1;i<=_&&t[r-i]===s[a-i];i++);return an=s.slice(e,1<i?1-i:void 0)}function ln(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 Zs(){return!0}function fc(){return!1}function Ct(e){function t(r,i,s,a,_){this._reactName=r,this._targetInst=s,this.type=i,this.nativeEvent=a,this.target=_,this.currentTarget=null;for(var n in e)e.hasOwnProperty(n)&&(r=e[n],this[n]=r?r(a):a[n]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Zs:fc,this.isPropagationStopped=fc,this}return Ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Zs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zs)},persist:function(){},isPersistent:Zs}),t}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nl=Ct(zi),Ps=Ae({},zi,{view:0,detail:0}),Yf=Ct(Ps),wo,ko,qi,Yn=Ae({},Ps,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ol,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!==qi&&(qi&&e.type==="mousemove"?(wo=e.screenX-qi.screenX,ko=e.screenY-qi.screenY):ko=wo=0,qi=e),wo)},movementY:function(e){return"movementY"in e?e.movementY:ko}}),_c=Ct(Yn),Qf=Ae({},Yn,{dataTransfer:0}),Jf=Ct(Qf),e_=Ae({},Ps,{relatedTarget:0}),bo=Ct(e_),t_=Ae({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),r_=Ct(t_),i_=Ae({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),s_=Ct(i_),n_=Ae({},zi,{data:0}),pc=Ct(n_),o_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a_={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"},l_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=l_[e])?!!t[e]:!1}function ol(){return c_}var u_=Ae({},Ps,{key:function(e){if(e.key){var t=o_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ln(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?a_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ol,charCode:function(e){return e.type==="keypress"?ln(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ln(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),h_=Ct(u_),d_=Ae({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vc=Ct(d_),f_=Ae({},Ps,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ol}),__=Ct(f_),p_=Ae({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),v_=Ct(p_),m_=Ae({},Yn,{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}),g_=Ct(m_),y_=[9,13,27,32],al=ir&&"CompositionEvent"in window,ns=null;ir&&"documentMode"in document&&(ns=document.documentMode);var S_=ir&&"TextEvent"in window&&!ns,fh=ir&&(!al||ns&&8<ns&&11>=ns),mc=" ",gc=!1;function _h(e,t){switch(e){case"keyup":return y_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ph(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pi=!1;function C_(e,t){switch(e){case"compositionend":return ph(t);case"keypress":return t.which!==32?null:(gc=!0,mc);case"textInput":return e=t.data,e===mc&&gc?null:e;default:return null}}function w_(e,t){if(pi)return e==="compositionend"||!al&&_h(e,t)?(e=dh(),an=sl=mr=null,pi=!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 fh&&t.locale!=="ko"?null:t.data;default:return null}}var k_={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 yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!k_[e.type]:t==="textarea"}function vh(e,t,r,i){Zu(i),t=kn(t,"onChange"),0<t.length&&(r=new nl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var os=null,gs=null;function b_(e){Lh(e,0)}function Qn(e){var t=gi(e);if(ju(t))return e}function E_(e,t){if(e==="change")return t}var mh=!1;if(ir){var Eo;if(ir){var xo="oninput"in document;if(!xo){var Sc=document.createElement("div");Sc.setAttribute("oninput","return;"),xo=typeof Sc.oninput=="function"}Eo=xo}else Eo=!1;mh=Eo&&(!document.documentMode||9<document.documentMode)}function Cc(){os&&(os.detachEvent("onpropertychange",gh),gs=os=null)}function gh(e){if(e.propertyName==="value"&&Qn(gs)){var t=[];vh(t,gs,e,Ja(e)),Yu(b_,t)}}function x_(e,t,r){e==="focusin"?(Cc(),os=t,gs=r,os.attachEvent("onpropertychange",gh)):e==="focusout"&&Cc()}function L_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(gs)}function R_(e,t){if(e==="click")return Qn(t)}function T_(e,t){if(e==="input"||e==="change")return Qn(t)}function D_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:D_;function ys(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var s=r[i];if(!$o.call(t,s)||!Nt(e[s],t[s]))return!1}return!0}function wc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kc(e,t){var r=wc(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=wc(r)}}function yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sh(){for(var e=window,t=vn();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=vn(e.document)}return t}function ll(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")}function A_(e){var t=Sh(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yh(r.ownerDocument.documentElement,r)){if(i!==null&&ll(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(i.start,s);i=i.end===void 0?a:Math.min(i.end,s),!e.extend&&a>i&&(s=i,i=a,a=s),s=kc(r,a);var _=kc(r,i);s&&_&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==_.node||e.focusOffset!==_.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>i?(e.addRange(t),e.extend(_.node,_.offset)):(t.setEnd(_.node,_.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var M_=ir&&"documentMode"in document&&11>=document.documentMode,vi=null,ca=null,as=null,ua=!1;function bc(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ua||vi==null||vi!==vn(i)||(i=vi,"selectionStart"in i&&ll(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),as&&ys(as,i)||(as=i,i=kn(ca,"onSelect"),0<i.length&&(t=new nl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=vi)))}function qs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var mi={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionend:qs("Transition","TransitionEnd")},Lo={},Ch={};ir&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete mi.animationend.animation,delete mi.animationiteration.animation,delete mi.animationstart.animation),"TransitionEvent"in window||delete mi.transitionend.transition);function Jn(e){if(Lo[e])return Lo[e];if(!mi[e])return e;var t=mi[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ch)return Lo[e]=t[r];return e}var wh=Jn("animationend"),kh=Jn("animationiteration"),bh=Jn("animationstart"),Eh=Jn("transitionend"),xh=new Map,Ec="abort auxClick 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(" ");function Pr(e,t){xh.set(e,t),ni(t,[e])}for(var Ro=0;Ro<Ec.length;Ro++){var To=Ec[Ro],P_=To.toLowerCase(),O_=To[0].toUpperCase()+To.slice(1);Pr(P_,"on"+O_)}Pr(wh,"onAnimationEnd");Pr(kh,"onAnimationIteration");Pr(bh,"onAnimationStart");Pr("dblclick","onDoubleClick");Pr("focusin","onFocus");Pr("focusout","onBlur");Pr(Eh,"onTransitionEnd");Ai("onMouseEnter",["mouseout","mouseover"]);Ai("onMouseLeave",["mouseout","mouseover"]);Ai("onPointerEnter",["pointerout","pointerover"]);Ai("onPointerLeave",["pointerout","pointerover"]);ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ni("onBeforeInput",["compositionend","keypress","textInput","paste"]);ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ts="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(" "),B_=new Set("cancel close invalid load scroll toggle".split(" ").concat(ts));function xc(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Pf(i,t,void 0,e),e.currentTarget=null}function Lh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],s=i.event;i=i.listeners;e:{var a=void 0;if(t)for(var _=i.length-1;0<=_;_--){var n=i[_],u=n.instance,d=n.currentTarget;if(n=n.listener,u!==a&&s.isPropagationStopped())break e;xc(s,n,d),a=u}else for(_=0;_<i.length;_++){if(n=i[_],u=n.instance,d=n.currentTarget,n=n.listener,u!==a&&s.isPropagationStopped())break e;xc(s,n,d),a=u}}}if(gn)throw e=na,gn=!1,na=null,e}function xe(e,t){var r=t[pa];r===void 0&&(r=t[pa]=new Set);var i=e+"__bubble";r.has(i)||(Rh(t,e,2,!1),r.add(i))}function Do(e,t,r){var i=0;t&&(i|=4),Rh(r,e,i,t)}var Xs="_reactListening"+Math.random().toString(36).slice(2);function Ss(e){if(!e[Xs]){e[Xs]=!0,Bu.forEach(function(r){r!=="selectionchange"&&(B_.has(r)||Do(r,!1,e),Do(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xs]||(t[Xs]=!0,Do("selectionchange",!1,t))}}function Rh(e,t,r,i){switch(hh(t)){case 1:var s=Xf;break;case 4:s=Gf;break;default:s=il}r=s.bind(null,t,r,e),s=void 0,!sa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Ao(e,t,r,i,s){var a=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var n=i.stateNode.containerInfo;if(n===s||n.nodeType===8&&n.parentNode===s)break;if(_===4)for(_=i.return;_!==null;){var u=_.tag;if((u===3||u===4)&&(u=_.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;_=_.return}for(;n!==null;){if(_=$r(n),_===null)return;if(u=_.tag,u===5||u===6){i=a=_;continue e}n=n.parentNode}}i=i.return}Yu(function(){var d=a,y=Ja(r),f=[];e:{var m=xh.get(e);if(m!==void 0){var C=nl,k=e;switch(e){case"keypress":if(ln(r)===0)break e;case"keydown":case"keyup":C=h_;break;case"focusin":k="focus",C=bo;break;case"focusout":k="blur",C=bo;break;case"beforeblur":case"afterblur":C=bo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=_c;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=Jf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=__;break;case wh:case kh:case bh:C=r_;break;case Eh:C=v_;break;case"scroll":C=Yf;break;case"wheel":C=g_;break;case"copy":case"cut":case"paste":C=s_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=vc}var S=(t&4)!==0,h=!S&&e==="scroll",l=S?m!==null?m+"Capture":null:m;S=[];for(var o=d,c;o!==null;){c=o;var p=c.stateNode;if(c.tag===5&&p!==null&&(c=p,l!==null&&(p=_s(o,l),p!=null&&S.push(Cs(o,p,c)))),h)break;o=o.return}0<S.length&&(m=new C(m,k,null,r,y),f.push({event:m,listeners:S}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",m&&r!==ra&&(k=r.relatedTarget||r.fromElement)&&($r(k)||k[sr]))break e;if((C||m)&&(m=y.window===y?y:(m=y.ownerDocument)?m.defaultView||m.parentWindow:window,C?(k=r.relatedTarget||r.toElement,C=d,k=k?$r(k):null,k!==null&&(h=oi(k),k!==h||k.tag!==5&&k.tag!==6)&&(k=null)):(C=null,k=d),C!==k)){if(S=_c,p="onMouseLeave",l="onMouseEnter",o="mouse",(e==="pointerout"||e==="pointerover")&&(S=vc,p="onPointerLeave",l="onPointerEnter",o="pointer"),h=C==null?m:gi(C),c=k==null?m:gi(k),m=new S(p,o+"leave",C,r,y),m.target=h,m.relatedTarget=c,p=null,$r(y)===d&&(S=new S(l,o+"enter",k,r,y),S.target=c,S.relatedTarget=h,p=S),h=p,C&&k)t:{for(S=C,l=k,o=0,c=S;c;c=hi(c))o++;for(c=0,p=l;p;p=hi(p))c++;for(;0<o-c;)S=hi(S),o--;for(;0<c-o;)l=hi(l),c--;for(;o--;){if(S===l||l!==null&&S===l.alternate)break t;S=hi(S),l=hi(l)}S=null}else S=null;C!==null&&Lc(f,m,C,S,!1),k!==null&&h!==null&&Lc(f,h,k,S,!0)}}e:{if(m=d?gi(d):window,C=m.nodeName&&m.nodeName.toLowerCase(),C==="select"||C==="input"&&m.type==="file")var g=E_;else if(yc(m))if(mh)g=T_;else{g=L_;var w=x_}else(C=m.nodeName)&&C.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(g=R_);if(g&&(g=g(e,d))){vh(f,g,r,y);break e}w&&w(e,m,d),e==="focusout"&&(w=m._wrapperState)&&w.controlled&&m.type==="number"&&Yo(m,"number",m.value)}switch(w=d?gi(d):window,e){case"focusin":(yc(w)||w.contentEditable==="true")&&(vi=w,ca=d,as=null);break;case"focusout":as=ca=vi=null;break;case"mousedown":ua=!0;break;case"contextmenu":case"mouseup":case"dragend":ua=!1,bc(f,r,y);break;case"selectionchange":if(M_)break;case"keydown":case"keyup":bc(f,r,y)}var x;if(al)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else pi?_h(e,r)&&(v="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(v="onCompositionStart");v&&(fh&&r.locale!=="ko"&&(pi||v!=="onCompositionStart"?v==="onCompositionEnd"&&pi&&(x=dh()):(mr=y,sl="value"in mr?mr.value:mr.textContent,pi=!0)),w=kn(d,v),0<w.length&&(v=new pc(v,e,null,r,y),f.push({event:v,listeners:w}),x?v.data=x:(x=ph(r),x!==null&&(v.data=x)))),(x=S_?C_(e,r):w_(e,r))&&(d=kn(d,"onBeforeInput"),0<d.length&&(y=new pc("onBeforeInput","beforeinput",null,r,y),f.push({event:y,listeners:d}),y.data=x))}Lh(f,t)})}function Cs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function kn(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=_s(e,r),a!=null&&i.unshift(Cs(e,a,s)),a=_s(e,t),a!=null&&i.push(Cs(e,a,s))),e=e.return}return i}function hi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lc(e,t,r,i,s){for(var a=t._reactName,_=[];r!==null&&r!==i;){var n=r,u=n.alternate,d=n.stateNode;if(u!==null&&u===i)break;n.tag===5&&d!==null&&(n=d,s?(u=_s(r,a),u!=null&&_.unshift(Cs(r,u,n))):s||(u=_s(r,a),u!=null&&_.push(Cs(r,u,n)))),r=r.return}_.length!==0&&e.push({event:t,listeners:_})}var I_=/\r\n?/g,N_=/\u0000|\uFFFD/g;function Rc(e){return(typeof e=="string"?e:""+e).replace(I_,`
38
+ `).replace(N_,"")}function Gs(e,t,r){if(t=Rc(t),Rc(e)!==t&&r)throw Error(q(425))}function bn(){}var ha=null,da=null;function fa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _a=typeof setTimeout=="function"?setTimeout:void 0,H_=typeof clearTimeout=="function"?clearTimeout:void 0,Tc=typeof Promise=="function"?Promise:void 0,F_=typeof queueMicrotask=="function"?queueMicrotask:typeof Tc<"u"?function(e){return Tc.resolve(null).then(e).catch(j_)}:_a;function j_(e){setTimeout(function(){throw e})}function Mo(e,t){var r=t,i=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(i===0){e.removeChild(s),ms(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);ms(t)}function br(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==="$?")break;if(t==="/$")return null}}return e}function Dc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ui=Math.random().toString(36).slice(2),Wt="__reactFiber$"+Ui,ws="__reactProps$"+Ui,sr="__reactContainer$"+Ui,pa="__reactEvents$"+Ui,z_="__reactListeners$"+Ui,U_="__reactHandles$"+Ui;function $r(e){var t=e[Wt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[sr]||r[Wt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Dc(e);e!==null;){if(r=e[Wt])return r;e=Dc(e)}return t}e=r,r=e.parentNode}return null}function Os(e){return e=e[Wt]||e[sr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function gi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function eo(e){return e[ws]||null}var va=[],yi=-1;function Or(e){return{current:e}}function Le(e){0>yi||(e.current=va[yi],va[yi]=null,yi--)}function Ee(e,t){yi++,va[yi]=e.current,e.current=t}var Dr={},et=Or(Dr),ut=Or(!1),Gr=Dr;function Mi(e,t){var r=e.type.contextTypes;if(!r)return Dr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function ht(e){return e=e.childContextTypes,e!=null}function En(){Le(ut),Le(et)}function Ac(e,t,r){if(et.current!==Dr)throw Error(q(168));Ee(et,t),Ee(ut,r)}function Th(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(q(108,xf(e)||"Unknown",s));return Ae({},r,i)}function xn(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dr,Gr=et.current,Ee(et,e),Ee(ut,ut.current),!0}function Mc(e,t,r){var i=e.stateNode;if(!i)throw Error(q(169));r?(e=Th(e,t,Gr),i.__reactInternalMemoizedMergedChildContext=e,Le(ut),Le(et),Ee(et,e)):Le(ut),Ee(ut,r)}var Qt=null,to=!1,Po=!1;function Dh(e){Qt===null?Qt=[e]:Qt.push(e)}function W_(e){to=!0,Dh(e)}function Br(){if(!Po&&Qt!==null){Po=!0;var e=0,t=we;try{var r=Qt;for(we=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Qt=null,to=!1}catch(s){throw Qt!==null&&(Qt=Qt.slice(e+1)),th(el,Br),s}finally{we=t,Po=!1}}return null}var Si=[],Ci=0,Ln=null,Rn=0,kt=[],bt=0,Yr=null,Jt=1,er="";function Ur(e,t){Si[Ci++]=Rn,Si[Ci++]=Ln,Ln=e,Rn=t}function Ah(e,t,r){kt[bt++]=Jt,kt[bt++]=er,kt[bt++]=Yr,Yr=e;var i=Jt;e=er;var s=32-Bt(i)-1;i&=~(1<<s),r+=1;var a=32-Bt(t)+s;if(30<a){var _=s-s%5;a=(i&(1<<_)-1).toString(32),i>>=_,s-=_,Jt=1<<32-Bt(t)+s|r<<s|i,er=a+e}else Jt=1<<a|r<<s|i,er=e}function cl(e){e.return!==null&&(Ur(e,1),Ah(e,1,0))}function ul(e){for(;e===Ln;)Ln=Si[--Ci],Si[Ci]=null,Rn=Si[--Ci],Si[Ci]=null;for(;e===Yr;)Yr=kt[--bt],kt[bt]=null,er=kt[--bt],kt[bt]=null,Jt=kt[--bt],kt[bt]=null}var mt=null,vt=null,Re=!1,Ot=null;function Mh(e,t){var r=Et(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Pc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,mt=e,vt=br(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mt=e,vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Yr!==null?{id:Jt,overflow:er}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Et(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,mt=e,vt=null,!0):!1;default:return!1}}function ma(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ga(e){if(Re){var t=vt;if(t){var r=t;if(!Pc(e,t)){if(ma(e))throw Error(q(418));t=br(r.nextSibling);var i=mt;t&&Pc(e,t)?Mh(i,r):(e.flags=e.flags&-4097|2,Re=!1,mt=e)}}else{if(ma(e))throw Error(q(418));e.flags=e.flags&-4097|2,Re=!1,mt=e}}}function Oc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function Ys(e){if(e!==mt)return!1;if(!Re)return Oc(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fa(e.type,e.memoizedProps)),t&&(t=vt)){if(ma(e))throw Ph(),Error(q(418));for(;t;)Mh(e,t),t=br(t.nextSibling)}if(Oc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){vt=br(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}vt=null}}else vt=mt?br(e.stateNode.nextSibling):null;return!0}function Ph(){for(var e=vt;e;)e=br(e.nextSibling)}function Pi(){vt=mt=null,Re=!1}function hl(e){Ot===null?Ot=[e]:Ot.push(e)}var $_=lr.ReactCurrentBatchConfig;function Xi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(q(309));var i=r.stateNode}if(!i)throw Error(q(147,e));var s=i,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(_){var n=s.refs;_===null?delete n[a]:n[a]=_},t._stringRef=a,t)}if(typeof e!="string")throw Error(q(284));if(!r._owner)throw Error(q(290,e))}return e}function Qs(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bc(e){var t=e._init;return t(e._payload)}function Oh(e){function t(l,o){if(e){var c=l.deletions;c===null?(l.deletions=[o],l.flags|=16):c.push(o)}}function r(l,o){if(!e)return null;for(;o!==null;)t(l,o),o=o.sibling;return null}function i(l,o){for(l=new Map;o!==null;)o.key!==null?l.set(o.key,o):l.set(o.index,o),o=o.sibling;return l}function s(l,o){return l=Rr(l,o),l.index=0,l.sibling=null,l}function a(l,o,c){return l.index=c,e?(c=l.alternate,c!==null?(c=c.index,c<o?(l.flags|=2,o):c):(l.flags|=2,o)):(l.flags|=1048576,o)}function _(l){return e&&l.alternate===null&&(l.flags|=2),l}function n(l,o,c,p){return o===null||o.tag!==6?(o=jo(c,l.mode,p),o.return=l,o):(o=s(o,c),o.return=l,o)}function u(l,o,c,p){var g=c.type;return g===_i?y(l,o,c.props.children,p,c.key):o!==null&&(o.elementType===g||typeof g=="object"&&g!==null&&g.$$typeof===dr&&Bc(g)===o.type)?(p=s(o,c.props),p.ref=Xi(l,o,c),p.return=l,p):(p=pn(c.type,c.key,c.props,null,l.mode,p),p.ref=Xi(l,o,c),p.return=l,p)}function d(l,o,c,p){return o===null||o.tag!==4||o.stateNode.containerInfo!==c.containerInfo||o.stateNode.implementation!==c.implementation?(o=zo(c,l.mode,p),o.return=l,o):(o=s(o,c.children||[]),o.return=l,o)}function y(l,o,c,p,g){return o===null||o.tag!==7?(o=Xr(c,l.mode,p,g),o.return=l,o):(o=s(o,c),o.return=l,o)}function f(l,o,c){if(typeof o=="string"&&o!==""||typeof o=="number")return o=jo(""+o,l.mode,c),o.return=l,o;if(typeof o=="object"&&o!==null){switch(o.$$typeof){case zs:return c=pn(o.type,o.key,o.props,null,l.mode,c),c.ref=Xi(l,null,o),c.return=l,c;case fi:return o=zo(o,l.mode,c),o.return=l,o;case dr:var p=o._init;return f(l,p(o._payload),c)}if(Ji(o)||$i(o))return o=Xr(o,l.mode,c,null),o.return=l,o;Qs(l,o)}return null}function m(l,o,c,p){var g=o!==null?o.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return g!==null?null:n(l,o,""+c,p);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case zs:return c.key===g?u(l,o,c,p):null;case fi:return c.key===g?d(l,o,c,p):null;case dr:return g=c._init,m(l,o,g(c._payload),p)}if(Ji(c)||$i(c))return g!==null?null:y(l,o,c,p,null);Qs(l,c)}return null}function C(l,o,c,p,g){if(typeof p=="string"&&p!==""||typeof p=="number")return l=l.get(c)||null,n(o,l,""+p,g);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case zs:return l=l.get(p.key===null?c:p.key)||null,u(o,l,p,g);case fi:return l=l.get(p.key===null?c:p.key)||null,d(o,l,p,g);case dr:var w=p._init;return C(l,o,c,w(p._payload),g)}if(Ji(p)||$i(p))return l=l.get(c)||null,y(o,l,p,g,null);Qs(o,p)}return null}function k(l,o,c,p){for(var g=null,w=null,x=o,v=o=0,b=null;x!==null&&v<c.length;v++){x.index>v?(b=x,x=null):b=x.sibling;var R=m(l,x,c[v],p);if(R===null){x===null&&(x=b);break}e&&x&&R.alternate===null&&t(l,x),o=a(R,o,v),w===null?g=R:w.sibling=R,w=R,x=b}if(v===c.length)return r(l,x),Re&&Ur(l,v),g;if(x===null){for(;v<c.length;v++)x=f(l,c[v],p),x!==null&&(o=a(x,o,v),w===null?g=x:w.sibling=x,w=x);return Re&&Ur(l,v),g}for(x=i(l,x);v<c.length;v++)b=C(x,l,v,c[v],p),b!==null&&(e&&b.alternate!==null&&x.delete(b.key===null?v:b.key),o=a(b,o,v),w===null?g=b:w.sibling=b,w=b);return e&&x.forEach(function(O){return t(l,O)}),Re&&Ur(l,v),g}function S(l,o,c,p){var g=$i(c);if(typeof g!="function")throw Error(q(150));if(c=g.call(c),c==null)throw Error(q(151));for(var w=g=null,x=o,v=o=0,b=null,R=c.next();x!==null&&!R.done;v++,R=c.next()){x.index>v?(b=x,x=null):b=x.sibling;var O=m(l,x,R.value,p);if(O===null){x===null&&(x=b);break}e&&x&&O.alternate===null&&t(l,x),o=a(O,o,v),w===null?g=O:w.sibling=O,w=O,x=b}if(R.done)return r(l,x),Re&&Ur(l,v),g;if(x===null){for(;!R.done;v++,R=c.next())R=f(l,R.value,p),R!==null&&(o=a(R,o,v),w===null?g=R:w.sibling=R,w=R);return Re&&Ur(l,v),g}for(x=i(l,x);!R.done;v++,R=c.next())R=C(x,l,v,R.value,p),R!==null&&(e&&R.alternate!==null&&x.delete(R.key===null?v:R.key),o=a(R,o,v),w===null?g=R:w.sibling=R,w=R);return e&&x.forEach(function(A){return t(l,A)}),Re&&Ur(l,v),g}function h(l,o,c,p){if(typeof c=="object"&&c!==null&&c.type===_i&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case zs:e:{for(var g=c.key,w=o;w!==null;){if(w.key===g){if(g=c.type,g===_i){if(w.tag===7){r(l,w.sibling),o=s(w,c.props.children),o.return=l,l=o;break e}}else if(w.elementType===g||typeof g=="object"&&g!==null&&g.$$typeof===dr&&Bc(g)===w.type){r(l,w.sibling),o=s(w,c.props),o.ref=Xi(l,w,c),o.return=l,l=o;break e}r(l,w);break}else t(l,w);w=w.sibling}c.type===_i?(o=Xr(c.props.children,l.mode,p,c.key),o.return=l,l=o):(p=pn(c.type,c.key,c.props,null,l.mode,p),p.ref=Xi(l,o,c),p.return=l,l=p)}return _(l);case fi:e:{for(w=c.key;o!==null;){if(o.key===w)if(o.tag===4&&o.stateNode.containerInfo===c.containerInfo&&o.stateNode.implementation===c.implementation){r(l,o.sibling),o=s(o,c.children||[]),o.return=l,l=o;break e}else{r(l,o);break}else t(l,o);o=o.sibling}o=zo(c,l.mode,p),o.return=l,l=o}return _(l);case dr:return w=c._init,h(l,o,w(c._payload),p)}if(Ji(c))return k(l,o,c,p);if($i(c))return S(l,o,c,p);Qs(l,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,o!==null&&o.tag===6?(r(l,o.sibling),o=s(o,c),o.return=l,l=o):(r(l,o),o=jo(c,l.mode,p),o.return=l,l=o),_(l)):r(l,o)}return h}var Oi=Oh(!0),Bh=Oh(!1),Tn=Or(null),Dn=null,wi=null,dl=null;function fl(){dl=wi=Dn=null}function _l(e){var t=Tn.current;Le(Tn),e._currentValue=t}function ya(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Ti(e,t){Dn=e,dl=wi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ct=!0),e.firstContext=null)}function Lt(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},wi===null){if(Dn===null)throw Error(q(308));wi=e,Dn.dependencies={lanes:0,firstContext:e}}else wi=wi.next=e;return t}var Vr=null;function pl(e){Vr===null?Vr=[e]:Vr.push(e)}function Ih(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,pl(t)):(r.next=s.next,s.next=r),t.interleaved=r,nr(e,i)}function nr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fr=!1;function vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Er(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ge&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,nr(e,r)}return s=i.interleaved,s===null?(t.next=t,pl(i)):(t.next=s.next,s.next=t),i.interleaved=t,nr(e,r)}function cn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,tl(e,r)}}function Ic(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var _={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=_:a=a.next=_,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function An(e,t,r,i){var s=e.updateQueue;fr=!1;var a=s.firstBaseUpdate,_=s.lastBaseUpdate,n=s.shared.pending;if(n!==null){s.shared.pending=null;var u=n,d=u.next;u.next=null,_===null?a=d:_.next=d,_=u;var y=e.alternate;y!==null&&(y=y.updateQueue,n=y.lastBaseUpdate,n!==_&&(n===null?y.firstBaseUpdate=d:n.next=d,y.lastBaseUpdate=u))}if(a!==null){var f=s.baseState;_=0,y=d=u=null,n=a;do{var m=n.lane,C=n.eventTime;if((i&m)===m){y!==null&&(y=y.next={eventTime:C,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var k=e,S=n;switch(m=t,C=r,S.tag){case 1:if(k=S.payload,typeof k=="function"){f=k.call(C,f,m);break e}f=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=S.payload,m=typeof k=="function"?k.call(C,f,m):k,m==null)break e;f=Ae({},f,m);break e;case 2:fr=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[n]:m.push(n))}else C={eventTime:C,lane:m,tag:n.tag,payload:n.payload,callback:n.callback,next:null},y===null?(d=y=C,u=f):y=y.next=C,_|=m;if(n=n.next,n===null){if(n=s.shared.pending,n===null)break;m=n,n=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(y===null&&(u=f),s.baseState=u,s.firstBaseUpdate=d,s.lastBaseUpdate=y,t=s.shared.interleaved,t!==null){s=t;do _|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);Jr|=_,e.lanes=_,e.memoizedState=f}}function Nc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=r,typeof s!="function")throw Error(q(191,s));s.call(i)}}}var Bs={},Vt=Or(Bs),ks=Or(Bs),bs=Or(Bs);function Kr(e){if(e===Bs)throw Error(q(174));return e}function ml(e,t){switch(Ee(bs,t),Ee(ks,e),Ee(Vt,Bs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jo(t,e)}Le(Vt),Ee(Vt,t)}function Bi(){Le(Vt),Le(ks),Le(bs)}function Hh(e){Kr(bs.current);var t=Kr(Vt.current),r=Jo(t,e.type);t!==r&&(Ee(ks,e),Ee(Vt,r))}function gl(e){ks.current===e&&(Le(Vt),Le(ks))}var Te=Or(0);function Mn(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Oo=[];function yl(){for(var e=0;e<Oo.length;e++)Oo[e]._workInProgressVersionPrimary=null;Oo.length=0}var un=lr.ReactCurrentDispatcher,Bo=lr.ReactCurrentBatchConfig,Qr=0,De=null,Fe=null,We=null,Pn=!1,ls=!1,Es=0,V_=0;function Ge(){throw Error(q(321))}function Sl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nt(e[r],t[r]))return!1;return!0}function Cl(e,t,r,i,s,a){if(Qr=a,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,un.current=e===null||e.memoizedState===null?X_:G_,e=r(i,s),ls){a=0;do{if(ls=!1,Es=0,25<=a)throw Error(q(301));a+=1,We=Fe=null,t.updateQueue=null,un.current=Y_,e=r(i,s)}while(ls)}if(un.current=On,t=Fe!==null&&Fe.next!==null,Qr=0,We=Fe=De=null,Pn=!1,t)throw Error(q(300));return e}function wl(){var e=Es!==0;return Es=0,e}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?De.memoizedState=We=e:We=We.next=e,We}function Rt(){if(Fe===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=We===null?De.memoizedState:We.next;if(t!==null)We=t,Fe=e;else{if(e===null)throw Error(q(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},We===null?De.memoizedState=We=e:We=We.next=e}return We}function xs(e,t){return typeof t=="function"?t(e):t}function Io(e){var t=Rt(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var i=Fe,s=i.baseQueue,a=r.pending;if(a!==null){if(s!==null){var _=s.next;s.next=a.next,a.next=_}i.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,i=i.baseState;var n=_=null,u=null,d=a;do{var y=d.lane;if((Qr&y)===y)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var f={lane:y,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(n=u=f,_=i):u=u.next=f,De.lanes|=y,Jr|=y}d=d.next}while(d!==null&&d!==a);u===null?_=i:u.next=n,Nt(i,t.memoizedState)||(ct=!0),t.memoizedState=i,t.baseState=_,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do a=s.lane,De.lanes|=a,Jr|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function No(e){var t=Rt(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var i=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var _=s=s.next;do a=e(a,_.action),_=_.next;while(_!==s);Nt(a,t.memoizedState)||(ct=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,i]}function Fh(){}function jh(e,t){var r=De,i=Rt(),s=t(),a=!Nt(i.memoizedState,s);if(a&&(i.memoizedState=s,ct=!0),i=i.queue,kl(Wh.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||We!==null&&We.memoizedState.tag&1){if(r.flags|=2048,Ls(9,Uh.bind(null,r,i,s,t),void 0,null),$e===null)throw Error(q(349));Qr&30||zh(r,t,s)}return s}function zh(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Uh(e,t,r,i){t.value=r,t.getSnapshot=i,$h(t)&&Vh(e)}function Wh(e,t,r){return r(function(){$h(t)&&Vh(e)})}function $h(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nt(e,r)}catch{return!0}}function Vh(e){var t=nr(e,1);t!==null&&It(t,e,1,-1)}function Hc(e){var t=Ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:e},t.queue=e,e=e.dispatch=q_.bind(null,De,e),[t.memoizedState,e]}function Ls(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Kh(){return Rt().memoizedState}function hn(e,t,r,i){var s=Ut();De.flags|=e,s.memoizedState=Ls(1|t,r,void 0,i===void 0?null:i)}function ro(e,t,r,i){var s=Rt();i=i===void 0?null:i;var a=void 0;if(Fe!==null){var _=Fe.memoizedState;if(a=_.destroy,i!==null&&Sl(i,_.deps)){s.memoizedState=Ls(t,r,a,i);return}}De.flags|=e,s.memoizedState=Ls(1|t,r,a,i)}function Fc(e,t){return hn(8390656,8,e,t)}function kl(e,t){return ro(2048,8,e,t)}function Zh(e,t){return ro(4,2,e,t)}function qh(e,t){return ro(4,4,e,t)}function Xh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gh(e,t,r){return r=r!=null?r.concat([e]):null,ro(4,4,Xh.bind(null,t,e),r)}function bl(){}function Yh(e,t){var r=Rt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Sl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Qh(e,t){var r=Rt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Sl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Jh(e,t,r){return Qr&21?(Nt(r,t)||(r=sh(),De.lanes|=r,Jr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ct=!0),e.memoizedState=r)}function K_(e,t){var r=we;we=r!==0&&4>r?r:4,e(!0);var i=Bo.transition;Bo.transition={};try{e(!1),t()}finally{we=r,Bo.transition=i}}function ed(){return Rt().memoizedState}function Z_(e,t,r){var i=Lr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},td(e))rd(t,r);else if(r=Ih(e,t,r,i),r!==null){var s=it();It(r,e,i,s),id(r,t,i)}}function q_(e,t,r){var i=Lr(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(td(e))rd(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var _=t.lastRenderedState,n=a(_,r);if(s.hasEagerState=!0,s.eagerState=n,Nt(n,_)){var u=t.interleaved;u===null?(s.next=s,pl(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}r=Ih(e,t,s,i),r!==null&&(s=it(),It(r,e,i,s),id(r,t,i))}}function td(e){var t=e.alternate;return e===De||t!==null&&t===De}function rd(e,t){ls=Pn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function id(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,tl(e,r)}}var On={readContext:Lt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},X_={readContext:Lt,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Fc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,hn(4194308,4,Xh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return hn(4194308,4,e,t)},useInsertionEffect:function(e,t){return hn(4,2,e,t)},useMemo:function(e,t){var r=Ut();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ut();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Z_.bind(null,De,e),[i.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:Hc,useDebugValue:bl,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=Hc(!1),t=e[0];return e=K_.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=De,s=Ut();if(Re){if(r===void 0)throw Error(q(407));r=r()}else{if(r=t(),$e===null)throw Error(q(349));Qr&30||zh(i,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,Fc(Wh.bind(null,i,a,e),[e]),i.flags|=2048,Ls(9,Uh.bind(null,i,a,r,t),void 0,null),r},useId:function(){var e=Ut(),t=$e.identifierPrefix;if(Re){var r=er,i=Jt;r=(i&~(1<<32-Bt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Es++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=V_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},G_={readContext:Lt,useCallback:Yh,useContext:Lt,useEffect:kl,useImperativeHandle:Gh,useInsertionEffect:Zh,useLayoutEffect:qh,useMemo:Qh,useReducer:Io,useRef:Kh,useState:function(){return Io(xs)},useDebugValue:bl,useDeferredValue:function(e){var t=Rt();return Jh(t,Fe.memoizedState,e)},useTransition:function(){var e=Io(xs)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Fh,useSyncExternalStore:jh,useId:ed,unstable_isNewReconciler:!1},Y_={readContext:Lt,useCallback:Yh,useContext:Lt,useEffect:kl,useImperativeHandle:Gh,useInsertionEffect:Zh,useLayoutEffect:qh,useMemo:Qh,useReducer:No,useRef:Kh,useState:function(){return No(xs)},useDebugValue:bl,useDeferredValue:function(e){var t=Rt();return Fe===null?t.memoizedState=e:Jh(t,Fe.memoizedState,e)},useTransition:function(){var e=No(xs)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:Fh,useSyncExternalStore:jh,useId:ed,unstable_isNewReconciler:!1};function Mt(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Sa(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ae({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var io={isMounted:function(e){return(e=e._reactInternals)?oi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=it(),s=Lr(e),a=tr(i,s);a.payload=t,r!=null&&(a.callback=r),t=Er(e,a,s),t!==null&&(It(t,e,s,i),cn(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=it(),s=Lr(e),a=tr(i,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Er(e,a,s),t!==null&&(It(t,e,s,i),cn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=it(),i=Lr(e),s=tr(r,i);s.tag=2,t!=null&&(s.callback=t),t=Er(e,s,i),t!==null&&(It(t,e,i,r),cn(t,e,i))}};function jc(e,t,r,i,s,a,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,a,_):t.prototype&&t.prototype.isPureReactComponent?!ys(r,i)||!ys(s,a):!0}function sd(e,t,r){var i=!1,s=Dr,a=t.contextType;return typeof a=="object"&&a!==null?a=Lt(a):(s=ht(t)?Gr:et.current,i=t.contextTypes,a=(i=i!=null)?Mi(e,s):Dr),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=io,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function zc(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&io.enqueueReplaceState(t,t.state,null)}function Ca(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},vl(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=Lt(a):(a=ht(t)?Gr:et.current,s.context=Mi(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Sa(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&io.enqueueReplaceState(s,s.state,null),An(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ii(e,t){try{var r="",i=t;do r+=Ef(i),i=i.return;while(i);var s=r}catch(a){s=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:s,digest:null}}function Ho(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function wa(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Q_=typeof WeakMap=="function"?WeakMap:Map;function nd(e,t,r){r=tr(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){In||(In=!0,Ma=i),wa(e,t)},r}function od(e,t,r){r=tr(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;r.payload=function(){return i(s)},r.callback=function(){wa(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){wa(e,t),typeof i!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),r}function Uc(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Q_;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(r)||(s.add(r),e=dp.bind(null,e,t,r),t.then(e,e))}function Wc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $c(e,t,r,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=tr(-1,1),t.tag=2,Er(r,t,1))),r.lanes|=1),e)}var J_=lr.ReactCurrentOwner,ct=!1;function rt(e,t,r,i){t.child=e===null?Bh(t,null,r,i):Oi(t,e.child,r,i)}function Vc(e,t,r,i,s){r=r.render;var a=t.ref;return Ti(t,s),i=Cl(e,t,r,i,a,s),r=wl(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(Re&&r&&cl(t),t.flags|=1,rt(e,t,i,s),t.child)}function Kc(e,t,r,i,s){if(e===null){var a=r.type;return typeof a=="function"&&!Ml(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,ad(e,t,a,i,s)):(e=pn(r.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var _=a.memoizedProps;if(r=r.compare,r=r!==null?r:ys,r(_,i)&&e.ref===t.ref)return or(e,t,s)}return t.flags|=1,e=Rr(a,i),e.ref=t.ref,e.return=t,t.child=e}function ad(e,t,r,i,s){if(e!==null){var a=e.memoizedProps;if(ys(a,i)&&e.ref===t.ref)if(ct=!1,t.pendingProps=i=a,(e.lanes&s)!==0)e.flags&131072&&(ct=!0);else return t.lanes=e.lanes,or(e,t,s)}return ka(e,t,r,i,s)}function ld(e,t,r){var i=t.pendingProps,s=i.children,a=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(bi,pt),pt|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ee(bi,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=a!==null?a.baseLanes:r,Ee(bi,pt),pt|=i}else a!==null?(i=a.baseLanes|r,t.memoizedState=null):i=r,Ee(bi,pt),pt|=i;return rt(e,t,s,r),t.child}function cd(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ka(e,t,r,i,s){var a=ht(r)?Gr:et.current;return a=Mi(t,a),Ti(t,s),r=Cl(e,t,r,i,a,s),i=wl(),e!==null&&!ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(Re&&i&&cl(t),t.flags|=1,rt(e,t,r,s),t.child)}function Zc(e,t,r,i,s){if(ht(r)){var a=!0;xn(t)}else a=!1;if(Ti(t,s),t.stateNode===null)dn(e,t),sd(t,r,i),Ca(t,r,i,s),i=!0;else if(e===null){var _=t.stateNode,n=t.memoizedProps;_.props=n;var u=_.context,d=r.contextType;typeof d=="object"&&d!==null?d=Lt(d):(d=ht(r)?Gr:et.current,d=Mi(t,d));var y=r.getDerivedStateFromProps,f=typeof y=="function"||typeof _.getSnapshotBeforeUpdate=="function";f||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(n!==i||u!==d)&&zc(t,_,i,d),fr=!1;var m=t.memoizedState;_.state=m,An(t,i,_,s),u=t.memoizedState,n!==i||m!==u||ut.current||fr?(typeof y=="function"&&(Sa(t,r,y,i),u=t.memoizedState),(n=fr||jc(t,r,n,i,m,u,d))?(f||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),_.props=i,_.state=u,_.context=d,i=n):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{_=t.stateNode,Nh(e,t),n=t.memoizedProps,d=t.type===t.elementType?n:Mt(t.type,n),_.props=d,f=t.pendingProps,m=_.context,u=r.contextType,typeof u=="object"&&u!==null?u=Lt(u):(u=ht(r)?Gr:et.current,u=Mi(t,u));var C=r.getDerivedStateFromProps;(y=typeof C=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(n!==f||m!==u)&&zc(t,_,i,u),fr=!1,m=t.memoizedState,_.state=m,An(t,i,_,s);var k=t.memoizedState;n!==f||m!==k||ut.current||fr?(typeof C=="function"&&(Sa(t,r,C,i),k=t.memoizedState),(d=fr||jc(t,r,d,i,m,k,u)||!1)?(y||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(i,k,u),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(i,k,u)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=k),_.props=i,_.state=k,_.context=u,i=d):(typeof _.componentDidUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),i=!1)}return ba(e,t,r,i,a,s)}function ba(e,t,r,i,s,a){cd(e,t);var _=(t.flags&128)!==0;if(!i&&!_)return s&&Mc(t,r,!1),or(e,t,a);i=t.stateNode,J_.current=t;var n=_&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&_?(t.child=Oi(t,e.child,null,a),t.child=Oi(t,null,n,a)):rt(e,t,n,a),t.memoizedState=i.state,s&&Mc(t,r,!0),t.child}function ud(e){var t=e.stateNode;t.pendingContext?Ac(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ac(e,t.context,!1),ml(e,t.containerInfo)}function qc(e,t,r,i,s){return Pi(),hl(s),t.flags|=256,rt(e,t,r,i),t.child}var Ea={dehydrated:null,treeContext:null,retryLane:0};function xa(e){return{baseLanes:e,cachePool:null,transitions:null}}function hd(e,t,r){var i=t.pendingProps,s=Te.current,a=!1,_=(t.flags&128)!==0,n;if((n=_)||(n=e!==null&&e.memoizedState===null?!1:(s&2)!==0),n?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ee(Te,s&1),e===null)return ga(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(_=i.children,e=i.fallback,a?(i=t.mode,a=t.child,_={mode:"hidden",children:_},!(i&1)&&a!==null?(a.childLanes=0,a.pendingProps=_):a=oo(_,i,0,null),e=Xr(e,i,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=xa(r),t.memoizedState=Ea,e):El(t,_));if(s=e.memoizedState,s!==null&&(n=s.dehydrated,n!==null))return ep(e,t,_,i,n,s,r);if(a){a=i.fallback,_=t.mode,s=e.child,n=s.sibling;var u={mode:"hidden",children:i.children};return!(_&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=Rr(s,u),i.subtreeFlags=s.subtreeFlags&14680064),n!==null?a=Rr(n,a):(a=Xr(a,_,r,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,_=e.child.memoizedState,_=_===null?xa(r):{baseLanes:_.baseLanes|r,cachePool:null,transitions:_.transitions},a.memoizedState=_,a.childLanes=e.childLanes&~r,t.memoizedState=Ea,i}return a=e.child,e=a.sibling,i=Rr(a,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function El(e,t){return t=oo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Js(e,t,r,i){return i!==null&&hl(i),Oi(t,e.child,null,r),e=El(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ep(e,t,r,i,s,a,_){if(r)return t.flags&256?(t.flags&=-257,i=Ho(Error(q(422))),Js(e,t,_,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=i.fallback,s=t.mode,i=oo({mode:"visible",children:i.children},s,0,null),a=Xr(a,s,_,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,t.mode&1&&Oi(t,e.child,null,_),t.child.memoizedState=xa(_),t.memoizedState=Ea,a);if(!(t.mode&1))return Js(e,t,_,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var n=i.dgst;return i=n,a=Error(q(419)),i=Ho(a,i,void 0),Js(e,t,_,i)}if(n=(_&e.childLanes)!==0,ct||n){if(i=$e,i!==null){switch(_&-_){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|_)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,nr(e,s),It(i,e,s,-1))}return Al(),i=Ho(Error(q(421))),Js(e,t,_,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=fp.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,vt=br(s.nextSibling),mt=t,Re=!0,Ot=null,e!==null&&(kt[bt++]=Jt,kt[bt++]=er,kt[bt++]=Yr,Jt=e.id,er=e.overflow,Yr=t),t=El(t,i.children),t.flags|=4096,t)}function Xc(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ya(e.return,t,r)}function Fo(e,t,r,i,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=r,a.tailMode=s)}function dd(e,t,r){var i=t.pendingProps,s=i.revealOrder,a=i.tail;if(rt(e,t,i.children,r),i=Te.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,r,t);else if(e.tag===19)Xc(e,r,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}i&=1}if(Ee(Te,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Mn(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Fo(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Mn(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Fo(t,!0,r,null,a);break;case"together":Fo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function dn(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function or(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Jr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,r=Rr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Rr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function tp(e,t,r){switch(t.tag){case 3:ud(t),Pi();break;case 5:Hh(t);break;case 1:ht(t.type)&&xn(t);break;case 4:ml(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;Ee(Tn,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Ee(Te,Te.current&1),t.flags|=128,null):r&t.child.childLanes?hd(e,t,r):(Ee(Te,Te.current&1),e=or(e,t,r),e!==null?e.sibling:null);Ee(Te,Te.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return dd(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ee(Te,Te.current),i)break;return null;case 22:case 23:return t.lanes=0,ld(e,t,r)}return or(e,t,r)}var fd,La,_d,pd;fd=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};La=function(){};_d=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,Kr(Vt.current);var a=null;switch(r){case"input":s=Xo(e,s),i=Xo(e,i),a=[];break;case"select":s=Ae({},s,{value:void 0}),i=Ae({},i,{value:void 0}),a=[];break;case"textarea":s=Qo(e,s),i=Qo(e,i),a=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=bn)}ea(r,i);var _;r=null;for(d in s)if(!i.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var n=s[d];for(_ in n)n.hasOwnProperty(_)&&(r||(r={}),r[_]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ds.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in i){var u=i[d];if(n=s!=null?s[d]:void 0,i.hasOwnProperty(d)&&u!==n&&(u!=null||n!=null))if(d==="style")if(n){for(_ in n)!n.hasOwnProperty(_)||u&&u.hasOwnProperty(_)||(r||(r={}),r[_]="");for(_ in u)u.hasOwnProperty(_)&&n[_]!==u[_]&&(r||(r={}),r[_]=u[_])}else r||(a||(a=[]),a.push(d,r)),r=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,n=n?n.__html:void 0,u!=null&&n!==u&&(a=a||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ds.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&xe("scroll",e),a||n===u||(a=[])):(a=a||[]).push(d,u))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};pd=function(e,t,r,i){r!==i&&(t.flags|=4)};function Gi(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function rp(e,t,r){var i=t.pendingProps;switch(ul(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(t),null;case 1:return ht(t.type)&&En(),Ye(t),null;case 3:return i=t.stateNode,Bi(),Le(ut),Le(et),yl(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ys(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ot!==null&&(Ba(Ot),Ot=null))),La(e,t),Ye(t),null;case 5:gl(t);var s=Kr(bs.current);if(r=t.type,e!==null&&t.stateNode!=null)_d(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(q(166));return Ye(t),null}if(e=Kr(Vt.current),Ys(t)){i=t.stateNode,r=t.type;var a=t.memoizedProps;switch(i[Wt]=t,i[ws]=a,e=(t.mode&1)!==0,r){case"dialog":xe("cancel",i),xe("close",i);break;case"iframe":case"object":case"embed":xe("load",i);break;case"video":case"audio":for(s=0;s<ts.length;s++)xe(ts[s],i);break;case"source":xe("error",i);break;case"img":case"image":case"link":xe("error",i),xe("load",i);break;case"details":xe("toggle",i);break;case"input":sc(i,a),xe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},xe("invalid",i);break;case"textarea":oc(i,a),xe("invalid",i)}ea(r,a),s=null;for(var _ in a)if(a.hasOwnProperty(_)){var n=a[_];_==="children"?typeof n=="string"?i.textContent!==n&&(a.suppressHydrationWarning!==!0&&Gs(i.textContent,n,e),s=["children",n]):typeof n=="number"&&i.textContent!==""+n&&(a.suppressHydrationWarning!==!0&&Gs(i.textContent,n,e),s=["children",""+n]):ds.hasOwnProperty(_)&&n!=null&&_==="onScroll"&&xe("scroll",i)}switch(r){case"input":Us(i),nc(i,a,!0);break;case"textarea":Us(i),ac(i);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(i.onclick=bn)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{_=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Wu(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=_.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=_.createElement(r,{is:i.is}):(e=_.createElement(r),r==="select"&&(_=e,i.multiple?_.multiple=!0:i.size&&(_.size=i.size))):e=_.createElementNS(e,r),e[Wt]=t,e[ws]=i,fd(e,t,!1,!1),t.stateNode=e;e:{switch(_=ta(r,i),r){case"dialog":xe("cancel",e),xe("close",e),s=i;break;case"iframe":case"object":case"embed":xe("load",e),s=i;break;case"video":case"audio":for(s=0;s<ts.length;s++)xe(ts[s],e);s=i;break;case"source":xe("error",e),s=i;break;case"img":case"image":case"link":xe("error",e),xe("load",e),s=i;break;case"details":xe("toggle",e),s=i;break;case"input":sc(e,i),s=Xo(e,i),xe("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=Ae({},i,{value:void 0}),xe("invalid",e);break;case"textarea":oc(e,i),s=Qo(e,i),xe("invalid",e);break;default:s=i}ea(r,s),n=s;for(a in n)if(n.hasOwnProperty(a)){var u=n[a];a==="style"?Ku(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&$u(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&fs(e,u):typeof u=="number"&&fs(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ds.hasOwnProperty(a)?u!=null&&a==="onScroll"&&xe("scroll",e):u!=null&&Xa(e,a,u,_))}switch(r){case"input":Us(e),nc(e,i,!1);break;case"textarea":Us(e),ac(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Tr(i.value));break;case"select":e.multiple=!!i.multiple,a=i.value,a!=null?Ei(e,!!i.multiple,a,!1):i.defaultValue!=null&&Ei(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=bn)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ye(t),null;case 6:if(e&&t.stateNode!=null)pd(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(q(166));if(r=Kr(bs.current),Kr(Vt.current),Ys(t)){if(i=t.stateNode,r=t.memoizedProps,i[Wt]=t,(a=i.nodeValue!==r)&&(e=mt,e!==null))switch(e.tag){case 3:Gs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gs(i.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Wt]=t,t.stateNode=i}return Ye(t),null;case 13:if(Le(Te),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&vt!==null&&t.mode&1&&!(t.flags&128))Ph(),Pi(),t.flags|=98560,a=!1;else if(a=Ys(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(q(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(q(317));a[Wt]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ye(t),a=!1}else Ot!==null&&(Ba(Ot),Ot=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Te.current&1?je===0&&(je=3):Al())),t.updateQueue!==null&&(t.flags|=4),Ye(t),null);case 4:return Bi(),La(e,t),e===null&&Ss(t.stateNode.containerInfo),Ye(t),null;case 10:return _l(t.type._context),Ye(t),null;case 17:return ht(t.type)&&En(),Ye(t),null;case 19:if(Le(Te),a=t.memoizedState,a===null)return Ye(t),null;if(i=(t.flags&128)!==0,_=a.rendering,_===null)if(i)Gi(a,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(_=Mn(e),_!==null){for(t.flags|=128,Gi(a,!1),i=_.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)a=r,e=i,a.flags&=14680066,_=a.alternate,_===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=_.childLanes,a.lanes=_.lanes,a.child=_.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=_.memoizedProps,a.memoizedState=_.memoizedState,a.updateQueue=_.updateQueue,a.type=_.type,e=_.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ee(Te,Te.current&1|2),t.child}e=e.sibling}a.tail!==null&&Oe()>Ni&&(t.flags|=128,i=!0,Gi(a,!1),t.lanes=4194304)}else{if(!i)if(e=Mn(_),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Gi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!_.alternate&&!Re)return Ye(t),null}else 2*Oe()-a.renderingStartTime>Ni&&r!==1073741824&&(t.flags|=128,i=!0,Gi(a,!1),t.lanes=4194304);a.isBackwards?(_.sibling=t.child,t.child=_):(r=a.last,r!==null?r.sibling=_:t.child=_,a.last=_)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Oe(),t.sibling=null,r=Te.current,Ee(Te,i?r&1|2:r&1),t):(Ye(t),null);case 22:case 23:return Dl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?pt&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function ip(e,t){switch(ul(t),t.tag){case 1:return ht(t.type)&&En(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bi(),Le(ut),Le(et),yl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gl(t),null;case 13:if(Le(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(Te),null;case 4:return Bi(),null;case 10:return _l(t.type._context),null;case 22:case 23:return Dl(),null;case 24:return null;default:return null}}var en=!1,Je=!1,sp=typeof WeakSet=="function"?WeakSet:Set,te=null;function ki(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Me(e,t,i)}else r.current=null}function Ra(e,t,r){try{r()}catch(i){Me(e,t,i)}}var Gc=!1;function np(e,t){if(ha=Cn,e=Sh(),ll(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var s=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var _=0,n=-1,u=-1,d=0,y=0,f=e,m=null;t:for(;;){for(var C;f!==r||s!==0&&f.nodeType!==3||(n=_+s),f!==a||i!==0&&f.nodeType!==3||(u=_+i),f.nodeType===3&&(_+=f.nodeValue.length),(C=f.firstChild)!==null;)m=f,f=C;for(;;){if(f===e)break t;if(m===r&&++d===s&&(n=_),m===a&&++y===i&&(u=_),(C=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=C}r=n===-1||u===-1?null:{start:n,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(da={focusedElem:e,selectionRange:r},Cn=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var S=k.memoizedProps,h=k.memoizedState,l=t.stateNode,o=l.getSnapshotBeforeUpdate(t.elementType===t.type?S:Mt(t.type,S),h);l.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(p){Me(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return k=Gc,Gc=!1,k}function cs(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Ra(t,r,a)}s=s.next}while(s!==i)}}function so(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Ta(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vd(e){var t=e.alternate;t!==null&&(e.alternate=null,vd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[ws],delete t[pa],delete t[z_],delete t[U_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function md(e){return e.tag===5||e.tag===3||e.tag===4}function Yc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||md(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.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 Da(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=bn));else if(i!==4&&(e=e.child,e!==null))for(Da(e,t,r),e=e.sibling;e!==null;)Da(e,t,r),e=e.sibling}function Aa(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Aa(e,t,r),e=e.sibling;e!==null;)Aa(e,t,r),e=e.sibling}var Ve=null,Pt=!1;function hr(e,t,r){for(r=r.child;r!==null;)gd(e,t,r),r=r.sibling}function gd(e,t,r){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Gn,r)}catch{}switch(r.tag){case 5:Je||ki(r,t);case 6:var i=Ve,s=Pt;Ve=null,hr(e,t,r),Ve=i,Pt=s,Ve!==null&&(Pt?(e=Ve,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ve.removeChild(r.stateNode));break;case 18:Ve!==null&&(Pt?(e=Ve,r=r.stateNode,e.nodeType===8?Mo(e.parentNode,r):e.nodeType===1&&Mo(e,r),ms(e)):Mo(Ve,r.stateNode));break;case 4:i=Ve,s=Pt,Ve=r.stateNode.containerInfo,Pt=!0,hr(e,t,r),Ve=i,Pt=s;break;case 0:case 11:case 14:case 15:if(!Je&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var a=s,_=a.destroy;a=a.tag,_!==void 0&&(a&2||a&4)&&Ra(r,t,_),s=s.next}while(s!==i)}hr(e,t,r);break;case 1:if(!Je&&(ki(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(n){Me(r,t,n)}hr(e,t,r);break;case 21:hr(e,t,r);break;case 22:r.mode&1?(Je=(i=Je)||r.memoizedState!==null,hr(e,t,r),Je=i):hr(e,t,r);break;default:hr(e,t,r)}}function Qc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new sp),t.forEach(function(i){var s=_p.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function At(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];try{var a=e,_=t,n=_;e:for(;n!==null;){switch(n.tag){case 5:Ve=n.stateNode,Pt=!1;break e;case 3:Ve=n.stateNode.containerInfo,Pt=!0;break e;case 4:Ve=n.stateNode.containerInfo,Pt=!0;break e}n=n.return}if(Ve===null)throw Error(q(160));gd(a,_,s),Ve=null,Pt=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(d){Me(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yd(t,e),t=t.sibling}function yd(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(At(t,e),zt(e),i&4){try{cs(3,e,e.return),so(3,e)}catch(S){Me(e,e.return,S)}try{cs(5,e,e.return)}catch(S){Me(e,e.return,S)}}break;case 1:At(t,e),zt(e),i&512&&r!==null&&ki(r,r.return);break;case 5:if(At(t,e),zt(e),i&512&&r!==null&&ki(r,r.return),e.flags&32){var s=e.stateNode;try{fs(s,"")}catch(S){Me(e,e.return,S)}}if(i&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,_=r!==null?r.memoizedProps:a,n=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{n==="input"&&a.type==="radio"&&a.name!=null&&zu(s,a),ta(n,_);var d=ta(n,a);for(_=0;_<u.length;_+=2){var y=u[_],f=u[_+1];y==="style"?Ku(s,f):y==="dangerouslySetInnerHTML"?$u(s,f):y==="children"?fs(s,f):Xa(s,y,f,d)}switch(n){case"input":Go(s,a);break;case"textarea":Uu(s,a);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var C=a.value;C!=null?Ei(s,!!a.multiple,C,!1):m!==!!a.multiple&&(a.defaultValue!=null?Ei(s,!!a.multiple,a.defaultValue,!0):Ei(s,!!a.multiple,a.multiple?[]:"",!1))}s[ws]=a}catch(S){Me(e,e.return,S)}}break;case 6:if(At(t,e),zt(e),i&4){if(e.stateNode===null)throw Error(q(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(S){Me(e,e.return,S)}}break;case 3:if(At(t,e),zt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ms(t.containerInfo)}catch(S){Me(e,e.return,S)}break;case 4:At(t,e),zt(e);break;case 13:At(t,e),zt(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Rl=Oe())),i&4&&Qc(e);break;case 22:if(y=r!==null&&r.memoizedState!==null,e.mode&1?(Je=(d=Je)||y,At(t,e),Je=d):At(t,e),zt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!y&&e.mode&1)for(te=e,y=e.child;y!==null;){for(f=te=y;te!==null;){switch(m=te,C=m.child,m.tag){case 0:case 11:case 14:case 15:cs(4,m,m.return);break;case 1:ki(m,m.return);var k=m.stateNode;if(typeof k.componentWillUnmount=="function"){i=m,r=m.return;try{t=i,k.props=t.memoizedProps,k.state=t.memoizedState,k.componentWillUnmount()}catch(S){Me(i,r,S)}}break;case 5:ki(m,m.return);break;case 22:if(m.memoizedState!==null){eu(f);continue}}C!==null?(C.return=m,te=C):eu(f)}y=y.sibling}e:for(y=null,f=e;;){if(f.tag===5){if(y===null){y=f;try{s=f.stateNode,d?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(n=f.stateNode,u=f.memoizedProps.style,_=u!=null&&u.hasOwnProperty("display")?u.display:null,n.style.display=Vu("display",_))}catch(S){Me(e,e.return,S)}}}else if(f.tag===6){if(y===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(S){Me(e,e.return,S)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;y===f&&(y=null),f=f.return}y===f&&(y=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:At(t,e),zt(e),i&4&&Qc(e);break;case 21:break;default:At(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(md(r)){var i=r;break e}r=r.return}throw Error(q(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(fs(s,""),i.flags&=-33);var a=Yc(e);Aa(e,a,s);break;case 3:case 4:var _=i.stateNode.containerInfo,n=Yc(e);Da(e,n,_);break;default:throw Error(q(161))}}catch(u){Me(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function op(e,t,r){te=e,Sd(e)}function Sd(e,t,r){for(var i=(e.mode&1)!==0;te!==null;){var s=te,a=s.child;if(s.tag===22&&i){var _=s.memoizedState!==null||en;if(!_){var n=s.alternate,u=n!==null&&n.memoizedState!==null||Je;n=en;var d=Je;if(en=_,(Je=u)&&!d)for(te=s;te!==null;)_=te,u=_.child,_.tag===22&&_.memoizedState!==null?tu(s):u!==null?(u.return=_,te=u):tu(s);for(;a!==null;)te=a,Sd(a),a=a.sibling;te=s,en=n,Je=d}Jc(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,te=a):Jc(e)}}function Jc(e){for(;te!==null;){var t=te;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Je||so(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Je)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Mt(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Nc(t,a,i);break;case 3:var _=t.updateQueue;if(_!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Nc(t,_,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var y=d.memoizedState;if(y!==null){var f=y.dehydrated;f!==null&&ms(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Je||t.flags&512&&Ta(t)}catch(m){Me(t,t.return,m)}}if(t===e){te=null;break}if(r=t.sibling,r!==null){r.return=t.return,te=r;break}te=t.return}}function eu(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var r=t.sibling;if(r!==null){r.return=t.return,te=r;break}te=t.return}}function tu(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{so(4,t)}catch(u){Me(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(u){Me(t,s,u)}}var a=t.return;try{Ta(t)}catch(u){Me(t,a,u)}break;case 5:var _=t.return;try{Ta(t)}catch(u){Me(t,_,u)}}}catch(u){Me(t,t.return,u)}if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}var ap=Math.ceil,Bn=lr.ReactCurrentDispatcher,xl=lr.ReactCurrentOwner,xt=lr.ReactCurrentBatchConfig,ge=0,$e=null,Ie=null,Ke=0,pt=0,bi=Or(0),je=0,Rs=null,Jr=0,no=0,Ll=0,us=null,lt=null,Rl=0,Ni=1/0,Yt=null,In=!1,Ma=null,xr=null,tn=!1,gr=null,Nn=0,hs=0,Pa=null,fn=-1,_n=0;function it(){return ge&6?Oe():fn!==-1?fn:fn=Oe()}function Lr(e){return e.mode&1?ge&2&&Ke!==0?Ke&-Ke:$_.transition!==null?(_n===0&&(_n=sh()),_n):(e=we,e!==0||(e=window.event,e=e===void 0?16:hh(e.type)),e):1}function It(e,t,r,i){if(50<hs)throw hs=0,Pa=null,Error(q(185));Ms(e,r,i),(!(ge&2)||e!==$e)&&(e===$e&&(!(ge&2)&&(no|=r),je===4&&vr(e,Ke)),dt(e,i),r===1&&ge===0&&!(t.mode&1)&&(Ni=Oe()+500,to&&Br()))}function dt(e,t){var r=e.callbackNode;$f(e,t);var i=Sn(e,e===$e?Ke:0);if(i===0)r!==null&&uc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&uc(r),t===1)e.tag===0?W_(ru.bind(null,e)):Dh(ru.bind(null,e)),F_(function(){!(ge&6)&&Br()}),r=null;else{switch(nh(i)){case 1:r=el;break;case 4:r=rh;break;case 16:r=yn;break;case 536870912:r=ih;break;default:r=yn}r=Rd(r,Cd.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Cd(e,t){if(fn=-1,_n=0,ge&6)throw Error(q(327));var r=e.callbackNode;if(Di()&&e.callbackNode!==r)return null;var i=Sn(e,e===$e?Ke:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Hn(e,i);else{t=i;var s=ge;ge|=2;var a=kd();($e!==e||Ke!==t)&&(Yt=null,Ni=Oe()+500,qr(e,t));do try{up();break}catch(n){wd(e,n)}while(!0);fl(),Bn.current=a,ge=s,Ie!==null?t=0:($e=null,Ke=0,t=je)}if(t!==0){if(t===2&&(s=oa(e),s!==0&&(i=s,t=Oa(e,s))),t===1)throw r=Rs,qr(e,0),vr(e,i),dt(e,Oe()),r;if(t===6)vr(e,i);else{if(s=e.current.alternate,!(i&30)&&!lp(s)&&(t=Hn(e,i),t===2&&(a=oa(e),a!==0&&(i=a,t=Oa(e,a))),t===1))throw r=Rs,qr(e,0),vr(e,i),dt(e,Oe()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(q(345));case 2:Wr(e,lt,Yt);break;case 3:if(vr(e,i),(i&130023424)===i&&(t=Rl+500-Oe(),10<t)){if(Sn(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){it(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=_a(Wr.bind(null,e,lt,Yt),t);break}Wr(e,lt,Yt);break;case 4:if(vr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var _=31-Bt(i);a=1<<_,_=t[_],_>s&&(s=_),i&=~a}if(i=s,i=Oe()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*ap(i/1960))-i,10<i){e.timeoutHandle=_a(Wr.bind(null,e,lt,Yt),i);break}Wr(e,lt,Yt);break;case 5:Wr(e,lt,Yt);break;default:throw Error(q(329))}}}return dt(e,Oe()),e.callbackNode===r?Cd.bind(null,e):null}function Oa(e,t){var r=us;return e.current.memoizedState.isDehydrated&&(qr(e,t).flags|=256),e=Hn(e,t),e!==2&&(t=lt,lt=r,t!==null&&Ba(t)),e}function Ba(e){lt===null?lt=e:lt.push.apply(lt,e)}function lp(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var s=r[i],a=s.getSnapshot;s=s.value;try{if(!Nt(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 vr(e,t){for(t&=~Ll,t&=~no,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Bt(t),i=1<<r;e[r]=-1,t&=~i}}function ru(e){if(ge&6)throw Error(q(327));Di();var t=Sn(e,0);if(!(t&1))return dt(e,Oe()),null;var r=Hn(e,t);if(e.tag!==0&&r===2){var i=oa(e);i!==0&&(t=i,r=Oa(e,i))}if(r===1)throw r=Rs,qr(e,0),vr(e,t),dt(e,Oe()),r;if(r===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wr(e,lt,Yt),dt(e,Oe()),null}function Tl(e,t){var r=ge;ge|=1;try{return e(t)}finally{ge=r,ge===0&&(Ni=Oe()+500,to&&Br())}}function ei(e){gr!==null&&gr.tag===0&&!(ge&6)&&Di();var t=ge;ge|=1;var r=xt.transition,i=we;try{if(xt.transition=null,we=1,e)return e()}finally{we=i,xt.transition=r,ge=t,!(ge&6)&&Br()}}function Dl(){pt=bi.current,Le(bi)}function qr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,H_(r)),Ie!==null)for(r=Ie.return;r!==null;){var i=r;switch(ul(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&En();break;case 3:Bi(),Le(ut),Le(et),yl();break;case 5:gl(i);break;case 4:Bi();break;case 13:Le(Te);break;case 19:Le(Te);break;case 10:_l(i.type._context);break;case 22:case 23:Dl()}r=r.return}if($e=e,Ie=e=Rr(e.current,null),Ke=pt=t,je=0,Rs=null,Ll=no=Jr=0,lt=us=null,Vr!==null){for(t=0;t<Vr.length;t++)if(r=Vr[t],i=r.interleaved,i!==null){r.interleaved=null;var s=i.next,a=r.pending;if(a!==null){var _=a.next;a.next=s,i.next=_}r.pending=i}Vr=null}return e}function wd(e,t){do{var r=Ie;try{if(fl(),un.current=On,Pn){for(var i=De.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Pn=!1}if(Qr=0,We=Fe=De=null,ls=!1,Es=0,xl.current=null,r===null||r.return===null){je=1,Rs=t,Ie=null;break}e:{var a=e,_=r.return,n=r,u=t;if(t=Ke,n.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,y=n,f=y.tag;if(!(y.mode&1)&&(f===0||f===11||f===15)){var m=y.alternate;m?(y.updateQueue=m.updateQueue,y.memoizedState=m.memoizedState,y.lanes=m.lanes):(y.updateQueue=null,y.memoizedState=null)}var C=Wc(_);if(C!==null){C.flags&=-257,$c(C,_,n,a,t),C.mode&1&&Uc(a,d,t),t=C,u=d;var k=t.updateQueue;if(k===null){var S=new Set;S.add(u),t.updateQueue=S}else k.add(u);break e}else{if(!(t&1)){Uc(a,d,t),Al();break e}u=Error(q(426))}}else if(Re&&n.mode&1){var h=Wc(_);if(h!==null){!(h.flags&65536)&&(h.flags|=256),$c(h,_,n,a,t),hl(Ii(u,n));break e}}a=u=Ii(u,n),je!==4&&(je=2),us===null?us=[a]:us.push(a),a=_;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var l=nd(a,u,t);Ic(a,l);break e;case 1:n=u;var o=a.type,c=a.stateNode;if(!(a.flags&128)&&(typeof o.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(xr===null||!xr.has(c)))){a.flags|=65536,t&=-t,a.lanes|=t;var p=od(a,n,t);Ic(a,p);break e}}a=a.return}while(a!==null)}Ed(r)}catch(g){t=g,Ie===r&&r!==null&&(Ie=r=r.return);continue}break}while(!0)}function kd(){var e=Bn.current;return Bn.current=On,e===null?On:e}function Al(){(je===0||je===3||je===2)&&(je=4),$e===null||!(Jr&268435455)&&!(no&268435455)||vr($e,Ke)}function Hn(e,t){var r=ge;ge|=2;var i=kd();($e!==e||Ke!==t)&&(Yt=null,qr(e,t));do try{cp();break}catch(s){wd(e,s)}while(!0);if(fl(),ge=r,Bn.current=i,Ie!==null)throw Error(q(261));return $e=null,Ke=0,je}function cp(){for(;Ie!==null;)bd(Ie)}function up(){for(;Ie!==null&&!Bf();)bd(Ie)}function bd(e){var t=Ld(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?Ed(e):Ie=t,xl.current=null}function Ed(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=ip(r,t),r!==null){r.flags&=32767,Ie=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Ie=null;return}}else if(r=rp(r,t,pt),r!==null){Ie=r;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);je===0&&(je=5)}function Wr(e,t,r){var i=we,s=xt.transition;try{xt.transition=null,we=1,hp(e,t,r,i)}finally{xt.transition=s,we=i}return null}function hp(e,t,r,i){do Di();while(gr!==null);if(ge&6)throw Error(q(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(Vf(e,a),e===$e&&(Ie=$e=null,Ke=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||tn||(tn=!0,Rd(yn,function(){return Di(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=xt.transition,xt.transition=null;var _=we;we=1;var n=ge;ge|=4,xl.current=null,np(e,r),yd(r,e),A_(da),Cn=!!ha,da=ha=null,e.current=r,op(r),If(),ge=n,we=_,xt.transition=a}else e.current=r;if(tn&&(tn=!1,gr=e,Nn=s),a=e.pendingLanes,a===0&&(xr=null),Ff(r.stateNode),dt(e,Oe()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],i(s.value,{componentStack:s.stack,digest:s.digest});if(In)throw In=!1,e=Ma,Ma=null,e;return Nn&1&&e.tag!==0&&Di(),a=e.pendingLanes,a&1?e===Pa?hs++:(hs=0,Pa=e):hs=0,Br(),null}function Di(){if(gr!==null){var e=nh(Nn),t=xt.transition,r=we;try{if(xt.transition=null,we=16>e?16:e,gr===null)var i=!1;else{if(e=gr,gr=null,Nn=0,ge&6)throw Error(q(331));var s=ge;for(ge|=4,te=e.current;te!==null;){var a=te,_=a.child;if(te.flags&16){var n=a.deletions;if(n!==null){for(var u=0;u<n.length;u++){var d=n[u];for(te=d;te!==null;){var y=te;switch(y.tag){case 0:case 11:case 15:cs(8,y,a)}var f=y.child;if(f!==null)f.return=y,te=f;else for(;te!==null;){y=te;var m=y.sibling,C=y.return;if(vd(y),y===d){te=null;break}if(m!==null){m.return=C,te=m;break}te=C}}}var k=a.alternate;if(k!==null){var S=k.child;if(S!==null){k.child=null;do{var h=S.sibling;S.sibling=null,S=h}while(S!==null)}}te=a}}if(a.subtreeFlags&2064&&_!==null)_.return=a,te=_;else e:for(;te!==null;){if(a=te,a.flags&2048)switch(a.tag){case 0:case 11:case 15:cs(9,a,a.return)}var l=a.sibling;if(l!==null){l.return=a.return,te=l;break e}te=a.return}}var o=e.current;for(te=o;te!==null;){_=te;var c=_.child;if(_.subtreeFlags&2064&&c!==null)c.return=_,te=c;else e:for(_=o;te!==null;){if(n=te,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:so(9,n)}}catch(g){Me(n,n.return,g)}if(n===_){te=null;break e}var p=n.sibling;if(p!==null){p.return=n.return,te=p;break e}te=n.return}}if(ge=s,Br(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Gn,e)}catch{}i=!0}return i}finally{we=r,xt.transition=t}}return!1}function iu(e,t,r){t=Ii(r,t),t=nd(e,t,1),e=Er(e,t,1),t=it(),e!==null&&(Ms(e,1,t),dt(e,t))}function Me(e,t,r){if(e.tag===3)iu(e,e,r);else for(;t!==null;){if(t.tag===3){iu(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(xr===null||!xr.has(i))){e=Ii(r,e),e=od(t,e,1),t=Er(t,e,1),e=it(),t!==null&&(Ms(t,1,e),dt(t,e));break}}t=t.return}}function dp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=it(),e.pingedLanes|=e.suspendedLanes&r,$e===e&&(Ke&r)===r&&(je===4||je===3&&(Ke&130023424)===Ke&&500>Oe()-Rl?qr(e,0):Ll|=r),dt(e,t)}function xd(e,t){t===0&&(e.mode&1?(t=Vs,Vs<<=1,!(Vs&130023424)&&(Vs=4194304)):t=1);var r=it();e=nr(e,t),e!==null&&(Ms(e,t,r),dt(e,r))}function fp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),xd(e,r)}function _p(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(q(314))}i!==null&&i.delete(t),xd(e,r)}var Ld;Ld=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)ct=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ct=!1,tp(e,t,r);ct=!!(e.flags&131072)}else ct=!1,Re&&t.flags&1048576&&Ah(t,Rn,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;dn(e,t),e=t.pendingProps;var s=Mi(t,et.current);Ti(t,r),s=Cl(null,t,i,e,s,r);var a=wl();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ht(i)?(a=!0,xn(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,vl(t),s.updater=io,t.stateNode=s,s._reactInternals=t,Ca(t,i,e,r),t=ba(null,t,i,!0,a,r)):(t.tag=0,Re&&a&&cl(t),rt(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(dn(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=vp(i),e=Mt(i,e),s){case 0:t=ka(null,t,i,e,r);break e;case 1:t=Zc(null,t,i,e,r);break e;case 11:t=Vc(null,t,i,e,r);break e;case 14:t=Kc(null,t,i,Mt(i.type,e),r);break e}throw Error(q(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Mt(i,s),ka(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Mt(i,s),Zc(e,t,i,s,r);case 3:e:{if(ud(t),e===null)throw Error(q(387));i=t.pendingProps,a=t.memoizedState,s=a.element,Nh(e,t),An(t,i,null,r);var _=t.memoizedState;if(i=_.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Ii(Error(q(423)),t),t=qc(e,t,i,r,s);break e}else if(i!==s){s=Ii(Error(q(424)),t),t=qc(e,t,i,r,s);break e}else for(vt=br(t.stateNode.containerInfo.firstChild),mt=t,Re=!0,Ot=null,r=Bh(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Pi(),i===s){t=or(e,t,r);break e}rt(e,t,i,r)}t=t.child}return t;case 5:return Hh(t),e===null&&ga(t),i=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,_=s.children,fa(i,s)?_=null:a!==null&&fa(i,a)&&(t.flags|=32),cd(e,t),rt(e,t,_,r),t.child;case 6:return e===null&&ga(t),null;case 13:return hd(e,t,r);case 4:return ml(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Oi(t,null,i,r):rt(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Mt(i,s),Vc(e,t,i,s,r);case 7:return rt(e,t,t.pendingProps,r),t.child;case 8:return rt(e,t,t.pendingProps.children,r),t.child;case 12:return rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,a=t.memoizedProps,_=s.value,Ee(Tn,i._currentValue),i._currentValue=_,a!==null)if(Nt(a.value,_)){if(a.children===s.children&&!ut.current){t=or(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var n=a.dependencies;if(n!==null){_=a.child;for(var u=n.firstContext;u!==null;){if(u.context===i){if(a.tag===1){u=tr(-1,r&-r),u.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var y=d.pending;y===null?u.next=u:(u.next=y.next,y.next=u),d.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),ya(a.return,r,t),n.lanes|=r;break}u=u.next}}else if(a.tag===10)_=a.type===t.type?null:a.child;else if(a.tag===18){if(_=a.return,_===null)throw Error(q(341));_.lanes|=r,n=_.alternate,n!==null&&(n.lanes|=r),ya(_,r,t),_=a.sibling}else _=a.child;if(_!==null)_.return=a;else for(_=a;_!==null;){if(_===t){_=null;break}if(a=_.sibling,a!==null){a.return=_.return,_=a;break}_=_.return}a=_}rt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Ti(t,r),s=Lt(s),i=i(s),t.flags|=1,rt(e,t,i,r),t.child;case 14:return i=t.type,s=Mt(i,t.pendingProps),s=Mt(i.type,s),Kc(e,t,i,s,r);case 15:return ad(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Mt(i,s),dn(e,t),t.tag=1,ht(i)?(e=!0,xn(t)):e=!1,Ti(t,r),sd(t,i,s),Ca(t,i,s,r),ba(null,t,i,!0,e,r);case 19:return dd(e,t,r);case 22:return ld(e,t,r)}throw Error(q(156,t.tag))};function Rd(e,t){return th(e,t)}function pp(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,r,i){return new pp(e,t,r,i)}function Ml(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vp(e){if(typeof e=="function")return Ml(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ya)return 11;if(e===Qa)return 14}return 2}function Rr(e,t){var r=e.alternate;return r===null?(r=Et(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pn(e,t,r,i,s,a){var _=2;if(i=e,typeof e=="function")Ml(e)&&(_=1);else if(typeof e=="string")_=5;else e:switch(e){case _i:return Xr(r.children,s,a,t);case Ga:_=8,s|=8;break;case Vo:return e=Et(12,r,t,s|2),e.elementType=Vo,e.lanes=a,e;case Ko:return e=Et(13,r,t,s),e.elementType=Ko,e.lanes=a,e;case Zo:return e=Et(19,r,t,s),e.elementType=Zo,e.lanes=a,e;case Hu:return oo(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iu:_=10;break e;case Nu:_=9;break e;case Ya:_=11;break e;case Qa:_=14;break e;case dr:_=16,i=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=Et(_,r,t,s),t.elementType=e,t.type=i,t.lanes=a,t}function Xr(e,t,r,i){return e=Et(7,e,i,t),e.lanes=r,e}function oo(e,t,r,i){return e=Et(22,e,i,t),e.elementType=Hu,e.lanes=r,e.stateNode={isHidden:!1},e}function jo(e,t,r){return e=Et(6,e,null,t),e.lanes=r,e}function zo(e,t,r){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mp(e,t,r,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Co(0),this.expirationTimes=Co(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Co(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Pl(e,t,r,i,s,a,_,n,u){return e=new mp(e,t,r,n,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},vl(a),e}function gp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fi,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Td(e){if(!e)return Dr;e=e._reactInternals;e:{if(oi(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var r=e.type;if(ht(r))return Th(e,r,t)}return t}function Dd(e,t,r,i,s,a,_,n,u){return e=Pl(r,i,!0,e,s,a,_,n,u),e.context=Td(null),r=e.current,i=it(),s=Lr(r),a=tr(i,s),a.callback=t??null,Er(r,a,s),e.current.lanes=s,Ms(e,s,i),dt(e,i),e}function ao(e,t,r,i){var s=t.current,a=it(),_=Lr(s);return r=Td(r),t.context===null?t.context=r:t.pendingContext=r,t=tr(a,_),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Er(s,t,_),e!==null&&(It(e,s,_,a),cn(e,s,_)),_}function Fn(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function su(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ol(e,t){su(e,t),(e=e.alternate)&&su(e,t)}function yp(){return null}var Ad=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bl(e){this._internalRoot=e}lo.prototype.render=Bl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));ao(e,t,null,null)};lo.prototype.unmount=Bl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ei(function(){ao(null,e,null,null)}),t[sr]=null}};function lo(e){this._internalRoot=e}lo.prototype.unstable_scheduleHydration=function(e){if(e){var t=lh();e={blockedOn:null,target:e,priority:t};for(var r=0;r<pr.length&&t!==0&&t<pr[r].priority;r++);pr.splice(r,0,e),r===0&&uh(e)}};function Il(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function co(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function nu(){}function Sp(e,t,r,i,s){if(s){if(typeof i=="function"){var a=i;i=function(){var d=Fn(_);a.call(d)}}var _=Dd(t,i,e,0,null,!1,!1,"",nu);return e._reactRootContainer=_,e[sr]=_.current,Ss(e.nodeType===8?e.parentNode:e),ei(),_}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var n=i;i=function(){var d=Fn(u);n.call(d)}}var u=Pl(e,0,!1,null,null,!1,!1,"",nu);return e._reactRootContainer=u,e[sr]=u.current,Ss(e.nodeType===8?e.parentNode:e),ei(function(){ao(t,u,r,i)}),u}function uo(e,t,r,i,s){var a=r._reactRootContainer;if(a){var _=a;if(typeof s=="function"){var n=s;s=function(){var u=Fn(_);n.call(u)}}ao(t,_,e,s)}else _=Sp(r,t,e,s,i);return Fn(_)}oh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=es(t.pendingLanes);r!==0&&(tl(t,r|1),dt(t,Oe()),!(ge&6)&&(Ni=Oe()+500,Br()))}break;case 13:ei(function(){var i=nr(e,1);if(i!==null){var s=it();It(i,e,1,s)}}),Ol(e,1)}};rl=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var r=it();It(t,e,134217728,r)}Ol(e,134217728)}};ah=function(e){if(e.tag===13){var t=Lr(e),r=nr(e,t);if(r!==null){var i=it();It(r,e,t,i)}Ol(e,t)}};lh=function(){return we};ch=function(e,t){var r=we;try{return we=e,t()}finally{we=r}};ia=function(e,t,r){switch(t){case"input":if(Go(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var s=eo(i);if(!s)throw Error(q(90));ju(i),Go(i,s)}}}break;case"textarea":Uu(e,r);break;case"select":t=r.value,t!=null&&Ei(e,!!r.multiple,t,!1)}};Xu=Tl;Gu=ei;var Cp={usingClientEntryPoint:!1,Events:[Os,gi,eo,Zu,qu,Tl]},Yi={findFiberByHostInstance:$r,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wp={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ju(e),e===null?null:e.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||yp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rn.isDisabled&&rn.supportsFiber)try{Gn=rn.inject(wp),$t=rn}catch{}}St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cp;St.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Il(t))throw Error(q(200));return gp(e,t,null,r)};St.createRoot=function(e,t){if(!Il(e))throw Error(q(299));var r=!1,i="",s=Ad;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Pl(e,1,!1,null,null,r,!1,i,s),e[sr]=t.current,Ss(e.nodeType===8?e.parentNode:e),new Bl(t)};St.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=Ju(t),e=e===null?null:e.stateNode,e};St.flushSync=function(e){return ei(e)};St.hydrate=function(e,t,r){if(!co(t))throw Error(q(200));return uo(null,e,t,!0,r)};St.hydrateRoot=function(e,t,r){if(!Il(e))throw Error(q(405));var i=r!=null&&r.hydratedSources||null,s=!1,a="",_=Ad;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),t=Dd(t,null,e,1,r??null,s,!1,a,_),e[sr]=t.current,Ss(e),i)for(e=0;e<i.length;e++)r=i[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new lo(t)};St.render=function(e,t,r){if(!co(t))throw Error(q(200));return uo(null,e,t,!1,r)};St.unmountComponentAtNode=function(e){if(!co(e))throw Error(q(40));return e._reactRootContainer?(ei(function(){uo(null,null,e,!1,function(){e._reactRootContainer=null,e[sr]=null})}),!0):!1};St.unstable_batchedUpdates=Tl;St.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!co(r))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return uo(e,t,r,!1,i)};St.version="18.3.1-next-f1338f8080-20240426";function Md(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Md)}catch(e){console.error(e)}}Md(),Mu.exports=St;var Pd=Mu.exports,Od,ou=Pd;Od=ou.createRoot,ou.hydrateRoot;/**
41
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
42
+ * @license MIT
43
+ *
44
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
45
+ * @license MIT
46
+ *
47
+ * Originally forked from (with the author's permission):
48
+ * Fabrice Bellard's javascript vt100 for jslinux:
49
+ * http://bellard.org/jslinux/
50
+ * Copyright (c) 2011 Fabrice Bellard
51
+ */var kp=2,bp=1,Ep=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var f;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((f=this._terminal.options.overviewRuler)==null?void 0:f.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),_={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},n=_.top+_.bottom,u=_.right+_.left,d=i-n,y=s-u-t;return{cols:Math.max(kp,Math.floor(y/e.css.cell.width)),rows:Math.max(bp,Math.floor(d/e.css.cell.height))}}},Bd={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(_,n,u){var d=this&&this.__decorate||function(c,p,g,w){var x,v=arguments.length,b=v<3?p:w===null?w=Object.getOwnPropertyDescriptor(p,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,g,w);else for(var R=c.length-1;R>=0;R--)(x=c[R])&&(b=(v<3?x(b):v>3?x(p,g,b):x(p,g))||b);return v>3&&b&&Object.defineProperty(p,g,b),b},y=this&&this.__param||function(c,p){return function(g,w){p(g,w,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const f=u(9042),m=u(6114),C=u(9924),k=u(844),S=u(5596),h=u(4725),l=u(3656);let o=n.AccessibilityManager=class extends k.Disposable{constructor(c,p){super(),this._terminal=c,this._renderService=p,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let g=0;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);if(this._topBoundaryFocusListener=g=>this._handleBoundaryFocus(g,0),this._bottomBoundaryFocusListener=g=>this._handleBoundaryFocus(g,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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.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(g=>this._handleResize(g.rows))),this.register(this._terminal.onRender(g=>this._refreshRows(g.start,g.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(g=>this._handleChar(g))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
52
+ `))),this.register(this._terminal.onA11yTab(g=>this._handleTab(g))),this.register(this._terminal.onKey(g=>this._handleKey(g.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new S.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,l.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,k.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let p=0;p<c;p++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
53
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)),m.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,m.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,p){this._liveRegionDebouncer.refresh(c,p,this._terminal.rows)}_renderRows(c,p){const g=this._terminal.buffer,w=g.lines.length.toString();for(let x=c;x<=p;x++){const v=g.translateBufferLineToString(g.ydisp+x,!0),b=(g.ydisp+x+1).toString(),R=this._rowElements[x];R&&(v.length===0?R.innerText=" ":R.textContent=v,R.setAttribute("aria-posinset",b),R.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,p){const g=c.target,w=this._rowElements[p===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==w)return;let x,v;if(p===0?(x=g,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(x=this._rowElements.shift(),v=g,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=o=d([y(1,h.IRenderService)],o)},3614:(_,n)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function d(m,C){return C?"\x1B[200~"+m+"\x1B[201~":m}function y(m,C,k,S){m=d(m=u(m),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(m,!0),C.value=""}function f(m,C,k){const S=k.getBoundingClientRect(),h=m.clientX-S.left-10,l=m.clientY-S.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${h}px`,C.style.top=`${l}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=u,n.bracketTextForPaste=d,n.copyHandler=function(m,C){m.clipboardData&&m.clipboardData.setData("text/plain",C.selectionText),m.preventDefault()},n.handlePasteEvent=function(m,C,k,S){m.stopPropagation(),m.clipboardData&&y(m.clipboardData.getData("text/plain"),C,k,S)},n.paste=y,n.moveTextAreaUnderMouseCursor=f,n.rightClickHandler=function(m,C,k,S,h){f(m,C,k),h&&S.rightClickSelect(m),C.value=S.selectionText,C.select()}},7239:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=u(1505);n.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(y,f,m){this._css.set(y,f,m)}getCss(y,f){return this._css.get(y,f)}setColor(y,f,m){this._color.set(y,f,m)}getColor(y,f){return this._color.get(y,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,y,f){u.addEventListener(d,y,f);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(d,y,f))}}}},6465:function(_,n,u){var d=this&&this.__decorate||function(h,l,o,c){var p,g=arguments.length,w=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,c);else for(var x=h.length-1;x>=0;x--)(p=h[x])&&(w=(g<3?p(w):g>3?p(l,o,w):p(l,o))||w);return g>3&&w&&Object.defineProperty(l,o,w),w},y=this&&this.__param||function(h,l){return function(o,c){l(o,c,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier2=void 0;const f=u(3656),m=u(8460),C=u(844),k=u(2585);let S=n.Linkifier2=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const l=this._linkProviders.indexOf(h);l!==-1&&this._linkProviders.splice(l,1)}}}attachToDom(h,l,o){this._element=h,this._mouseService=l,this._renderService=o,this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=h.composedPath();for(let c=0;c<o.length;c++){const p=o[c];if(p.classList.contains("xterm"))break;if(p.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 o,c;this._activeProviderReplies&&l||((o=this._activeProviderReplies)===null||o===void 0||o.forEach(g=>{g==null||g.forEach(w=>{w.link.dispose&&w.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let p=!1;for(const[g,w]of this._linkProviders.entries())l?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(g)&&(p=this._checkLinkProviderResult(g,h,p)):w.provideLinks(h.y,x=>{var v,b;if(this._isMouseOut)return;const R=x==null?void 0:x.map(O=>({link:O}));(v=this._activeProviderReplies)===null||v===void 0||v.set(g,R),p=this._checkLinkProviderResult(g,h,p),((b=this._activeProviderReplies)===null||b===void 0?void 0:b.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,l){const o=new Set;for(let c=0;c<l.size;c++){const p=l.get(c);if(p)for(let g=0;g<p.length;g++){const w=p[g],x=w.link.range.start.y<h?0:w.link.range.start.x,v=w.link.range.end.y>h?this._bufferService.cols:w.link.range.end.x;for(let b=x;b<=v;b++){if(o.has(b)){p.splice(g--,1);break}o.add(b)}}}}_checkLinkProviderResult(h,l,o){var c;if(!this._activeProviderReplies)return o;const p=this._activeProviderReplies.get(h);let g=!1;for(let w=0;w<h;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(g=!0);if(!g&&p){const w=p.find(x=>this._linkAtPosition(x.link,l));w&&(o=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let w=0;w<this._activeProviderReplies.size;w++){const x=(c=this._activeProviderReplies.get(w))===null||c===void 0?void 0:c.find(v=>this._linkAtPosition(v.link,l));if(x){o=!0,this._handleNewLink(x);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!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._element&&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,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)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,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:o=>{var c,p;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&((p=this._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",o)))}},underline:{get:()=>{var o,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.underline},set:o=>{var c,p,g;!((c=this._currentLink)===null||c===void 0)&&c.state&&((g=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||g===void 0?void 0:g.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,o))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const c=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(c,p),this._lastMouseEvent&&this._element)){const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._askForLink(g,!1)}})))}_linkHover(h,l,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.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,c=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-c-1,o.end.x,o.end.y-c-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(h,l,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.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,c=h.range.end.y*this._bufferService.cols+h.range.end.x,p=l.y*this._bufferService.cols+l.x;return o<=p&&p<=c}_positionFromMouseEvent(h,l,o){const c=o.getCoords(h,l,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,l,o,c,p){return{x1:h,y1:l,x2:o,y2:c,cols:this._bufferService.cols,fg:p}}};n.Linkifier2=S=d([y(0,k.IBufferService)],S)},9042:(_,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(_,n,u){var d=this&&this.__decorate||function(S,h,l,o){var c,p=arguments.length,g=p<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,h,l,o);else for(var w=S.length-1;w>=0;w--)(c=S[w])&&(g=(p<3?c(g):p>3?c(h,l,g):c(h,l))||g);return p>3&&g&&Object.defineProperty(h,l,g),g},y=this&&this.__param||function(S,h){return function(l,o){h(l,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const f=u(511),m=u(2585);let C=n.OscLinkProvider=class{constructor(S,h,l){this._bufferService=S,this._optionsService=h,this._oscLinkService=l}provideLinks(S,h){var l;const o=this._bufferService.buffer.lines.get(S-1);if(!o)return void h(void 0);const c=[],p=this._optionsService.rawOptions.linkHandler,g=new f.CellData,w=o.getTrimmedLength();let x=-1,v=-1,b=!1;for(let R=0;R<w;R++)if(v!==-1||o.hasContent(R)){if(o.loadCell(R,g),g.hasExtendedAttrs()&&g.extended.urlId){if(v===-1){v=R,x=g.extended.urlId;continue}b=g.extended.urlId!==x}else v!==-1&&(b=!0);if(b||v!==-1&&R===w-1){const O=(l=this._oscLinkService.getLinkData(x))===null||l===void 0?void 0:l.uri;if(O){const A={start:{x:v+1,y:S},end:{x:R+(b||R!==w-1?0:1),y:S}};let M=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const F=new URL(O);["http:","https:"].includes(F.protocol)||(M=!0)}catch{M=!0}M||c.push({text:O,range:A,activate:(F,U)=>p?p.activate(F,U,A):k(0,U),hover:(F,U)=>{var I;return(I=p==null?void 0:p.hover)===null||I===void 0?void 0:I.call(p,F,U,A)},leave:(F,U)=>{var I;return(I=p==null?void 0:p.leave)===null||I===void 0?void 0:I.call(p,F,U,A)}})}b=!1,g.hasExtendedAttrs()&&g.extended.urlId?(v=R,x=g.extended.urlId):(v=-1,x=-1)}}h(c)}};function k(S,h){if(confirm(`Do you want to navigate to ${h}?
54
+
55
+ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=C=d([y(0,m.IBufferService),y(1,m.IOptionsService),y(2,m.IOscLinkService)],C)},6193:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,d){this._parentWindow=u,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,d,y){this._rowCount=y,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},5596:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ScreenDprMonitor=void 0;const d=u(844);class y extends d.Disposable{constructor(m){super(),this._parentWindow=m,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(m){this._listener&&this.clearListener(),this._listener=m,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)===null||m===void 0||m.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}n.ScreenDprMonitor=y},3236:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=u(3614),y=u(3656),f=u(6465),m=u(9042),C=u(3730),k=u(1680),S=u(3107),h=u(5744),l=u(2950),o=u(1296),c=u(428),p=u(4269),g=u(5114),w=u(8934),x=u(3230),v=u(9312),b=u(4725),R=u(6731),O=u(8055),A=u(8969),M=u(8460),F=u(844),U=u(6114),I=u(8437),H=u(2584),E=u(7399),T=u(5941),D=u(9074),P=u(2585),W=u(5435),G=u(4567),re=typeof window<"u"?window.document:null;class ee extends A.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(L={}){super(L),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(f.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((B,V)=>this.refresh(B,V))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(B=>this._reportWindowsOptions(B))),this.register(this._inputHandler.onColor(B=>this._handleColorEvent(B))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(B=>this._afterResize(B.cols,B.rows))),this.register((0,F.toDisposable)(()=>{var B,V;this._customKeyEventHandler=void 0,(V=(B=this.element)===null||B===void 0?void 0:B.parentNode)===null||V===void 0||V.removeChild(this.element)}))}_handleColorEvent(L){if(this._themeService)for(const B of L){let V,z="";switch(B.index){case 256:V="foreground",z="10";break;case 257:V="background",z="11";break;case 258:V="cursor",z="12";break;default:V="ansi",z="4;"+B.index}switch(B.type){case 0:const N=O.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${z};${(0,T.toRgbString)(N)}${H.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors(K=>K.ansi[B.index]=O.rgba.toColor(...B.color));else{const K=V;this._themeService.modifyColors(Y=>Y[K]=O.rgba.toColor(...B.color))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(L){L?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(L){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.updateCursorStyle(L),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var L;return(L=this.textarea)===null||L===void 0?void 0:L.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.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 L=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(L);if(!B)return;const V=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,N=B.getWidth(V),K=this._renderService.dimensions.css.cell.width*N,Y=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=Y+"px",this.textarea.style.width=K+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",B=>{this.hasSelection()&&(0,d.copyHandler)(B,this._selectionService)}));const L=B=>(0,d.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",L)),this.register((0,y.addDisposableDomListener)(this.element,"paste",L)),U.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",B=>{B.button===2&&(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",B=>{(0,d.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),U.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",B=>{B.button===1&&(0,d.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",L=>this._keyUp(L),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",L=>this._keyDown(L),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",L=>this._keyPress(L),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",L=>this._compositionHelper.compositionupdate(L))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,y.addDisposableDomListener)(this.textarea,"input",L=>this._inputEvent(L),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(L){var B;if(!L)throw new Error("Terminal requires a parent element.");L.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=L.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),L.appendChild(this.element);const V=re.createDocumentFragment();this._viewportElement=re.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.appendChild(this._viewportElement),this._viewportScrollArea=re.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=re.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=re.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=re.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),U.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._instantiationService.createInstance(g.CoreBrowserService,this.textarea,(B=this._document.defaultView)!==null&&B!==void 0?B:window),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",z=>this._handleTextAreaFocus(z))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(z=>this._onRender.fire(z))),this.onResize(z=>this._renderService.resize(z.cols,z.rows)),this._compositionView=re.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(z=>this.scrollLines(z.amount,z.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(v.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(z=>this.scrollLines(z.amount,z.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(z=>this._renderService.handleSelectionChanged(z.start,z.end,z.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(z=>{this.textarea.value=z,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",z=>this._selectionService.handleMouseDown(z))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",z=>this._handleScreenReaderModeOptionChange(z))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const L=this,B=this.element;function V(K){const Y=L._mouseService.getMouseReportCoords(K,L.screenElement);if(!Y)return!1;let pe,le;switch(K.overrideType||K.type){case"mousemove":le=32,K.buttons===void 0?(pe=3,K.button!==void 0&&(pe=K.button<3?K.button:3)):pe=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":le=0,pe=K.button<3?K.button:3;break;case"mousedown":le=1,pe=K.button<3?K.button:3;break;case"wheel":if(L.viewport.getLinesScrolled(K)===0)return!1;le=K.deltaY<0?0:1,pe=4;break;default:return!1}return!(le===void 0||pe===void 0||pe>4)&&L.coreMouseService.triggerMouseEvent({col:Y.col,row:Y.row,x:Y.x,y:Y.y,button:pe,action:le,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},N={mouseup:K=>(V(K),K.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(K)),wheel:K=>(V(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&V(K)},mousemove:K=>{K.buttons||V(K)}};this.register(this.coreMouseService.onProtocolChange(K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?z.mousemove||(B.addEventListener("mousemove",N.mousemove),z.mousemove=N.mousemove):(B.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&K?z.wheel||(B.addEventListener("wheel",N.wheel,{passive:!1}),z.wheel=N.wheel):(B.removeEventListener("wheel",z.wheel),z.wheel=null),2&K?z.mouseup||(B.addEventListener("mouseup",N.mouseup),z.mouseup=N.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),B.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&K?z.mousedrag||(z.mousedrag=N.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(B,"mousedown",K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return V(K),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(K)})),this.register((0,y.addDisposableDomListener)(B,"wheel",K=>{if(!z.wheel){if(!this.buffer.hasScrollback){const Y=this.viewport.getLinesScrolled(K);if(Y===0)return;const pe=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let le="";for(let ne=0;ne<Math.abs(Y);ne++)le+=pe;return this.coreService.triggerDataEvent(le,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}},{passive:!1})),this.register((0,y.addDisposableDomListener)(B,"touchstart",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)},{passive:!0})),this.register((0,y.addDisposableDomListener)(B,"touchmove",K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)},{passive:!1}))}refresh(L,B){var V;(V=this._renderService)===null||V===void 0||V.refreshRows(L,B)}updateCursorStyle(L){var B;!((B=this._selectionService)===null||B===void 0)&&B.shouldColumnSelect(L)?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(L,B,V=0){var z;V===1?(super.scrollLines(L,B,V),this.refresh(0,this.rows-1)):(z=this.viewport)===null||z===void 0||z.scrollLines(L)}paste(L){(0,d.paste)(L,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(L){this._customKeyEventHandler=L}registerLinkProvider(L){return this.linkifier2.registerLinkProvider(L)}registerCharacterJoiner(L){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(L);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(L){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(L)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(L){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+L)}registerDecoration(L){return this._decorationService.registerDecoration(L)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(L,B,V){this._selectionService.setSelection(L,B,V)}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 L;(L=this._selectionService)===null||L===void 0||L.clearSelection()}selectAll(){var L;(L=this._selectionService)===null||L===void 0||L.selectAll()}selectLines(L,B){var V;(V=this._selectionService)===null||V===void 0||V.selectLines(L,B)}_keyDown(L){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&L.altKey;if(!B&&!this._compositionHelper.keydown(L))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||L.key!=="Dead"&&L.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,E.evaluateKeyboardEvent)(L,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(L),V.type===3||V.type===2){const z=this.rows-1;return this.scrollLines(V.type===2?-z:z),this.cancel(L,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,L)||(V.cancel&&this.cancel(L,!0),!V.key||!!(L.key&&!L.ctrlKey&&!L.altKey&&!L.metaKey&&L.key.length===1&&L.key.charCodeAt(0)>=65&&L.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==H.C0.ETX&&V.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||L.altKey||L.ctrlKey?this.cancel(L,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(L,B){const V=L.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||L.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||L.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?V:V&&(!B.keyCode||B.keyCode>47)}_keyUp(L){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}(L)||this.focus(),this.updateCursorStyle(L),this._keyPressHandled=!1)}_keyPress(L){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;if(this.cancel(L),L.charCode)B=L.charCode;else if(L.which===null||L.which===void 0)B=L.keyCode;else{if(L.which===0||L.charCode===0)return!1;B=L.which}return!(!B||(L.altKey||L.ctrlKey||L.metaKey)&&!this._isThirdLevelShift(this.browser,L)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(L){if(L.data&&L.inputType==="insertText"&&(!L.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=L.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(L),!0}return!1}resize(L,B){L!==this.cols||B!==this.rows?super.resize(L,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(L,B){var V,z;(V=this._charSizeService)===null||V===void 0||V.measure(),(z=this.viewport)===null||z===void 0||z.syncScrollArea(!0)}clear(){var L;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(I.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(L=this.viewport)===null||L===void 0||L.reset(),this.refresh(0,this.rows-1)}}reset(){var L,B;this.options.rows=this.rows,this.options.cols=this.cols;const V=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)===null||L===void 0||L.reset(),this._decorationService.reset(),(B=this.viewport)===null||B===void 0||B.reset(),this._customKeyEventHandler=V,this.refresh(0,this.rows-1)}clearTextureAtlas(){var L;(L=this._renderService)===null||L===void 0||L.clearTextureAtlas()}_reportFocus(){var L;!((L=this.element)===null||L===void 0)&&L.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions(L){if(this._renderService)switch(L){case W.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${V};${B}t`);break;case W.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),N=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${N};${z}t`)}}cancel(L,B){if(this.options.cancelEvents||B)return L.preventDefault(),L.stopPropagation(),!1}}n.Terminal=ee},9924:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,y){this._rowCount=y,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=f-this._lastRefreshMs,C=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(_,n,u){var d=this&&this.__decorate||function(l,o,c,p){var g,w=arguments.length,x=w<3?o:p===null?p=Object.getOwnPropertyDescriptor(o,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,o,c,p);else for(var v=l.length-1;v>=0;v--)(g=l[v])&&(x=(w<3?g(x):w>3?g(o,c,x):g(o,c))||x);return w>3&&x&&Object.defineProperty(o,c,x),x},y=this&&this.__param||function(l,o){return function(c,p){o(c,p,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const f=u(3656),m=u(4725),C=u(8460),k=u(844),S=u(2585);let h=n.Viewport=class extends k.Disposable{constructor(l,o,c,p,g,w,x,v){super(),this._viewportElement=l,this._scrollArea=o,this._bufferService=c,this._optionsService=p,this._charSizeService=g,this._renderService=w,this._coreBrowserService=x,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(v.colors),this.register(v.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.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(l){if(l)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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<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(l,o){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&c<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const o=this._getPixelsScrolled(l);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(l,o){var c;let p,g="";const w=[],x=o??this._bufferService.buffer.lines.length,v=this._bufferService.buffer.lines;for(let b=l;b<x;b++){const R=v.get(b);if(!R)continue;const O=(c=v.get(b+1))===null||c===void 0?void 0:c.isWrapped;if(g+=R.translateToString(!O),!O||b===v.length-1){const A=document.createElement("div");A.textContent=g,w.push(A),g.length>0&&(p=A),g=""}}return{bufferElements:w,cursorElement:p}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(l,o){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&o.altKey||c==="ctrl"&&o.ctrlKey||c==="shift"&&o.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const o=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}};n.Viewport=h=d([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,m.ICharSizeService),y(5,m.IRenderService),y(6,m.ICoreBrowserService),y(7,m.IThemeService)],h)},3107:function(_,n,u){var d=this&&this.__decorate||function(h,l,o,c){var p,g=arguments.length,w=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,c);else for(var x=h.length-1;x>=0;x--)(p=h[x])&&(w=(g<3?p(w):g>3?p(l,o,w):p(l,o))||w);return g>3&&w&&Object.defineProperty(l,o,w),w},y=this&&this.__param||function(h,l){return function(o,c){l(o,c,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const f=u(3656),m=u(4725),C=u(844),k=u(2585);let S=n.BufferDecorationRenderer=class extends C.Disposable{constructor(h,l,o,c){super(),this._screenElement=h,this._bufferService=l,this._decorationService=o,this._renderService=c,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((0,f.addDisposableDomListener)(window,"resize",()=>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(p=>this._removeDecoration(p))),this.register((0,C.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 h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var l,o;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((l=h==null?void 0:h.options)===null||l===void 0?void 0:l.layer)==="top"),c.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=(o=h.options.x)!==null&&o!==void 0?o:0;return p&&p>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(h,c),c}_refreshStyle(h){const l=h.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let o=this._decorationElements.get(h);o||(o=this._createElement(h),h.element=o,this._decorationElements.set(h,o),this._container.appendChild(o),h.onDispose(()=>{this._decorationElements.delete(h),o.remove()})),o.style.top=l*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(o)}}_refreshXPosition(h,l=h.element){var o;if(!l)return;const c=(o=h.options.x)!==null&&o!==void 0?o:0;(h.options.anchor||"left")==="right"?l.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":l.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var l;(l=this._decorationElements.get(h))===null||l===void 0||l.remove(),this._decorationElements.delete(h),h.dispose()}};n.BufferDecorationRenderer=S=d([y(1,k.IBufferService),y(2,k.IDecorationService),y(3,m.IRenderService)],S)},5871:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,y){return d>=u.startBufferLine-this._linePadding[y||"full"]&&d<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(_,n,u){var d=this&&this.__decorate||function(p,g,w,x){var v,b=arguments.length,R=b<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,w):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,g,w,x);else for(var O=p.length-1;O>=0;O--)(v=p[O])&&(R=(b<3?v(R):b>3?v(g,w,R):v(g,w))||R);return b>3&&R&&Object.defineProperty(g,w,R),R},y=this&&this.__param||function(p,g){return function(w,x){g(w,x,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const f=u(5871),m=u(3656),C=u(4725),k=u(844),S=u(2585),h={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let c=n.OverviewRulerRenderer=class extends k.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,g,w,x,v,b,R){var O;super(),this._viewportElement=p,this._screenElement=g,this._bufferService=w,this._decorationService=x,this._renderService=v,this._optionsService=b,this._coreBrowseService=R,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)===null||O===void 0||O.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,k.toDisposable)(()=>{var M;(M=this._canvas)===null||M===void 0||M.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((0,m.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const p=Math.floor(this._canvas.width/3),g=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=p,l.center=g,l.right=p,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=l.left,o.right=l.left+l.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowseService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,g=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowseService.dpr);h.left=g,h.center=g,h.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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 g of this._decorationService.decorations)this._colorZoneStore.addDecoration(g);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const g of p)g.position!=="full"&&this._renderColorZone(g);for(const g of p)g.position==="full"&&this._renderColorZone(g);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(o[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-h[p.position||"full"]/2),l[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[p.position||"full"]))}_queueRefresh(p,g){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=g||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=c=d([y(2,S.IBufferService),y(3,S.IDecorationService),y(4,C.IRenderService),y(5,S.IOptionsService),y(6,C.ICoreBrowserService)],c)},2950:function(_,n,u){var d=this&&this.__decorate||function(S,h,l,o){var c,p=arguments.length,g=p<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,h,l,o);else for(var w=S.length-1;w>=0;w--)(c=S[w])&&(g=(p<3?c(g):p>3?c(h,l,g):c(h,l))||g);return p>3&&g&&Object.defineProperty(h,l,g),g},y=this&&this.__param||function(S,h){return function(l,o){h(l,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const f=u(4725),m=u(2585),C=u(2584);let k=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,h,l,o,c,p){this._textarea=S,this._compositionView=h,this._bufferService=l,this._optionsService=o,this._coreService=c,this._renderService=p,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,l=h.replace(S,"");this._dataAlreadySent=l,h.length>S.length?this._coreService.triggerDataEvent(l,!0):h.length<S.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):h.length===S.length&&h!==S&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}S||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=k=d([y(2,m.IBufferService),y(3,m.IOptionsService),y(4,m.ICoreService),y(5,f.IRenderService)],k)},9806:(_,n)=>{function u(d,y,f){const m=f.getBoundingClientRect(),C=d.getComputedStyle(f),k=parseInt(C.getPropertyValue("padding-left")),S=parseInt(C.getPropertyValue("padding-top"));return[y.clientX-m.left-k,y.clientY-m.top-S]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(d,y,f,m,C,k,S,h,l){if(!k)return;const o=u(d,y,f);return o?(o[0]=Math.ceil((o[0]+(l?S/2:0))/S),o[1]=Math.ceil(o[1]/h),o[0]=Math.min(Math.max(o[0],1),m+(l?1:0)),o[1]=Math.min(Math.max(o[1],1),C),o):void 0}},9504:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=u(2584);function y(h,l,o,c){const p=h-f(h,o),g=l-f(l,o),w=Math.abs(p-g)-function(x,v,b){let R=0;const O=x-f(x,b),A=v-f(v,b);for(let M=0;M<Math.abs(O-A);M++){const F=m(x,v)==="A"?-1:1,U=b.buffer.lines.get(O+F*M);U!=null&&U.isWrapped&&R++}return R}(h,l,o);return S(w,k(m(h,l),c))}function f(h,l){let o=0,c=l.buffer.lines.get(h),p=c==null?void 0:c.isWrapped;for(;p&&h>=0&&h<l.rows;)o++,c=l.buffer.lines.get(--h),p=c==null?void 0:c.isWrapped;return o}function m(h,l){return h>l?"A":"B"}function C(h,l,o,c,p,g){let w=h,x=l,v="";for(;w!==o||x!==c;)w+=p?1:-1,p&&w>g.cols-1?(v+=g.buffer.translateBufferLineToString(x,!1,h,w),w=0,h=0,x++):!p&&w<0&&(v+=g.buffer.translateBufferLineToString(x,!1,0,h+1),w=g.cols-1,h=w,x--);return v+g.buffer.translateBufferLineToString(x,!1,h,w)}function k(h,l){const o=l?"O":"[";return d.C0.ESC+o+h}function S(h,l){h=Math.floor(h);let o="";for(let c=0;c<h;c++)o+=l;return o}n.moveToCellSequence=function(h,l,o,c){const p=o.buffer.x,g=o.buffer.y;if(!o.buffer.hasScrollback)return function(v,b,R,O,A,M){return y(b,O,A,M).length===0?"":S(C(v,b,v,b-f(b,A),!1,A).length,k("D",M))}(p,g,0,l,o,c)+y(g,l,o,c)+function(v,b,R,O,A,M){let F;F=y(b,O,A,M).length>0?O-f(O,A):b;const U=O,I=function(H,E,T,D,P,W){let G;return G=y(T,D,P,W).length>0?D-f(D,P):E,H<T&&G<=D||H>=T&&G<D?"C":"D"}(v,b,R,O,A,M);return S(C(v,F,R,U,I==="C",A).length,k(I,M))}(p,g,h,l,o,c);let w;if(g===l)return w=p>h?"D":"C",S(Math.abs(p-h),k(w,c));w=g>l?"D":"C";const x=Math.abs(g-l);return S(function(v,b){return b.cols-v}(g>l?h:p,o)+(x-1)*o.cols+1+((g>l?p:h)-1),k(w,c))}},1296:function(_,n,u){var d=this&&this.__decorate||function(A,M,F,U){var I,H=arguments.length,E=H<3?M:U===null?U=Object.getOwnPropertyDescriptor(M,F):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,M,F,U);else for(var T=A.length-1;T>=0;T--)(I=A[T])&&(E=(H<3?I(E):H>3?I(M,F,E):I(M,F))||E);return H>3&&E&&Object.defineProperty(M,F,E),E},y=this&&this.__param||function(A,M){return function(F,U){M(F,U,A)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const f=u(3787),m=u(2550),C=u(2223),k=u(6171),S=u(4725),h=u(8055),l=u(8460),o=u(844),c=u(2585),p="xterm-dom-renderer-owner-",g="xterm-rows",w="xterm-fg-",x="xterm-bg-",v="xterm-focus",b="xterm-selection";let R=1,O=n.DomRenderer=class extends o.Disposable{constructor(A,M,F,U,I,H,E,T,D,P){super(),this._element=A,this._screenElement=M,this._viewportElement=F,this._linkifier2=U,this._charSizeService=H,this._optionsService=E,this._bufferService=T,this._coreBrowserService=D,this._themeService=P,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(b),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(W=>this._injectCss(W))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(W=>this._handleLinkHover(W))),this.register(this._linkifier2.onHideLinkUnderline(W=>this._handleLinkLeave(W))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(A){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${g} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${g} .xterm-dim { color: ${h.color.multiplyOpacity(A.foreground,.5).css};}`,M+=`${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;}`,M+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",M+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,M+=`${this._terminalSelector} .${g}.${v} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${g}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[F,U]of A.ansi.entries())M+=`${this._terminalSelector} .${w}${F} { color: ${U.css}; }${this._terminalSelector} .${w}${F}.xterm-dim { color: ${h.color.multiplyOpacity(U,.5).css}; }${this._terminalSelector} .${x}${F} { background-color: ${U.css}; }`;M+=`${this._terminalSelector} .${w}${C.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(A.background).css}; }${this._terminalSelector} .${w}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,M){for(let F=this._rowElements.length;F<=M;F++){const U=document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,M){this._refreshRowElements(A,M),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,M,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,M,F),this.renderRows(0,this._bufferService.rows-1),!A||!M)return;const U=A[1]-this._bufferService.buffer.ydisp,I=M[1]-this._bufferService.buffer.ydisp,H=Math.max(U,0),E=Math.min(I,this._bufferService.rows-1);if(H>=this._bufferService.rows||E<0)return;const T=document.createDocumentFragment();if(F){const D=A[0]>M[0];T.appendChild(this._createSelectionElement(H,D?M[0]:A[0],D?A[0]:M[0],E-H+1))}else{const D=U===H?A[0]:0,P=H===I?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(H,D,P));const W=E-H-1;if(T.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,W)),H!==E){const G=I===E?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(E,0,G))}}this._selectionContainer.appendChild(T)}_createSelectionElement(A,M,F,U=1){const I=document.createElement("div");return I.style.height=U*this.dimensions.css.cell.height+"px",I.style.top=A*this.dimensions.css.cell.height+"px",I.style.left=M*this.dimensions.css.cell.width+"px",I.style.width=this.dimensions.css.cell.width*(F-M)+"px",I}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 A of this._rowElements)A.replaceChildren()}renderRows(A,M){const F=this._bufferService.buffer,U=F.ybase+F.y,I=Math.min(F.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=A;D<=M;D++){const P=D+F.ydisp,W=this._rowElements[D],G=F.lines.get(P);if(!W||!G)break;W.replaceChildren(...this._rowFactory.createRow(G,P,P===U,E,T,I,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,M,F,U,I,H){F<0&&(A=0),U<0&&(M=0);const E=this._bufferService.rows-1;F=Math.max(Math.min(F,E),0),U=Math.max(Math.min(U,E),0),I=Math.min(I,this._bufferService.cols);const T=this._bufferService.buffer,D=T.ybase+T.y,P=Math.min(T.x,I-1),W=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=F;ee<=U;++ee){const _e=ee+T.ydisp,L=this._rowElements[ee],B=T.lines.get(_e);if(!L||!B)break;L.replaceChildren(...this._rowFactory.createRow(B,_e,_e===D,G,re,P,W,this.dimensions.css.cell.width,this._widthCache,H?ee===F?A:0:-1,H?(ee===U?M:I)-1:-1))}}};n.DomRenderer=O=d([y(4,c.IInstantiationService),y(5,S.ICharSizeService),y(6,c.IOptionsService),y(7,c.IBufferService),y(8,S.ICoreBrowserService),y(9,S.IThemeService)],O)},3787:function(_,n,u){var d=this&&this.__decorate||function(w,x,v,b){var R,O=arguments.length,A=O<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(w,x,v,b);else for(var M=w.length-1;M>=0;M--)(R=w[M])&&(A=(O<3?R(A):O>3?R(x,v,A):R(x,v))||A);return O>3&&A&&Object.defineProperty(x,v,A),A},y=this&&this.__param||function(w,x){return function(v,b){x(v,b,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const f=u(2223),m=u(643),C=u(511),k=u(2585),S=u(8055),h=u(4725),l=u(4269),o=u(6171),c=u(3734);let p=n.DomRendererRowFactory=class{constructor(w,x,v,b,R,O,A){this._document=w,this._characterJoinerService=x,this._optionsService=v,this._coreBrowserService=b,this._coreService=R,this._decorationService=O,this._themeService=A,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,x,v){this._selectionStart=w,this._selectionEnd=x,this._columnSelectMode=v}createRow(w,x,v,b,R,O,A,M,F,U,I){const H=[],E=this._characterJoinerService.getJoinedCharacters(x),T=this._themeService.colors;let D,P=w.getNoBgTrimmedLength();v&&P<O+1&&(P=O+1);let W=0,G="",re=0,ee=0,_e=0,L=!1,B=0,V=!1,z=0;const N=[],K=U!==-1&&I!==-1;for(let Y=0;Y<P;Y++){w.loadCell(Y,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let le=!1,ne=Y,ce=this._workCell;if(E.length>0&&Y===E[0][0]){le=!0;const be=E.shift();ce=new l.JoinedCellData(this._workCell,w.translateToString(!0,be[0],be[1]),be[1]-be[0]),ne=be[1]-1,pe=ce.getWidth()}const Zt=this._isCellInSelection(Y,x),qe=v&&Y===O,Ir=K&&Y>=U&&Y<=I;let Nr=!1;this._decorationService.forEachDecorationAtCell(Y,x,void 0,be=>{Nr=!0});let Hr=ce.getChars()||m.WHITESPACE_CELL_CHAR;if(Hr===" "&&(ce.isUnderline()||ce.isOverline())&&(Hr=" "),z=pe*M-F.get(Hr,ce.isBold(),ce.isItalic()),D){if(W&&(Zt&&V||!Zt&&!V&&ce.bg===re)&&(Zt&&V&&T.selectionForeground||ce.fg===ee)&&ce.extended.ext===_e&&Ir===L&&z===B&&!qe&&!le&&!Nr){G+=Hr,W++;continue}W&&(D.textContent=G),D=this._document.createElement("span"),W=0,G=""}else D=this._document.createElement("span");if(re=ce.bg,ee=ce.fg,_e=ce.extended.ext,L=Ir,B=z,V=Zt,le&&O>=Y&&O<=ne&&(O=Y),!this._coreService.isCursorHidden&&qe){if(N.push("xterm-cursor"),this._coreBrowserService.isFocused)A&&N.push("xterm-cursor-blink"),N.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":N.push("xterm-cursor-outline");break;case"block":N.push("xterm-cursor-block");break;case"bar":N.push("xterm-cursor-bar");break;case"underline":N.push("xterm-cursor-underline")}}if(ce.isBold()&&N.push("xterm-bold"),ce.isItalic()&&N.push("xterm-italic"),ce.isDim()&&N.push("xterm-dim"),G=ce.isInvisible()?m.WHITESPACE_CELL_CHAR:ce.getChars()||m.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(N.push(`xterm-underline-${ce.extended.underlineStyle}`),G===" "&&(G=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let be=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&be<8&&(be+=8),D.style.textDecorationColor=T.ansi[be].css}ce.isOverline()&&(N.push("xterm-overline"),G===" "&&(G=" ")),ce.isStrikethrough()&&N.push("xterm-strikethrough"),Ir&&(D.style.textDecoration="underline");let Ne=ce.getFgColor(),Ht=ce.getFgColorMode(),Pe=ce.getBgColor(),wt=ce.getBgColorMode();const Dt=!!ce.isInverse();if(Dt){const be=Ne;Ne=Pe,Pe=be;const Is=Ht;Ht=wt,wt=Is}let Ft,cr,ft,qt=!1;switch(this._decorationService.forEachDecorationAtCell(Y,x,void 0,be=>{be.options.layer!=="top"&&qt||(be.backgroundColorRGB&&(wt=50331648,Pe=be.backgroundColorRGB.rgba>>8&16777215,Ft=be.backgroundColorRGB),be.foregroundColorRGB&&(Ht=50331648,Ne=be.foregroundColorRGB.rgba>>8&16777215,cr=be.foregroundColorRGB),qt=be.options.layer==="top")}),!qt&&Zt&&(Ft=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,Pe=Ft.rgba>>8&16777215,wt=50331648,qt=!0,T.selectionForeground&&(Ht=50331648,Ne=T.selectionForeground.rgba>>8&16777215,cr=T.selectionForeground)),qt&&N.push("xterm-decoration-top"),wt){case 16777216:case 33554432:ft=T.ansi[Pe],N.push(`xterm-bg-${Pe}`);break;case 50331648:ft=S.rgba.toColor(Pe>>16,Pe>>8&255,255&Pe),this._addStyle(D,`background-color:#${g((Pe>>>0).toString(16),"0",6)}`);break;default:Dt?(ft=T.foreground,N.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):ft=T.background}switch(Ft||ce.isDim()&&(Ft=S.color.multiplyOpacity(ft,.5)),Ht){case 16777216:case 33554432:ce.isBold()&&Ne<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ne+=8),this._applyMinimumContrast(D,ft,T.ansi[Ne],ce,Ft,void 0)||N.push(`xterm-fg-${Ne}`);break;case 50331648:const be=S.rgba.toColor(Ne>>16&255,Ne>>8&255,255&Ne);this._applyMinimumContrast(D,ft,be,ce,Ft,cr)||this._addStyle(D,`color:#${g(Ne.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,ft,T.foreground,ce,Ft,void 0)||Dt&&N.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}N.length&&(D.className=N.join(" "),N.length=0),qe||le||Nr?D.textContent=G:W++,z!==this.defaultSpacing&&(D.style.letterSpacing=`${z}px`),H.push(D),Y=ne}return D&&W&&(D.textContent=G),H}_applyMinimumContrast(w,x,v,b,R,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(b.getCode()))return!1;const A=this._getContrastCache(b);let M;if(R||O||(M=A.getColor(x.rgba,v.rgba)),M===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);M=S.color.ensureContrastRatio(R||x,O||v,F),A.setColor((R||x).rgba,(O||v).rgba,M??null)}return!!M&&(this._addStyle(w,`color:${M.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,x){w.setAttribute("style",`${w.getAttribute("style")||""}${x};`)}_isCellInSelection(w,x){const v=this._selectionStart,b=this._selectionEnd;return!(!v||!b)&&(this._columnSelectMode?v[0]<=b[0]?w>=v[0]&&x>=v[1]&&w<b[0]&&x<=b[1]:w<v[0]&&x>=v[1]&&w>=b[0]&&x<=b[1]:x>v[1]&&x<b[1]||v[1]===b[1]&&x===v[1]&&w>=v[0]&&w<b[0]||v[1]<b[1]&&x===b[1]&&w<b[0]||v[1]<b[1]&&x===v[1]&&w>=v[0])}};function g(w,x,v){for(;w.length<v;)w=x+w;return w}n.DomRendererRowFactory=p=d([y(1,h.ICharacterJoinerService),y(2,k.IOptionsService),y(3,h.ICoreBrowserService),y(4,k.ICoreService),y(5,k.IDecorationService),y(6,h.IThemeService)],p)},2550:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u){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.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=u.createElement("span"),y=u.createElement("span");y.style.fontWeight="bold";const f=u.createElement("span");f.style.fontStyle="italic";const m=u.createElement("span");m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[d,y,f,m],this._container.appendChild(d),this._container.appendChild(y),this._container.appendChild(f),this._container.appendChild(m),u.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,d,y,f){u===this._font&&d===this._fontSize&&y===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=d,this._weight=y,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,d,y){let f=0;if(!d&&!y&&u.length===1&&(f=u.charCodeAt(0))<256)return this._flat[f]!==-9999?this._flat[f]:this._flat[f]=this._measure(u,0);let m=u;d&&(m+="B"),y&&(m+="I");let C=this._holey.get(m);if(C===void 0){let k=0;d&&(k|=1),y&&(k|=2),C=this._measure(u,k),this._holey.set(m,C)}return C}_measure(u,d){const y=this._measureElements[d];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,n)=>{function u(d){return 57508<=d&&d<=57558}Object.defineProperty(n,"__esModule",{value:!0}),n.createRenderDimensions=n.excludeFromContrastRatioDemands=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},n.excludeFromContrastRatioDemands=function(d){return u(d)||function(y){return 9472<=y&&y<=9631}(d)},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}}}}},456:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,n,u){var d=this&&this.__decorate||function(h,l,o,c){var p,g=arguments.length,w=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,c);else for(var x=h.length-1;x>=0;x--)(p=h[x])&&(w=(g<3?p(w):g>3?p(l,o,w):p(l,o))||w);return g>3&&w&&Object.defineProperty(l,o,w),w},y=this&&this.__param||function(h,l){return function(o,c){l(o,c,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const f=u(2585),m=u(8460),C=u(844);let k=n.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,l,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new S(h,l,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};n.CharSizeService=k=d([y(2,f.IOptionsService)],k);class S{constructor(l,o,c){this._document=l,this._parentElement=o,this._optionsService=c,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const l={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return l.width!==0&&l.height!==0&&(this._result.width=l.width/32,this._result.height=Math.ceil(l.height)),this._result}}},4269:function(_,n,u){var d=this&&this.__decorate||function(l,o,c,p){var g,w=arguments.length,x=w<3?o:p===null?p=Object.getOwnPropertyDescriptor(o,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,o,c,p);else for(var v=l.length-1;v>=0;v--)(g=l[v])&&(x=(w<3?g(x):w>3?g(o,c,x):g(o,c))||x);return w>3&&x&&Object.defineProperty(o,c,x),x},y=this&&this.__param||function(l,o){return function(c,p){o(c,p,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const f=u(3734),m=u(643),C=u(511),k=u(2585);class S extends f.AttributeData{constructor(o,c,p){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=S;let h=n.CharacterJoinerService=class Id{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(o){const c={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(c),c.id}deregister(o){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===o)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(o);if(!c||c.length===0)return[];const p=[],g=c.translateToString(!0);let w=0,x=0,v=0,b=c.getFg(0),R=c.getBg(0);for(let O=0;O<c.getTrimmedLength();O++)if(c.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==R){if(O-w>1){const A=this._getJoinedRanges(g,v,x,c,w);for(let M=0;M<A.length;M++)p.push(A[M])}w=O,v=x,b=this._workCell.fg,R=this._workCell.bg}x+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const O=this._getJoinedRanges(g,v,x,c,w);for(let A=0;A<O.length;A++)p.push(O[A])}return p}_getJoinedRanges(o,c,p,g,w){const x=o.substring(c,p);let v=[];try{v=this._characterJoiners[0].handler(x)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const R=this._characterJoiners[b].handler(x);for(let O=0;O<R.length;O++)Id._mergeRanges(v,R[O])}catch(R){console.error(R)}return this._stringRangesToCellRanges(v,g,w),v}_stringRangesToCellRanges(o,c,p){let g=0,w=!1,x=0,v=o[g];if(v){for(let b=p;b<this._bufferService.cols;b++){const R=c.getWidth(b),O=c.getString(b).length||m.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!w&&v[0]<=x&&(v[0]=b,w=!0),v[1]<=x){if(v[1]=b,v=o[++g],!v)break;v[0]<=x?(v[0]=b,w=!0):w=!1}x+=O}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(o,c){let p=!1;for(let g=0;g<o.length;g++){const w=o[g];if(p){if(c[1]<=w[0])return o[g-1][1]=c[1],o;if(c[1]<=w[1])return o[g-1][1]=Math.max(c[1],w[1]),o.splice(g,1),o;o.splice(g,1),g--}else{if(c[1]<=w[0])return o.splice(g,0,c),o;if(c[1]<=w[1])return w[0]=Math.min(c[0],w[0]),o;c[0]<w[1]&&(w[0]=Math.min(c[0],w[0]),p=!0)}}return p?o[o.length-1][1]=c[1]:o.push(c),o}};n.CharacterJoinerService=h=d([y(0,k.IBufferService)],h)},5114:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0,n.CoreBrowserService=class{constructor(u,d){this._textarea=u,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(_,n,u){var d=this&&this.__decorate||function(k,S,h,l){var o,c=arguments.length,p=c<3?S:l===null?l=Object.getOwnPropertyDescriptor(S,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(k,S,h,l);else for(var g=k.length-1;g>=0;g--)(o=k[g])&&(p=(c<3?o(p):c>3?o(S,h,p):o(S,h))||p);return c>3&&p&&Object.defineProperty(S,h,p),p},y=this&&this.__param||function(k,S){return function(h,l){S(h,l,k)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const f=u(4725),m=u(9806);let C=n.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,h,l,o){return(0,m.getCoords)(window,k,S,h,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(k,S){const h=(0,m.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};n.MouseService=C=d([y(0,f.IRenderService),y(1,f.ICharSizeService)],C)},3230:function(_,n,u){var d=this&&this.__decorate||function(p,g,w,x){var v,b=arguments.length,R=b<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,w):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,g,w,x);else for(var O=p.length-1;O>=0;O--)(v=p[O])&&(R=(b<3?v(R):b>3?v(g,w,R):v(g,w))||R);return b>3&&R&&Object.defineProperty(g,w,R),R},y=this&&this.__param||function(p,g){return function(w,x){g(w,x,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const f=u(3656),m=u(6193),C=u(5596),k=u(4725),S=u(8460),h=u(844),l=u(7226),o=u(2585);let c=n.RenderService=class extends h.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,g,w,x,v,b,R,O){if(super(),this._rowCount=p,this._charSizeService=x,this._renderer=this.register(new h.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(R.window,(A,M)=>this._renderRows(A,M)),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)===null||A===void 0?void 0:A.clear()})),this.register(w.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(v.onDecorationRegistered(()=>this._fullRefresh())),this.register(v.onDecorationRemoved(()=>this._fullRefresh())),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register((0,f.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(O.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const A=new R.window.IntersectionObserver(M=>this._handleIntersectionChange(M[M.length-1]),{threshold:0});A.observe(g),this.register({dispose:()=>A.disconnect()})}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,g,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,g,this._rowCount))}_renderRows(p,g){this._renderer.value&&(p=Math.min(p,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(p,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:g}),this._onRender.fire({start:p,end:g}),this._isNextRenderRedrawOnly=!0)}resize(p,g){this._rowCount=g,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(p){this._renderer.value=p,this._renderer.value.onRequestRedraw(g=>this.refreshRows(g.start,g.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,g;this._renderer.value&&((g=(p=this._renderer.value).clearTextureAtlas)===null||g===void 0||g.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(p,g)):this._renderer.value.handleResize(p,g),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)===null||p===void 0||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)===null||p===void 0||p.handleFocus()}handleSelectionChanged(p,g,w){var x;this._selectionState.start=p,this._selectionState.end=g,this._selectionState.columnSelectMode=w,(x=this._renderer.value)===null||x===void 0||x.handleSelectionChanged(p,g,w)}handleCursorMove(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)===null||p===void 0||p.clear()}};n.RenderService=c=d([y(2,o.IOptionsService),y(3,k.ICharSizeService),y(4,o.IDecorationService),y(5,o.IBufferService),y(6,k.ICoreBrowserService),y(7,k.IThemeService)],c)},9312:function(_,n,u){var d=this&&this.__decorate||function(v,b,R,O){var A,M=arguments.length,F=M<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(v,b,R,O);else for(var U=v.length-1;U>=0;U--)(A=v[U])&&(F=(M<3?A(F):M>3?A(b,R,F):A(b,R))||F);return M>3&&F&&Object.defineProperty(b,R,F),F},y=this&&this.__param||function(v,b){return function(R,O){b(R,O,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const f=u(9806),m=u(9504),C=u(456),k=u(4725),S=u(8460),h=u(844),l=u(6114),o=u(4841),c=u(511),p=u(2585),g=" ",w=new RegExp(g,"g");let x=n.SelectionService=class extends h.Disposable{constructor(v,b,R,O,A,M,F,U,I){super(),this._element=v,this._screenElement=b,this._linkifier=R,this._bufferService=O,this._coreService=A,this._mouseService=M,this._optionsService=F,this._renderService=U,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.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 v=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!v||!b||v[0]===b[0]&&v[1]===b[1])}get selectionText(){const v=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!v||!b)return"";const R=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(v[0]===b[0])return"";const A=v[0]<b[0]?v[0]:b[0],M=v[0]<b[0]?b[0]:v[0];for(let F=v[1];F<=b[1];F++){const U=R.translateBufferLineToString(F,!0,A,M);O.push(U)}}else{const A=v[1]===b[1]?b[0]:void 0;O.push(R.translateBufferLineToString(v[1],!0,v[0],A));for(let M=v[1]+1;M<=b[1]-1;M++){const F=R.lines.get(M),U=R.translateBufferLineToString(M,!0);F!=null&&F.isWrapped?O[O.length-1]+=U:O.push(U)}if(v[1]!==b[1]){const M=R.lines.get(b[1]),F=R.translateBufferLineToString(b[1],!0,0,b[0]);M&&M.isWrapped?O[O.length-1]+=F:O.push(F)}}return O.map(A=>A.replace(w," ")).join(l.isWindows?`\r
56
+ `:`
57
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.isLinux&&v&&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(v){const b=this._getMouseBufferCoords(v),R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(R&&O&&b)&&this._areCoordsInSelection(b,R,O)}isCellInSelection(v,b){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!R||!O)&&this._areCoordsInSelection([v,b],R,O)}_areCoordsInSelection(v,b,R){return v[1]>b[1]&&v[1]<R[1]||b[1]===R[1]&&v[1]===b[1]&&v[0]>=b[0]&&v[0]<R[0]||b[1]<R[1]&&v[1]===R[1]&&v[0]<R[0]||b[1]<R[1]&&v[1]===b[1]&&v[0]>=b[0]}_selectWordAtCursor(v,b){var R,O;const A=(O=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||O===void 0?void 0:O.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(v);return!!M&&(this._selectWordAt(M,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,b){this._model.clearSelection(),v=Math.max(v,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const b=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(v){let b=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=R?0:(b>R&&(b-=R),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(v){return l.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const b=this._getMouseBufferCoords(v);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(v){return v.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const O=R.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const b=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const O=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,R=!(!v||!b||v[0]===b[0]&&v[1]===b[1]);R?v&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,b,R)):this._oldHasSelection&&this._fireOnSelectionChange(v,b,R)}_fireOnSelectionChange(v,b,R){this._oldSelectionStart=v,this._oldSelectionEnd=b,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(v,b){let R=b;for(let O=0;b>=O;O++){const A=v.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:A>1&&b!==O&&(R+=A-1)}return R}setSelection(v,b,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,b],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,b,R=!0,O=!0){if(v[0]>=this._bufferService.cols)return;const A=this._bufferService.buffer,M=A.lines.get(v[1]);if(!M)return;const F=A.translateBufferLineToString(v[1],!1);let U=this._convertViewportColToCharacterIndex(M,v[0]),I=U;const H=v[0]-U;let E=0,T=0,D=0,P=0;if(F.charAt(U)===" "){for(;U>0&&F.charAt(U-1)===" ";)U--;for(;I<F.length&&F.charAt(I+1)===" ";)I++}else{let re=v[0],ee=v[0];M.getWidth(re)===0&&(E++,re--),M.getWidth(ee)===2&&(T++,ee++);const _e=M.getString(ee).length;for(_e>1&&(P+=_e-1,I+=_e-1);re>0&&U>0&&!this._isCharWordSeparator(M.loadCell(re-1,this._workCell));){M.loadCell(re-1,this._workCell);const L=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,re--):L>1&&(D+=L-1,U-=L-1),U--,re--}for(;ee<M.length&&I+1<F.length&&!this._isCharWordSeparator(M.loadCell(ee+1,this._workCell));){M.loadCell(ee+1,this._workCell);const L=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,ee++):L>1&&(P+=L-1,I+=L-1),I++,ee++}}I++;let W=U+H-E+D,G=Math.min(this._bufferService.cols,I-U+E+T-D-P);if(b||F.slice(U,I).trim()!==""){if(R&&W===0&&M.getCodePoint(0)!==32){const re=A.lines.get(v[1]-1);if(re&&M.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(ee){const _e=this._bufferService.cols-ee.start;W-=_e,G+=_e}}}if(O&&W+G===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const re=A.lines.get(v[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ee=this._getWordAt([0,v[1]+1],!1,!1,!0);ee&&(G+=ee.length)}}return{start:W,length:G}}}_selectWordAt(v,b){const R=this._getWordAt(v,b);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[R.start,v[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(v){const b=this._getWordAt(v,!0);if(b){let R=v[1];for(;b.start<0;)b.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,R]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const b=this._bufferService.buffer.getWrappedRangeForLine(v),R={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(R,this._bufferService.cols)}};n.SelectionService=x=d([y(3,p.IBufferService),y(4,p.ICoreService),y(5,k.IMouseService),y(6,p.IOptionsService),y(7,k.IRenderService),y(8,k.ICoreBrowserService)],x)},4725:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=u(8343);n.ICharSizeService=(0,d.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),n.IMouseService=(0,d.createDecorator)("MouseService"),n.IRenderService=(0,d.createDecorator)("RenderService"),n.ISelectionService=(0,d.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(_,n,u){var d=this&&this.__decorate||function(x,v,b,R){var O,A=arguments.length,M=A<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,v,b,R);else for(var F=x.length-1;F>=0;F--)(O=x[F])&&(M=(A<3?O(M):A>3?O(v,b,M):O(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},y=this&&this.__param||function(x,v){return function(b,R){v(b,R,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),m=u(8055),C=u(8460),k=u(844),S=u(2585),h=m.css.toColor("#ffffff"),l=m.css.toColor("#000000"),o=m.css.toColor("#ffffff"),c=m.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const x=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=v[b/36%6|0],O=v[b/6%6|0],A=v[b%6];x.push({css:m.channels.toCss(R,O,A),rgba:m.channels.toRgba(R,O,A)})}for(let b=0;b<24;b++){const R=8+10*b;x.push({css:m.channels.toCss(R,R,R),rgba:m.channels.toRgba(R,R,R)})}return x})());let g=n.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(x){super(),this._optionsService=x,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:l,cursor:o,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:m.color.blend(l,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:m.color.blend(l,p),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(x={}){const v=this._colors;if(v.foreground=w(x.foreground,h),v.background=w(x.background,l),v.cursor=w(x.cursor,o),v.cursorAccent=w(x.cursorAccent,c),v.selectionBackgroundTransparent=w(x.selectionBackground,p),v.selectionBackgroundOpaque=m.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=w(x.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=m.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=x.selectionForeground?w(x.selectionForeground,m.NULL_COLOR):void 0,v.selectionForeground===m.NULL_COLOR&&(v.selectionForeground=void 0),m.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=m.color.opacity(v.selectionBackgroundTransparent,.3)),m.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=m.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=n.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=w(x.black,n.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=w(x.red,n.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=w(x.green,n.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=w(x.yellow,n.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=w(x.blue,n.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=w(x.magenta,n.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=w(x.cyan,n.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=w(x.white,n.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=w(x.brightBlack,n.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=w(x.brightRed,n.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=w(x.brightGreen,n.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=w(x.brightYellow,n.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=w(x.brightBlue,n.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=w(x.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=w(x.brightCyan,n.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=w(x.brightWhite,n.DEFAULT_ANSI_COLORS[15]),x.extendedAnsi){const b=Math.min(v.ansi.length-16,x.extendedAnsi.length);for(let R=0;R<b;R++)v.ansi[R+16]=w(x.extendedAnsi[R],n.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(x){this._restoreColor(x),this._onChangeColors.fire(this.colors)}_restoreColor(x){if(x!==void 0)switch(x){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[x]=this._restoreColors.ansi[x]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(x){x(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 w(x,v){if(x!==void 0)try{return m.css.toColor(x)}catch{}return v}n.ThemeService=g=d([y(0,S.IOptionsService)],g)},6349:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=u(8460),y=u(844);class f extends y.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const k=new Array(C);for(let S=0;S<Math.min(C,this.length);S++)k[S]=this._array[this._getCyclicIndex(S)];this._array=k,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let k=this._length;k<C;k++)this._array[k]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,k){this._array[this._getCyclicIndex(C)]=k}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,k,...S){if(k){for(let h=C;h<this._length-k;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+k)];this._length-=k,this.onDeleteEmitter.fire({index:C,amount:k})}for(let h=this._length-1;h>=C;h--)this._array[this._getCyclicIndex(h+S.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<S.length;h++)this._array[this._getCyclicIndex(C+h)]=S[h];if(S.length&&this.onInsertEmitter.fire({index:C,amount:S.length}),this._length+S.length>this._maxLength){const h=this._length+S.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=S.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,k,S){if(!(k<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let l=k-1;l>=0;l--)this.set(C+l+S,this.get(C+l));const h=C+k+S-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<k;h++)this.set(C+h+S,this.get(C+h))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}n.CircularList=f},1439:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(d,y=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const m in d)f[m]=y<=1?d[m]:d[m]&&u(d[m],y-1);return f}},8055:(_,n,u)=>{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;const d=u(6114);let y=0,f=0,m=0,C=0;var k,S,h,l,o;function c(g){const w=g.toString(16);return w.length<2?"0"+w:w}function p(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,x,v,b){return b!==void 0?`#${c(w)}${c(x)}${c(v)}${c(b)}`:`#${c(w)}${c(x)}${c(v)}`},g.toRgba=function(w,x,v,b=255){return(w<<24|x<<16|v<<8|b)>>>0}}(k||(n.channels=k={})),function(g){function w(x,v){return C=Math.round(255*v),[y,f,m]=o.toChannels(x.rgba),{css:k.toCss(y,f,m,C),rgba:k.toRgba(y,f,m,C)}}g.blend=function(x,v){if(C=(255&v.rgba)/255,C===1)return{css:v.css,rgba:v.rgba};const b=v.rgba>>24&255,R=v.rgba>>16&255,O=v.rgba>>8&255,A=x.rgba>>24&255,M=x.rgba>>16&255,F=x.rgba>>8&255;return y=A+Math.round((b-A)*C),f=M+Math.round((R-M)*C),m=F+Math.round((O-F)*C),{css:k.toCss(y,f,m),rgba:k.toRgba(y,f,m)}},g.isOpaque=function(x){return(255&x.rgba)==255},g.ensureContrastRatio=function(x,v,b){const R=o.ensureContrastRatio(x.rgba,v.rgba,b);if(R)return o.toColor(R>>24&255,R>>16&255,R>>8&255)},g.opaque=function(x){const v=(255|x.rgba)>>>0;return[y,f,m]=o.toChannels(v),{css:k.toCss(y,f,m),rgba:v}},g.opacity=w,g.multiplyOpacity=function(x,v){return C=255&x.rgba,w(x,C*v/255)},g.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}}(S||(n.color=S={})),function(g){let w,x;if(!d.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const b=v.getContext("2d",{willReadFrequently:!0});b&&(w=b,w.globalCompositeOperation="copy",x=w.createLinearGradient(0,0,1,1))}g.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return y=parseInt(v.slice(1,2).repeat(2),16),f=parseInt(v.slice(2,3).repeat(2),16),m=parseInt(v.slice(3,4).repeat(2),16),o.toColor(y,f,m);case 5:return y=parseInt(v.slice(1,2).repeat(2),16),f=parseInt(v.slice(2,3).repeat(2),16),m=parseInt(v.slice(3,4).repeat(2),16),C=parseInt(v.slice(4,5).repeat(2),16),o.toColor(y,f,m,C);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 b=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(b)return y=parseInt(b[1]),f=parseInt(b[2]),m=parseInt(b[3]),C=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),o.toColor(y,f,m,C);if(!w||!x)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=x,w.fillStyle=v,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[y,f,m,C]=w.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:k.toRgba(y,f,m,C),css:v}}}(h||(n.css=h={})),function(g){function w(x,v,b){const R=x/255,O=v/255,A=b/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}g.relativeLuminance=function(x){return w(x>>16&255,x>>8&255,255&x)},g.relativeLuminance2=w}(l||(n.rgb=l={})),function(g){function w(v,b,R){const O=v>>24&255,A=v>>16&255,M=v>>8&255;let F=b>>24&255,U=b>>16&255,I=b>>8&255,H=p(l.relativeLuminance2(F,U,I),l.relativeLuminance2(O,A,M));for(;H<R&&(F>0||U>0||I>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),I-=Math.max(0,Math.ceil(.1*I)),H=p(l.relativeLuminance2(F,U,I),l.relativeLuminance2(O,A,M));return(F<<24|U<<16|I<<8|255)>>>0}function x(v,b,R){const O=v>>24&255,A=v>>16&255,M=v>>8&255;let F=b>>24&255,U=b>>16&255,I=b>>8&255,H=p(l.relativeLuminance2(F,U,I),l.relativeLuminance2(O,A,M));for(;H<R&&(F<255||U<255||I<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),I=Math.min(255,I+Math.ceil(.1*(255-I))),H=p(l.relativeLuminance2(F,U,I),l.relativeLuminance2(O,A,M));return(F<<24|U<<16|I<<8|255)>>>0}g.ensureContrastRatio=function(v,b,R){const O=l.relativeLuminance(v>>8),A=l.relativeLuminance(b>>8);if(p(O,A)<R){if(A<O){const U=w(v,b,R),I=p(O,l.relativeLuminance(U>>8));if(I<R){const H=x(v,b,R);return I>p(O,l.relativeLuminance(H>>8))?U:H}return U}const M=x(v,b,R),F=p(O,l.relativeLuminance(M>>8));if(F<R){const U=w(v,b,R);return F>p(O,l.relativeLuminance(U>>8))?M:U}return M}},g.reduceLuminance=w,g.increaseLuminance=x,g.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]},g.toColor=function(v,b,R,O){return{css:k.toCss(v,b,R,O),rgba:k.toRgba(v,b,R,O)}}}(o||(n.rgba=o={})),n.toPaddedHex=c,n.contrastRatio=p},8969:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=u(844),y=u(2585),f=u(4348),m=u(7866),C=u(744),k=u(7302),S=u(6975),h=u(8460),l=u(1753),o=u(1480),c=u(7994),p=u(9282),g=u(5435),w=u(5981),x=u(2660);let v=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(O=>{var A;(A=this._onScrollApi)===null||A===void 0||A.fire(O.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(O){for(const A in O)this.optionsService.options[A]=O[A]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(O)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(x.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.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(A=>{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(A=>{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 w.WriteBuffer((A,M)=>this._inputHandler.parse(A,M))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,A){this._writeBuffer.write(O,A)}writeSync(O,A){this._logService.logLevel<=y.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(O,A)}resize(O,A){isNaN(O)||isNaN(A)||(O=Math.max(O,C.MINIMUM_COLS),A=Math.max(A,C.MINIMUM_ROWS),this._bufferService.resize(O,A))}scroll(O,A=!1){this._bufferService.scroll(O,A)}scrollLines(O,A,M){this._bufferService.scrollLines(O,A,M)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const A=O-this._bufferService.buffer.ydisp;A!==0&&this.scrollLines(A)}registerEscHandler(O,A){return this._inputHandler.registerEscHandler(O,A)}registerDcsHandler(O,A){return this._inputHandler.registerDcsHandler(O,A)}registerCsiHandler(O,A){return this._inputHandler.registerCsiHandler(O,A)}registerOscHandler(O,A){return this._inputHandler.registerOscHandler(O,A)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const A=this.optionsService.rawOptions.windowsPty;A&&A.buildNumber!==void 0&&A.buildNumber!==void 0?O=A.backend==="conpty"&&A.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const A of O)A.dispose()})}}}n.CoreTerminal=b},8460:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const y=[];for(let f=0;f<this._listeners.length;f++)y.push(this._listeners[f]);for(let f=0;f<y.length;f++)y[f].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u(y=>d.fire(y))}},5435:function(_,n,u){var d=this&&this.__decorate||function(H,E,T,D){var P,W=arguments.length,G=W<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(H,E,T,D);else for(var re=H.length-1;re>=0;re--)(P=H[re])&&(G=(W<3?P(G):W>3?P(E,T,G):P(E,T))||G);return W>3&&G&&Object.defineProperty(E,T,G),G},y=this&&this.__param||function(H,E){return function(T,D){E(T,D,H)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const f=u(2584),m=u(7116),C=u(2015),k=u(844),S=u(482),h=u(8437),l=u(8460),o=u(643),c=u(511),p=u(3734),g=u(2585),w=u(6242),x=u(6351),v=u(5941),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function O(H,E){if(H>24)return E.setWinLines||!1;switch(H){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(n.WindowsOptionsReportType=A={}));let M=0;class F extends k.Disposable{getAttrData(){return this._curAttrData}constructor(E,T,D,P,W,G,re,ee,_e=new C.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=T,this._coreService=D,this._logService=P,this._optionsService=W,this._oscLinkService=G,this._coreMouseService=re,this._unicodeService=ee,this._parser=_e,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.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(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,B)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:B.toArray()})}),this._parser.setEscHandlerFallback(L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})}),this._parser.setExecuteHandlerFallback(L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})}),this._parser.setOscHandlerFallback((L,B,V)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:B,data:V})}),this._parser.setDcsHandlerFallback((L,B,V)=>{B==="HOOK"&&(V=V.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:B,payload:V})}),this._parser.setPrintHandler((L,B,V)=>this.print(L,B,V)),this._parser.registerCsiHandler({final:"@"},L=>this.insertChars(L)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},L=>this.scrollLeft(L)),this._parser.registerCsiHandler({final:"A"},L=>this.cursorUp(L)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},L=>this.scrollRight(L)),this._parser.registerCsiHandler({final:"B"},L=>this.cursorDown(L)),this._parser.registerCsiHandler({final:"C"},L=>this.cursorForward(L)),this._parser.registerCsiHandler({final:"D"},L=>this.cursorBackward(L)),this._parser.registerCsiHandler({final:"E"},L=>this.cursorNextLine(L)),this._parser.registerCsiHandler({final:"F"},L=>this.cursorPrecedingLine(L)),this._parser.registerCsiHandler({final:"G"},L=>this.cursorCharAbsolute(L)),this._parser.registerCsiHandler({final:"H"},L=>this.cursorPosition(L)),this._parser.registerCsiHandler({final:"I"},L=>this.cursorForwardTab(L)),this._parser.registerCsiHandler({final:"J"},L=>this.eraseInDisplay(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},L=>this.eraseInDisplay(L,!0)),this._parser.registerCsiHandler({final:"K"},L=>this.eraseInLine(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},L=>this.eraseInLine(L,!0)),this._parser.registerCsiHandler({final:"L"},L=>this.insertLines(L)),this._parser.registerCsiHandler({final:"M"},L=>this.deleteLines(L)),this._parser.registerCsiHandler({final:"P"},L=>this.deleteChars(L)),this._parser.registerCsiHandler({final:"S"},L=>this.scrollUp(L)),this._parser.registerCsiHandler({final:"T"},L=>this.scrollDown(L)),this._parser.registerCsiHandler({final:"X"},L=>this.eraseChars(L)),this._parser.registerCsiHandler({final:"Z"},L=>this.cursorBackwardTab(L)),this._parser.registerCsiHandler({final:"`"},L=>this.charPosAbsolute(L)),this._parser.registerCsiHandler({final:"a"},L=>this.hPositionRelative(L)),this._parser.registerCsiHandler({final:"b"},L=>this.repeatPrecedingCharacter(L)),this._parser.registerCsiHandler({final:"c"},L=>this.sendDeviceAttributesPrimary(L)),this._parser.registerCsiHandler({prefix:">",final:"c"},L=>this.sendDeviceAttributesSecondary(L)),this._parser.registerCsiHandler({final:"d"},L=>this.linePosAbsolute(L)),this._parser.registerCsiHandler({final:"e"},L=>this.vPositionRelative(L)),this._parser.registerCsiHandler({final:"f"},L=>this.hVPosition(L)),this._parser.registerCsiHandler({final:"g"},L=>this.tabClear(L)),this._parser.registerCsiHandler({final:"h"},L=>this.setMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"h"},L=>this.setModePrivate(L)),this._parser.registerCsiHandler({final:"l"},L=>this.resetMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"l"},L=>this.resetModePrivate(L)),this._parser.registerCsiHandler({final:"m"},L=>this.charAttributes(L)),this._parser.registerCsiHandler({final:"n"},L=>this.deviceStatus(L)),this._parser.registerCsiHandler({prefix:"?",final:"n"},L=>this.deviceStatusPrivate(L)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},L=>this.softReset(L)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},L=>this.setCursorStyle(L)),this._parser.registerCsiHandler({final:"r"},L=>this.setScrollRegion(L)),this._parser.registerCsiHandler({final:"s"},L=>this.saveCursor(L)),this._parser.registerCsiHandler({final:"t"},L=>this.windowOptions(L)),this._parser.registerCsiHandler({final:"u"},L=>this.restoreCursor(L)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},L=>this.insertColumns(L)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},L=>this.deleteColumns(L)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},L=>this.selectProtected(L)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},L=>this.requestMode(L,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},L=>this.requestMode(L,!1)),this._parser.setExecuteHandler(f.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(f.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(f.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(f.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(f.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(f.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(f.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(f.C1.IND,()=>this.index()),this._parser.setExecuteHandler(f.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(f.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new w.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new w.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new w.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new w.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new w.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new w.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new w.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new w.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new w.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new w.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new w.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new w.OscHandler(L=>this.restoreCursorColor(L))),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 L in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},()=>this.selectCharset("("+L)),this._parser.registerEscHandler({intermediates:")",final:L},()=>this.selectCharset(")"+L)),this._parser.registerEscHandler({intermediates:"*",final:L},()=>this.selectCharset("*"+L)),this._parser.registerEscHandler({intermediates:"+",final:L},()=>this.selectCharset("+"+L)),this._parser.registerEscHandler({intermediates:"-",final:L},()=>this.selectCharset("-"+L)),this._parser.registerEscHandler({intermediates:".",final:L},()=>this.selectCharset("."+L)),this._parser.registerEscHandler({intermediates:"/",final:L},()=>this.selectCharset("/"+L));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(L=>(this._logService.error("Parsing error: ",L),L)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler((L,B)=>this.requestStatusString(L,B)))}_preserveStack(E,T,D,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=D,this._parseStack.position=P}_logSlowResolvingAsync(E){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([E,new Promise((T,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,T){let D,P=this._activeBuffer.x,W=this._activeBuffer.y,G=0;const re=this._parseStack.paused;if(re){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(D),D;P=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>R&&(G=this._parseStack.position+R)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,ee=>String.fromCharCode(ee)).join("")}"`),typeof E=="string"?E.split("").map(ee=>ee.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(E.length,R))),re||this._dirtyRowTracker.clearRange(),E.length>R)for(let ee=G;ee<E.length;ee+=R){const _e=ee+R<E.length?ee+R:E.length,L=typeof E=="string"?this._stringDecoder.decode(E.substring(ee,_e),this._parseBuffer):this._utf8Decoder.decode(E.subarray(ee,_e),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,L))return this._preserveStack(P,W,L,ee),this._logSlowResolvingAsync(D),D}else if(!re){const ee=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(P,W,ee,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===P&&this._activeBuffer.y===W||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,T,D){let P,W;const G=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,_e=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,B=this._curAttrData;let V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-T>0&&V.getWidth(this._activeBuffer.x-1)===2&&V.setCellFromCodePoint(this._activeBuffer.x-1,0,1,B.fg,B.bg,B.extended);for(let z=T;z<D;++z){if(P=E[z],W=this._unicodeService.wcwidth(P),P<127&&G){const N=G[String.fromCharCode(P)];N&&(P=N.charCodeAt(0))}if(re&&this._onA11yChar.fire((0,S.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),W||!this._activeBuffer.x){if(this._activeBuffer.x+W-1>=ee){if(_e){for(;this._activeBuffer.x<ee;)V.setCellFromCodePoint(this._activeBuffer.x++,0,1,B.fg,B.bg,B.extended);this._activeBuffer.x=0,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),V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=ee-1,W===2)continue}if(L&&(V.insertCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(B),B),V.getWidth(ee-1)===2&&V.setCellFromCodePoint(ee-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,B.fg,B.bg,B.extended)),V.setCellFromCodePoint(this._activeBuffer.x++,P,W,B.fg,B.bg,B.extended),W>0)for(;--W;)V.setCellFromCodePoint(this._activeBuffer.x++,0,0,B.fg,B.bg,B.extended)}else V.getWidth(this._activeBuffer.x-1)?V.addCodepointToCell(this._activeBuffer.x-1,P):V.addCodepointToCell(this._activeBuffer.x-2,P)}D-T>0&&(V.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<ee&&D-T>0&&V.getWidth(this._activeBuffer.x)===0&&!V.hasContent(this._activeBuffer.x)&&V.setCellFromCodePoint(this._activeBuffer.x,0,1,B.fg,B.bg,B.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,T){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,T):this._parser.registerCsiHandler(E,D=>!O(D.params[0],this._optionsService.rawOptions.windowOptions)||T(D))}registerDcsHandler(E,T){return this._parser.registerDcsHandler(E,new x.DcsHandler(T))}registerEscHandler(E,T){return this._parser.registerEscHandler(E,T)}registerOscHandler(E,T){return this._parser.registerOscHandler(E,new w.OscHandler(T))}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 E;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&&(!((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||E===void 0)&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,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(E,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=E,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+T)}cursorUp(E){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const T=E.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=E.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=E.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const T=E.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,T,D,P=!1,W=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);G.replaceCells(T,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),W),P&&(G.isWrapped=!1)}_resetBufferLine(E,T=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),D.isWrapped=!1)}eraseInDisplay(E,T=!1){let D;switch(this._restrictCursor(this._bufferService.cols),E.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,T);D<this._bufferService.rows;D++)this._resetBufferLine(D,T);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,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(E,T=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let T=E.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,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;T--;)this._activeBuffer.lines.splice(W-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(E){this._restrictCursor();let T=E.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 P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;T--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let T=E.params[0]||1;for(;T--;)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(E){let T=E.params[0]||1;for(;T--;)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(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=E.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);P.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){if(!this._parser.precedingCodepoint)return!0;const T=E.params[0]||1,D=new Uint32Array(T);for(let P=0;P<T;++P)D[P]=this._parser.precedingCodepoint;return this.print(D,0,D.length),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let T=0;T<E.length;T++)switch(E.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let T=0;T<E.length;T++)switch(E.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(E){for(let T=0;T<E.length;T++)switch(E.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let T=0;T<E.length;T++)switch(E.params[T]){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(),E.params[T]===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(E,T){const D=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:W}=this._coreMouseService,G=this._coreService,{buffers:re,cols:ee}=this._bufferService,{active:_e,alt:L}=re,B=this._optionsService.rawOptions,V=Y=>Y?1:2,z=E.params[0];return N=z,K=T?z===2?4:z===4?V(G.modes.insertMode):z===12?3:z===20?V(B.convertEol):0:z===1?V(D.applicationCursorKeys):z===3?B.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:z===6?V(D.origin):z===7?V(D.wraparound):z===8?3:z===9?V(P==="X10"):z===12?V(B.cursorBlink):z===25?V(!G.isCursorHidden):z===45?V(D.reverseWraparound):z===66?V(D.applicationKeypad):z===67?4:z===1e3?V(P==="VT200"):z===1002?V(P==="DRAG"):z===1003?V(P==="ANY"):z===1004?V(D.sendFocus):z===1005?4:z===1006?V(W==="SGR"):z===1015?4:z===1016?V(W==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?V(_e===L):z===2004?V(D.bracketedPasteMode):0,G.triggerDataEvent(`${f.C0.ESC}[${T?"":"?"}${N};${K}$y`),!0;var N,K}_updateAttrColor(E,T,D,P,W){return T===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([D,P,W])):T===5&&(E&=-50331904,E|=33554432|255&D),E}_extractColor(E,T,D){const P=[0,0,-1,0,0,0];let W=0,G=0;do{if(P[G+W]=E.params[T+G],E.hasSubParams(T+G)){const re=E.getSubParams(T+G);let ee=0;do P[1]===5&&(W=1),P[G+ee+1+W]=re[ee];while(++ee<re.length&&ee+G+1+W<P.length);break}if(P[1]===5&&G+W>=2||P[1]===2&&G+W>=5)break;P[1]&&(W=1)}while(++G+T<E.length&&G+W<P.length);for(let re=2;re<P.length;++re)P[re]===-1&&(P[re]=0);switch(P[0]){case 38:D.fg=this._updateAttrColor(D.fg,P[1],P[3],P[4],P[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,P[1],P[3],P[4],P[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,P[1],P[3],P[4],P[5])}return G}_processUnderline(E,T){T.extended=T.extended.clone(),(!~E||E>5)&&(E=1),T.extended.underlineStyle=E,T.fg|=268435456,E===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(E){E.fg=h.DEFAULT_ATTR_DATA.fg,E.bg=h.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=E.length;let D;const P=this._curAttrData;for(let W=0;W<T;W++)D=E.params[W],D>=30&&D<=37?(P.fg&=-50331904,P.fg|=16777216|D-30):D>=40&&D<=47?(P.bg&=-50331904,P.bg|=16777216|D-40):D>=90&&D<=97?(P.fg&=-50331904,P.fg|=16777224|D-90):D>=100&&D<=107?(P.bg&=-50331904,P.bg|=16777224|D-100):D===0?this._processSGR0(P):D===1?P.fg|=134217728:D===3?P.bg|=67108864:D===4?(P.fg|=268435456,this._processUnderline(E.hasSubParams(W)?E.getSubParams(W)[0]:1,P)):D===5?P.fg|=536870912:D===7?P.fg|=67108864:D===8?P.fg|=1073741824:D===9?P.fg|=2147483648:D===2?P.bg|=134217728:D===21?this._processUnderline(2,P):D===22?(P.fg&=-134217729,P.bg&=-134217729):D===23?P.bg&=-67108865:D===24?(P.fg&=-268435457,this._processUnderline(0,P)):D===25?P.fg&=-536870913:D===27?P.fg&=-67108865:D===28?P.fg&=-1073741825:D===29?P.fg&=2147483647:D===39?(P.fg&=-67108864,P.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):D===49?(P.bg&=-67108864,P.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?W+=this._extractColor(E,W,P):D===53?P.bg|=1073741824:D===55?P.bg&=-1073741825:D===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):D===100?(P.fg&=-67108864,P.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${T};${D}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${T};${D}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.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(E){const T=E.params[0]||1;switch(T){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=T%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(E){const T=E.params[0]||1;let D;return(E.length<2||(D=E.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){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(E){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(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const T=[],D=E.split(";");for(;D.length>1;){const P=D.shift(),W=D.shift();if(/^\d+$/.exec(P)){const G=parseInt(P);if(I(G))if(W==="?")T.push({type:0,index:G});else{const re=(0,v.parseColor)(W);re&&T.push({type:1,index:G,color:re})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(E){const T=E.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(E,T){this._getCurrentLinkId()&&this._finishHyperlink();const D=E.split(":");let P;const W=D.findIndex(G=>G.startsWith("id="));return W!==-1&&(P=D[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,T){const D=E.split(";");for(let P=0;P<D.length&&!(T>=this._specialColors.length);++P,++T)if(D[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const W=(0,v.parseColor)(D[P]);W&&this._onColor.fire([{type:1,index:this._specialColors[T],color:W}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const T=[],D=E.split(";");for(let P=0;P<D.length;++P)if(/^\d+$/.exec(D[P])){const W=parseInt(D[P]);I(W)&&T.push({type:2,index:W})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){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,m.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(b[E[0]],m.CHARSETS[E[1]]||m.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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new c.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const D=this._activeBuffer.ybase+this._activeBuffer.y+T,P=this._activeBuffer.lines.get(D);P&&(P.fill(E),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,T){const D=this._bufferService.buffer,P=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,T){this._dirtyRowTracker.markRangeDirty(E,T)}}n.InputHandler=F;let U=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,E){H>E&&(M=H,H=E,E=M),H<this.start&&(this.start=H),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function I(H){return 0<=H&&H<256}U=d([y(0,g.IBufferService)],U)},844:(_,n)=>{function u(d){for(const y of d)y.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const y=this._disposables.indexOf(d);y!==-1&&this._disposables.splice(y,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var y;this._isDisposed||d===this._value||((y=this._value)===null||y===void 0||y.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,f,m){this._data[y]||(this._data[y]={}),this._data[y][f]=m}get(y,f){return this._data[y]?this._data[y][f]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,y,f,m,C){this._data.get(d,y)||this._data.set(d,y,new u),this._data.get(d,y).set(f,m,C)}get(d,y,f,m){var C;return(C=this._data.get(d,y))===null||C===void 0?void 0:C.get(f,m)}clear(){this._data.clear()}}},6114:(_,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 navigator>"u";const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,y){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let y=0,f=this._array.length-1;for(;f>=y;){let m=y+f>>1;const C=this._getKey(this._array[m]);if(C>d)f=m-1;else{if(!(C<d)){for(;m>0&&this._getKey(this._array[m-1])===d;)m--;return m}y=m+1}}return y}}},7226:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let k=0,S=0,h=C.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),S=Math.max(k,S),l=C.timeRemaining(),1.5*S>l)return h-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-k))}ms`),void this._start();h=l}this.clear()}}class f extends y{_requestCallback(C){return setTimeout(()=>C(this._createDeadline(16)))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const k=Date.now()+C;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}n.PriorityTaskQueue=f,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:f,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=u(643);n.updateWindowsModeWrappedState=function(y){const f=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),m=f==null?void 0:f.get(y.cols-1),C=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);C&&m&&(C.isWrapped=m[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&m[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}constructor(f=0,m=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=m}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},9092:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=u(6349),y=u(7226),f=u(3734),m=u(8437),C=u(4634),k=u(511),S=u(643),h=u(4863),l=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(o,c,p){this._hasScrollback=o,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,c){return new m.BufferLine(this._bufferService.cols,this.getNullCell(o),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const c=o+this._optionsService.rawOptions.scrollback;return c>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:c}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=m.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA);let g=0;const w=this._getCorrectBufferLength(c);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<o)for(let v=0;v<this.lines.length;v++)g+=+this.lines.get(v).resize(o,p);let x=0;if(this._rows<c)for(let v=this._rows;v<c;v++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(o,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+x+1?(this.ybase--,x++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(o,p)));else for(let v=this._rows;v>c;v--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const v=this.lines.length-w;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=w}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,c-1),x&&(this.y+=x),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(o,c),this._cols>o))for(let x=0;x<this.lines.length;x++)g+=+this.lines.get(x).resize(o,p);this._cols=o,this._rows=c,this._memoryCleanupQueue.clear(),g>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,c){this._cols!==o&&(o>this._cols?this._reflowLarger(o,c):this._reflowSmaller(o,c))}_reflowLarger(o,c){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(p.length>0){const g=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(o,c,g.countRemoved)}}_reflowLargerAdjustViewport(o,c,p){const g=this.getNullCell(m.DEFAULT_ATTR_DATA);let w=p;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new m.BufferLine(o,g))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(o,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA),g=[];let w=0;for(let x=this.lines.length-1;x>=0;x--){let v=this.lines.get(x);if(!v||!v.isWrapped&&v.getTrimmedLength()<=o)continue;const b=[v];for(;v.isWrapped&&x>0;)v=this.lines.get(--x),b.unshift(v);const R=this.ybase+this.y;if(R>=x&&R<x+b.length)continue;const O=b[b.length-1].getTrimmedLength(),A=(0,C.reflowSmallerGetNewLineLengths)(b,this._cols,o),M=A.length-b.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const U=[];for(let P=0;P<M;P++){const W=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);U.push(W)}U.length>0&&(g.push({start:x+b.length+w,newLines:U}),w+=U.length),b.push(...U);let I=A.length-1,H=A[I];H===0&&(I--,H=A[I]);let E=b.length-M-1,T=O;for(;E>=0;){const P=Math.min(T,H);if(b[I]===void 0)break;if(b[I].copyCellsFrom(b[E],T-P,H-P,P,!0),H-=P,H===0&&(I--,H=A[I]),T-=P,T===0){E--;const W=Math.max(E,0);T=(0,C.getWrappedLineTrimmedLength)(b,W,this._cols)}}for(let P=0;P<b.length;P++)A[P]<o&&b[P].setCell(A[P],p);let D=M-F;for(;D-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+w)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+c-1)}if(g.length>0){const x=[],v=[];for(let I=0;I<this.lines.length;I++)v.push(this.lines.get(I));const b=this.lines.length;let R=b-1,O=0,A=g[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let M=0;for(let I=Math.min(this.lines.maxLength-1,b+w-1);I>=0;I--)if(A&&A.start>R+M){for(let H=A.newLines.length-1;H>=0;H--)this.lines.set(I--,A.newLines[H]);I++,x.push({index:R+1,amount:A.newLines.length}),M+=A.newLines.length,A=g[++O]}else this.lines.set(I,v[R--]);let F=0;for(let I=x.length-1;I>=0;I--)x[I].index+=F,this.lines.onInsertEmitter.fire(x[I]),F+=x[I].amount;const U=Math.max(0,b+w-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(o,c,p=0,g){const w=this.lines.get(o);return w?w.translateToString(c,p,g):""}getWrappedRangeForLine(o){let c=o,p=o;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===o&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const c=new h.Marker(o);return this.markers.push(c),c.register(this.lines.onTrim(p=>{c.line-=p,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(p=>{c.line>=p.index&&(c.line+=p.amount)})),c.register(this.lines.onDelete(p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=u(3734),y=u(511),f=u(643),m=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let C=0;class k{constructor(h,l,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const c=l||y.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let p=0;p<h;++p)this.setCell(p,c);this.length=h}get(h){const l=this._data[3*h+0],o=2097151&l;return[this._data[3*h+1],2097152&l?this._combined[h]:o?(0,m.stringFromCodePoint)(o):"",l>>22,2097152&l?this._combined[h].charCodeAt(this._combined[h].length-1):o]}set(h,l){this._data[3*h+1]=l[f.CHAR_DATA_ATTR_INDEX],l[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=l[1],this._data[3*h+0]=2097152|h|l[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=l[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const l=this._data[3*h+0];return 2097152&l?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&l}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const l=this._data[3*h+0];return 2097152&l?this._combined[h]:2097151&l?(0,m.stringFromCodePoint)(2097151&l):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,l){return C=3*h,l.content=this._data[C+0],l.fg=this._data[C+1],l.bg=this._data[C+2],2097152&l.content&&(l.combinedData=this._combined[h]),268435456&l.bg&&(l.extended=this._extendedAttrs[h]),l}setCell(h,l){2097152&l.content&&(this._combined[h]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[h]=l.extended),this._data[3*h+0]=l.content,this._data[3*h+1]=l.fg,this._data[3*h+2]=l.bg}setCellFromCodePoint(h,l,o,c,p,g){268435456&p&&(this._extendedAttrs[h]=g),this._data[3*h+0]=l|o<<22,this._data[3*h+1]=c,this._data[3*h+2]=p}addCodepointToCell(h,l){let o=this._data[3*h+0];2097152&o?this._combined[h]+=(0,m.stringFromCodePoint)(l):(2097151&o?(this._combined[h]=(0,m.stringFromCodePoint)(2097151&o)+(0,m.stringFromCodePoint)(l),o&=-2097152,o|=2097152):o=l|4194304,this._data[3*h+0]=o)}insertCells(h,l,o,c){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length-h){const p=new y.CellData;for(let g=this.length-h-l-1;g>=0;--g)this.setCell(h+l+g,this.loadCell(h+g,p));for(let g=0;g<l;++g)this.setCell(h+g,o)}else for(let p=h;p<this.length;++p)this.setCell(p,o);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}deleteCells(h,l,o,c){if(h%=this.length,l<this.length-h){const p=new y.CellData;for(let g=0;g<this.length-h-l;++g)this.setCell(h+g,this.loadCell(h+l+g,p));for(let g=this.length-l;g<this.length;++g)this.setCell(g,o)}else for(let p=h;p<this.length;++p)this.setCell(p,o);h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodePoint(h,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}replaceCells(h,l,o,c,p=!1){if(p)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodePoint(h-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodePoint(l,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);h<l&&h<this.length;)this.isProtected(h)||this.setCell(h,o),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);h<l&&h<this.length;)this.setCell(h++,o)}resize(h,l){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const c=new Uint32Array(o);c.set(this._data),this._data=c}for(let c=this.length;c<h;++c)this.setCell(c,l)}else{this._data=this._data.subarray(0,o);const c=Object.keys(this._combined);for(let g=0;g<c.length;g++){const w=parseInt(c[g],10);w>=h&&delete this._combined[w]}const p=Object.keys(this._extendedAttrs);for(let g=0;g<p.length;g++){const w=parseInt(p[g],10);w>=h&&delete this._extendedAttrs[w]}}return this.length=h,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,l=!1){if(l)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,h);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const l in h._combined)this._combined[l]=h._combined[l];this._extendedAttrs={};for(const l in h._extendedAttrs)this._extendedAttrs[l]=h._extendedAttrs[l];this.isWrapped=h.isWrapped}clone(){const h=new k(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const l in this._combined)h._combined[l]=this._combined[l];for(const l in this._extendedAttrs)h._extendedAttrs[l]=this._extendedAttrs[l];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,l,o,c,p){const g=h._data;if(p)for(let x=c-1;x>=0;x--){for(let v=0;v<3;v++)this._data[3*(o+x)+v]=g[3*(l+x)+v];268435456&g[3*(l+x)+2]&&(this._extendedAttrs[o+x]=h._extendedAttrs[l+x])}else for(let x=0;x<c;x++){for(let v=0;v<3;v++)this._data[3*(o+x)+v]=g[3*(l+x)+v];268435456&g[3*(l+x)+2]&&(this._extendedAttrs[o+x]=h._extendedAttrs[l+x])}const w=Object.keys(h._combined);for(let x=0;x<w.length;x++){const v=parseInt(w[x],10);v>=l&&(this._combined[v-l+o]=h._combined[v])}}translateToString(h=!1,l=0,o=this.length){h&&(o=Math.min(o,this.getTrimmedLength()));let c="";for(;l<o;){const p=this._data[3*l+0],g=2097151&p;c+=2097152&p?this._combined[l]:g?(0,m.stringFromCodePoint)(g):f.WHITESPACE_CELL_CHAR,l+=p>>22||1}return c}}n.BufferLine=k},4841:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,n)=>{function u(d,y,f){if(y===d.length-1)return d[y].getTrimmedLength();const m=!d[y].hasContent(f-1)&&d[y].getWidth(f-1)===1,C=d[y+1].getWidth(0)===2;return m&&C?f-1:f}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(d,y,f,m,C){const k=[];for(let S=0;S<d.length-1;S++){let h=S,l=d.get(++h);if(!l.isWrapped)continue;const o=[d.get(S)];for(;h<d.length&&l.isWrapped;)o.push(l),l=d.get(++h);if(m>=S&&m<h){S+=o.length-1;continue}let c=0,p=u(o,c,y),g=1,w=0;for(;g<o.length;){const v=u(o,g,y),b=v-w,R=f-p,O=Math.min(b,R);o[c].copyCellsFrom(o[g],w,p,O,!1),p+=O,p===f&&(c++,p=0),w+=O,w===v&&(g++,w=0),p===0&&c!==0&&o[c-1].getWidth(f-1)===2&&(o[c].copyCellsFrom(o[c-1],f-1,p++,1,!1),o[c-1].setCell(f-1,C))}o[c].replaceCells(p,f,C);let x=0;for(let v=o.length-1;v>0&&(v>c||o[v].getTrimmedLength()===0);v--)x++;x>0&&(k.push(S+o.length-x),k.push(x)),S+=o.length-1}return k},n.reflowLargerCreateNewLayout=function(d,y){const f=[];let m=0,C=y[m],k=0;for(let S=0;S<d.length;S++)if(C===S){const h=y[++m];d.onDeleteEmitter.fire({index:S-k,amount:h}),S+=h-1,k+=h,C=y[++m]}else f.push(S);return{layout:f,countRemoved:k}},n.reflowLargerApplyNewLayout=function(d,y){const f=[];for(let m=0;m<y.length;m++)f.push(d.get(y[m]));for(let m=0;m<f.length;m++)d.set(m,f[m]);d.length=y.length},n.reflowSmallerGetNewLineLengths=function(d,y,f){const m=[],C=d.map((l,o)=>u(d,o,y)).reduce((l,o)=>l+o);let k=0,S=0,h=0;for(;h<C;){if(C-h<f){m.push(C-h);break}k+=f;const l=u(d,S,y);k>l&&(k-=l,S++);const o=d[S].getWidth(k-1)===2;o&&k--;const c=o?f-1:f;m.push(c),h+=c}return m},n.getWrappedLineTrimmedLength=u},5295:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=u(8460),y=u(844),f=u(9092);class m extends y.Disposable{constructor(k,S){super(),this._optionsService=k,this._bufferService=S,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,S){this._normal.resize(k,S),this._alt.resize(k,S),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}n.BufferSet=m},511:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(482),y=u(643),f=u(3734);class m extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const S=new m;return S.setFromCharData(k),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(k[y.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(k[y.CHAR_DATA_CHAR_INDEX].length===2){const h=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const l=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(h-55296)+l-56320+65536|k[y.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[y.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=k[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=m},643:(_,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:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=u(8460),y=u(844);class f{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}n.Marker=f,f._nextId=1},7116:(_,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:(_,n)=>{var u,d,y;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
58
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""}(u||(n.C0=u={})),function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"}(d||(n.C1=d={})),function(f){f.ST=`${u.ESC}\\`}(y||(n.C1_ESCAPED=y={}))},7399:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=u(2584),y={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(f,m,C,k){const S={type:0,cancel:!1,key:void 0},h=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(f.altKey){S.key=d.C0.ESC+d.C0.DEL;break}S.key=d.C0.DEL;break;case 9:if(f.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,f.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;h?(S.key=d.C0.ESC+"[1;"+(h+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(C?"b":"[1;5D"))):S.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;h?(S.key=d.C0.ESC+"[1;"+(h+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(C?"f":"[1;5C"))):S.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;h?(S.key=d.C0.ESC+"[1;"+(h+1)+"A",C||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;h?(S.key=d.C0.ESC+"[1;"+(h+1)+"B",C||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=h?d.C0.ESC+"[3;"+(h+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=h?d.C0.ESC+"[1;"+(h+1)+"H":m?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=h?d.C0.ESC+"[1;"+(h+1)+"F":m?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=d.C0.ESC+"[5;"+(h+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(h+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=h?d.C0.ESC+"[1;"+(h+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=h?d.C0.ESC+"[1;"+(h+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=h?d.C0.ESC+"[1;"+(h+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=h?d.C0.ESC+"[1;"+(h+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=h?d.C0.ESC+"[15;"+(h+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=h?d.C0.ESC+"[17;"+(h+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=h?d.C0.ESC+"[18;"+(h+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=h?d.C0.ESC+"[19;"+(h+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=h?d.C0.ESC+"[20;"+(h+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=h?d.C0.ESC+"[21;"+(h+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=h?d.C0.ESC+"[23;"+(h+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=h?d.C0.ESC+"[24;"+(h+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(C&&!k||!f.altKey||f.metaKey)!C||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=d.C0.US),f.key==="@"&&(S.key=d.C0.NUL)):f.keyCode===65&&(S.type=1);else{const l=y[f.keyCode],o=l==null?void 0:l[f.shiftKey?1:0];if(o)S.key=d.C0.ESC+o;else if(f.keyCode>=65&&f.keyCode<=90){const c=f.ctrlKey?f.keyCode-64:f.keyCode+32;let p=String.fromCharCode(c);f.shiftKey&&(p=p.toUpperCase()),S.key=d.C0.ESC+p}else if(f.keyCode===32)S.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let c=f.code.slice(3,4);f.shiftKey||(c=c.toLowerCase()),S.key=d.C0.ESC+c,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=d.C0.DEL:f.keyCode===219?S.key=d.C0.ESC:f.keyCode===220?S.key=d.C0.FS:f.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,y=u.length){let f="";for(let m=d;m<y;++m){let C=u[m];C>65535?(C-=65536,f+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):f+=String.fromCharCode(C)}return f},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const y=u.length;if(!y)return 0;let f=0,m=0;if(this._interim){const C=u.charCodeAt(m++);56320<=C&&C<=57343?d[f++]=1024*(this._interim-55296)+C-56320+65536:(d[f++]=this._interim,d[f++]=C),this._interim=0}for(let C=m;C<y;++C){const k=u.charCodeAt(C);if(55296<=k&&k<=56319){if(++C>=y)return this._interim=k,f;const S=u.charCodeAt(C);56320<=S&&S<=57343?d[f++]=1024*(k-55296)+S-56320+65536:(d[f++]=k,d[f++]=S)}else k!==65279&&(d[f++]=k)}return f}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const y=u.length;if(!y)return 0;let f,m,C,k,S=0,h=0,l=0;if(this.interim[0]){let p=!1,g=this.interim[0];g&=(224&g)==192?31:(240&g)==224?15:7;let w,x=0;for(;(w=63&this.interim[++x])&&x<4;)g<<=6,g|=w;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=v-x;for(;l<b;){if(l>=y)return 0;if(w=u[l++],(192&w)!=128){l--,p=!0;break}this.interim[x++]=w,g<<=6,g|=63&w}p||(v===2?g<128?l--:d[S++]=g:v===3?g<2048||g>=55296&&g<=57343||g===65279||(d[S++]=g):g<65536||g>1114111||(d[S++]=g)),this.interim.fill(0)}const o=y-4;let c=l;for(;c<y;){for(;!(!(c<o)||128&(f=u[c])||128&(m=u[c+1])||128&(C=u[c+2])||128&(k=u[c+3]));)d[S++]=f,d[S++]=m,d[S++]=C,d[S++]=k,c+=4;if(f=u[c++],f<128)d[S++]=f;else if((224&f)==192){if(c>=y)return this.interim[0]=f,S;if(m=u[c++],(192&m)!=128){c--;continue}if(h=(31&f)<<6|63&m,h<128){c--;continue}d[S++]=h}else if((240&f)==224){if(c>=y)return this.interim[0]=f,S;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,S;if(C=u[c++],(192&C)!=128){c--;continue}if(h=(15&f)<<12|(63&m)<<6|63&C,h<2048||h>=55296&&h<=57343||h===65279)continue;d[S++]=h}else if((248&f)==240){if(c>=y)return this.interim[0]=f,S;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,S;if(C=u[c++],(192&C)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=C,S;if(k=u[c++],(192&k)!=128){c--;continue}if(h=(7&f)<<18|(63&m)<<12|(63&C)<<6|63&k,h<65536||h>1114111)continue;d[S++]=h}}return S}}},225:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const u=[[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]],d=[[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 y;n.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let f=0;f<u.length;++f)y.fill(0,u[f][0],u[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?y[f]:function(m,C){let k,S=0,h=C.length-1;if(m<C[0][0]||m>C[h][1])return!1;for(;h>=S;)if(k=S+h>>1,m>C[k][1])S=k+1;else{if(!(m<C[k][0]))return!0;h=k-1}return!1}(f,d)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}}},5981:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=u(8460),y=u(844);class f extends y.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(k),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(k)}_innerWrite(C=0,k=!0){const S=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],l=this._action(h,k);if(l){const c=p=>Date.now()-S>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(S,p);return void l.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(c)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-S>=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=f},5941:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function y(f,m){const C=f.toString(16),k=C.length<2?"0"+C:C;switch(m){case 4:return C[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}n.parseColor=function(f){if(!f)return;let m=f.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const C=u.exec(m);if(C){const k=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/k*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/k*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/k*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),d.exec(m)&&[3,6,9,12].includes(m.length))){const C=m.length/3,k=[0,0,0];for(let S=0;S<3;++S){const h=parseInt(m.slice(C*S,C*S+C),16);k[S]=C===1?h<<4:C===2?h:C===3?h>>4:h>>8}return k}},n.toRgbString=function(f,m=16){const[C,k,S]=f;return`rgb:${y(C,m)}/${y(k,m)}/${y(S,m)}`}},5770:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=u(482),y=u(8742),f=u(5770),m=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(k,S){this._handlers[k]===void 0&&(this._handlers[k]=[]);const h=this._handlers[k];return h.push(S),{dispose:()=>{const l=h.indexOf(S);l!==-1&&h.splice(l,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(k,S){if(this.reset(),this._ident=k,this._active=this._handlers[k]||m,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,h){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(k,S,h);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,S,h))}unhook(k,S=!0){if(this._active.length){let h=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,h=S,o=this._stack.fallThrough,this._stack.paused=!1),!o&&h===!1){for(;l>=0&&(h=this._active[l].unhook(k),h!==!0);l--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,h;l--}for(;l>=0;l--)if(h=this._active[l].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",k);this._active=m,this._ident=0}};const C=new y.Params;C.addParam(0),n.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=C,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():C,this._data="",this._hitLimit=!1}put(k,S,h){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,S,h),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let S=!1;if(this._hitLimit)S=!1;else if(k&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then(h=>(this._params=C,this._data="",this._hitLimit=!1,h));return this._params=C,this._data="",this._hitLimit=!1,S}}},2015:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=u(844),y=u(8742),f=u(6242),m=u(6351);class C{constructor(l){this.table=new Uint8Array(l)}setDefault(l,o){this.table.fill(l<<4|o)}add(l,o,c,p){this.table[o<<8|l]=c<<4|p}addMany(l,o,c,p){for(let g=0;g<l.length;g++)this.table[o<<8|l[g]]=c<<4|p}}n.TransitionTable=C;const k=160;n.VT500_TRANSITION_TABLE=function(){const h=new C(4095),l=Array.apply(null,Array(256)).map((x,v)=>v),o=(x,v)=>l.slice(x,v),c=o(32,127),p=o(0,24);p.push(25),p.push.apply(p,o(28,32));const g=o(0,14);let w;for(w in h.setDefault(1,0),h.addMany(c,0,2,0),g)h.addMany([24,26,153,154],w,3,0),h.addMany(o(128,144),w,3,0),h.addMany(o(144,152),w,3,0),h.add(156,w,0,0),h.add(27,w,11,1),h.add(157,w,4,8),h.addMany([152,158,159],w,0,7),h.add(155,w,11,3),h.add(144,w,11,9);return h.addMany(p,0,3,0),h.addMany(p,1,3,1),h.add(127,1,0,1),h.addMany(p,8,0,8),h.addMany(p,3,3,3),h.add(127,3,0,3),h.addMany(p,4,3,4),h.add(127,4,0,4),h.addMany(p,6,3,6),h.addMany(p,5,3,5),h.add(127,5,0,5),h.addMany(p,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(c,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(o(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(c,7,0,7),h.addMany(p,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(o(64,127),3,7,0),h.addMany(o(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(o(48,60),4,8,4),h.addMany(o(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(o(32,64),6,0,6),h.add(127,6,0,6),h.addMany(o(64,127),6,0,0),h.addMany(o(32,48),3,9,5),h.addMany(o(32,48),5,9,5),h.addMany(o(48,64),5,0,6),h.addMany(o(64,127),5,7,0),h.addMany(o(32,48),4,9,5),h.addMany(o(32,48),1,9,2),h.addMany(o(32,48),2,9,2),h.addMany(o(48,127),2,10,0),h.addMany(o(48,80),1,10,0),h.addMany(o(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(o(96,127),1,10,0),h.add(80,1,11,9),h.addMany(p,9,0,9),h.add(127,9,0,9),h.addMany(o(28,32),9,0,9),h.addMany(o(32,48),9,9,12),h.addMany(o(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(p,11,0,11),h.addMany(o(32,128),11,0,11),h.addMany(o(28,32),11,0,11),h.addMany(p,10,0,10),h.add(127,10,0,10),h.addMany(o(28,32),10,0,10),h.addMany(o(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(o(32,48),10,9,12),h.addMany(p,12,0,12),h.add(127,12,0,12),h.addMany(o(28,32),12,0,12),h.addMany(o(32,48),12,9,12),h.addMany(o(48,64),12,0,11),h.addMany(o(64,127),12,12,13),h.addMany(o(64,127),10,12,13),h.addMany(o(64,127),9,12,13),h.addMany(p,13,13,13),h.addMany(c,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(k,0,2,0),h.add(k,8,5,8),h.add(k,6,0,6),h.add(k,11,0,11),h.add(k,13,13,13),h}();class S extends d.Disposable{constructor(l=n.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(o,c,p)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,c)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,o=[64,126]){let c=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=l.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let g=0;g<l.intermediates.length;++g){const w=l.intermediates.charCodeAt(g);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=w}}if(l.final.length!==1)throw new Error("final must be a single byte");const p=l.final.charCodeAt(0);if(o[0]>p||p>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return c<<=8,c|=p,c}identToString(l){const o=[];for(;l;)o.push(String.fromCharCode(255&l)),l>>=8;return o.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,o){const c=this._identifier(l,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(o),{dispose:()=>{const g=p.indexOf(o);g!==-1&&p.splice(g,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,o){this._executeHandlers[l.charCodeAt(0)]=o}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,o){const c=this._identifier(l);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(o),{dispose:()=>{const g=p.indexOf(o);g!==-1&&p.splice(g,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,o){return this._dcsParser.registerHandler(this._identifier(l),o)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,o){return this._oscParser.registerHandler(l,o)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(l,o,c,p,g){this._parseStack.state=l,this._parseStack.handlers=o,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=g}parse(l,o,c){let p,g=0,w=0,x=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,x=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&b>-1){for(;b>=0&&(p=v[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&b>-1){for(;b>=0&&(p=v[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(g=l[this._parseStack.chunkPos],p=this._dcsParser.unhook(g!==24&&g!==26,c),p)return p;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(g=l[this._parseStack.chunkPos],p=this._oscParser.end(g!==24&&g!==26,c),p)return p;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,x=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let v=x;v<o;++v){switch(g=l[v],w=this._transitions.table[this.currentState<<8|(g<160?g:k)],w>>4){case 2:for(let M=v+1;;++M){if(M>=o||(g=l[M])<32||g>126&&g<k){this._printHandler(l,v,M),v=M-1;break}if(++M>=o||(g=l[M])<32||g>126&&g<k){this._printHandler(l,v,M),v=M-1;break}if(++M>=o||(g=l[M])<32||g>126&&g<k){this._printHandler(l,v,M),v=M-1;break}if(++M>=o||(g=l[M])<32||g>126&&g<k){this._printHandler(l,v,M),v=M-1;break}}break;case 3:this._executeHandlers[g]?this._executeHandlers[g]():this._executeHandlerFb(g),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:g,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|g];let R=b?b.length-1:-1;for(;R>=0&&(p=b[R](this._params),p!==!0);R--)if(p instanceof Promise)return this._preserveStack(3,b,R,w,v),p;R<0&&this._csiHandlerFb(this._collect<<8|g,this._params),this.precedingCodepoint=0;break;case 8:do switch(g){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(g-48)}while(++v<o&&(g=l[v])>47&&g<60);v--;break;case 9:this._collect<<=8,this._collect|=g;break;case 10:const O=this._escHandlers[this._collect<<8|g];let A=O?O.length-1:-1;for(;A>=0&&(p=O[A](),p!==!0);A--)if(p instanceof Promise)return this._preserveStack(4,O,A,w,v),p;A<0&&this._escHandlerFb(this._collect<<8|g),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|g,this._params);break;case 13:for(let M=v+1;;++M)if(M>=o||(g=l[M])===24||g===26||g===27||g>127&&g<k){this._dcsParser.put(l,v,M),v=M-1;break}break;case 14:if(p=this._dcsParser.unhook(g!==24&&g!==26),p)return this._preserveStack(6,[],0,w,v),p;g===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let M=v+1;;M++)if(M>=o||(g=l[M])<32||g>127&&g<k){this._oscParser.put(l,v,M),v=M-1;break}break;case 6:if(p=this._oscParser.end(g!==24&&g!==26),p)return this._preserveStack(5,[],0,w,v),p;g===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&w}}}n.EscapeSequenceParser=S},6242:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=u(5770),y=u(482),f=[];n.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,C){this._handlers[m]===void 0&&(this._handlers[m]=[]);const k=this._handlers[m];return k.push(C),{dispose:()=>{const S=k.indexOf(C);S!==-1&&k.splice(S,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,C,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(m,C,k);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(m,C,k))}start(){this.reset(),this._state=1}put(m,C,k){if(this._state!==3){if(this._state===1)for(;C<k;){const S=m[C++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&k-C>0&&this._put(m,C,k)}}end(m,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,S=this._active.length-1,h=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=C,h=this._stack.fallThrough,this._stack.paused=!1),!h&&k===!1){for(;S>=0&&(k=this._active[S].end(m),k!==!0);S--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,k;S--}for(;S>=0;S--)if(k=this._active[S].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",m);this._active=f,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,C,k){this._hitLimit||(this._data+=(0,y.utf32ToString)(m,C,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let C=!1;if(this._hitLimit)C=!1;else if(m&&(C=this._handler(this._data),C instanceof Promise))return C.then(k=>(this._data="",this._hitLimit=!1,k));return this._data="",this._hitLimit=!1,C}}},8742:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class d{static fromArray(f){const m=new d;if(!f.length)return m;for(let C=Array.isArray(f[0])?1:0;C<f.length;++C){const k=f[C];if(Array.isArray(k))for(let S=0;S<k.length;++S)m.addSubParam(k[S]);else m.addParam(k)}return m}constructor(f=32,m=32){if(this.maxLength=f,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let m=0;m<this.length;++m){f.push(this.params[m]);const C=this._subParamsIdx[m]>>8,k=255&this._subParamsIdx[m];k-C>0&&f.push(Array.prototype.slice.call(this._subParams,C,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const m=this._subParamsIdx[f]>>8,C=255&this._subParamsIdx[f];return C-m>0?this._subParams.subarray(m,C):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const C=this._subParamsIdx[m]>>8,k=255&this._subParamsIdx[m];k-C>0&&(f[m]=this._subParams.slice(C,k))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,k=C[m-1];C[m-1]=~k?Math.min(10*k+f,u):f}}n.Params=d},5741:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=u(3785),y=u(511);n.BufferApiView=class{constructor(f,m){this._buffer=f,this.type=m}init(f){return this._buffer=f,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(f){const m=this._buffer.lines.get(f);if(m)return new d.BufferLineApiView(m)}getNullCell(){return new y.CellData}}},3785:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=u(511);n.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,f){if(!(y<0||y>=this._line.length))return f?(this._line.loadCell(y,f),f):this._line.loadCell(y,new d.CellData)}translateToString(y,f,m){return this._line.translateToString(y,f,m)}}},8285:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=u(8771),y=u(8460),f=u(844);class m extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}n.BufferNamespaceApi=m},7975:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,y=>d(y.toArray()))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,(y,f)=>d(y,f.toArray()))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(_,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(_,n,u){var d=this&&this.__decorate||function(h,l,o,c){var p,g=arguments.length,w=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,c);else for(var x=h.length-1;x>=0;x--)(p=h[x])&&(w=(g<3?p(w):g>3?p(l,o,w):p(l,o))||w);return g>3&&w&&Object.defineProperty(l,o,w),w},y=this&&this.__param||function(h,l){return function(o,c){l(o,c,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const f=u(8460),m=u(844),C=u(5295),k=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let S=n.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(h,this))}resize(h,l){this.cols=h,this.rows=l,this.buffers.resize(h,l),this._onResize.fire({cols:h,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,l=!1){const o=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===h.fg&&c.getBg(0)===h.bg||(c=o.getBlankLine(h,l),this._cachedBlankLine=c),c.isWrapped=l;const p=o.ybase+o.scrollTop,g=o.ybase+o.scrollBottom;if(o.scrollTop===0){const w=o.lines.isFull;g===o.lines.length-1?w?o.lines.recycle().copyFrom(c):o.lines.push(c.clone()):o.lines.splice(g+1,0,c.clone()),w?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const w=g-p+1;o.lines.shiftElements(p+1,w-1,-1),o.lines.set(g,c.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(h,l,o){const c=this.buffer;if(h<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else h+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+h,c.ybase),0),p!==c.ydisp&&(l||this._onScroll.fire(c.ydisp))}};n.BufferService=S=d([y(0,k.IOptionsService)],S)},7994:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(_,n,u){var d=this&&this.__decorate||function(c,p,g,w){var x,v=arguments.length,b=v<3?p:w===null?w=Object.getOwnPropertyDescriptor(p,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,g,w);else for(var R=c.length-1;R>=0;R--)(x=c[R])&&(b=(v<3?x(b):v>3?x(p,g,b):x(p,g))||b);return v>3&&b&&Object.defineProperty(p,g,b),b},y=this&&this.__param||function(c,p){return function(g,w){p(g,w,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const f=u(2585),m=u(8460),C=u(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function S(c,p){let g=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(g|=64,g|=c.action):(g|=3&c.button,4&c.button&&(g|=64),8&c.button&&(g|=128),c.action===32?g|=32:c.action!==0||p||(g|=3)),g}const h=String.fromCharCode,l={DEFAULT:c=>{const p=[S(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${h(p[0])}${h(p[1])}${h(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${S(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${S(c,!0)};${c.x};${c.y}${p}`}};let o=n.CoreMouseService=class extends C.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const g of Object.keys(k))this.addProtocol(g,k[g]);for(const g of Object.keys(l))this.addEncoding(g,l[g]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,g){if(g){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};n.CoreMouseService=o=d([y(0,f.IBufferService),y(1,f.ICoreService)],o)},6975:function(_,n,u){var d=this&&this.__decorate||function(o,c,p,g){var w,x=arguments.length,v=x<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(o,c,p,g);else for(var b=o.length-1;b>=0;b--)(w=o[b])&&(v=(x<3?w(v):x>3?w(c,p,v):w(c,p))||v);return x>3&&v&&Object.defineProperty(c,p,v),v},y=this&&this.__param||function(o,c){return function(p,g){c(p,g,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const f=u(1439),m=u(8460),C=u(844),k=u(2585),S=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=n.CoreService=class extends C.Disposable{constructor(o,c,p){super(),this._bufferService=o,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(h)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(h)}triggerDataEvent(o,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,()=>o.split("").map(g=>g.charCodeAt(0))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,()=>o.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(o))}};n.CoreService=l=d([y(0,k.IBufferService),y(1,k.ILogService),y(2,k.IOptionsService)],l)},9074:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=u(8055),y=u(8460),f=u(844),m=u(6106);let C=0,k=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(o=>o==null?void 0:o.marker.line),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)(()=>this.reset()))}registerDecoration(o){if(o.marker.isDisposed)return;const c=new h(o);if(c){const p=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,c,p){var g,w,x;let v=0,b=0;for(const R of this._decorations.getKeyIterator(c))v=(g=R.options.x)!==null&&g!==void 0?g:0,b=v+((w=R.options.width)!==null&&w!==void 0?w:1),o>=v&&o<b&&(!p||((x=R.options.layer)!==null&&x!==void 0?x:"bottom")===p)&&(yield R)}forEachDecorationAtCell(o,c,p,g){this._decorations.forEachByKey(c,w=>{var x,v,b;C=(x=w.options.x)!==null&&x!==void 0?x:0,k=C+((v=w.options.width)!==null&&v!==void 0?v:1),o>=C&&o<k&&(!p||((b=w.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&g(w)})}}n.DecorationService=S;class h extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=u(2585),y=u(8343);class f{constructor(...C){this._entries=new Map;for(const[k,S]of C)this.set(k,S)}set(C,k){const S=this._entries.get(C);return this._entries.set(C,k),S}forEach(C){for(const[k,S]of this._entries.entries())C(k,S)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}n.ServiceCollection=f,n.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(m,C){this._services.set(m,C)}getService(m){return this._services.get(m)}createInstance(m,...C){const k=(0,y.getServiceDependencies)(m).sort((l,o)=>l.index-o.index),S=[];for(const l of k){const o=this._services.get(l.id);if(!o)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${l.id}.`);S.push(o)}const h=k.length>0?k[0].index:C.length;if(C.length!==h)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${h+1} conflicts with ${C.length} static arguments`);return new m(...C,...S)}}},7866:function(_,n,u){var d=this&&this.__decorate||function(h,l,o,c){var p,g=arguments.length,w=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,c);else for(var x=h.length-1;x>=0;x--)(p=h[x])&&(w=(g<3?p(w):g>3?p(l,o,w):p(l,o))||w);return g>3&&w&&Object.defineProperty(l,o,w),w},y=this&&this.__param||function(h,l){return function(o,c){l(o,c,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const f=u(844),m=u(2585),C={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let k,S=n.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),k=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let l=0;l<h.length;l++)typeof h[l]=="function"&&(h[l]=h[l]())}_log(h,l,o){this._evalLazyOptionalParams(o),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(h,...l){var o,c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,h,l)}debug(h,...l){var o,c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,h,l)}info(h,...l){var o,c;this._logLevel<=m.LogLevelEnum.INFO&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,h,l)}warn(h,...l){var o,c;this._logLevel<=m.LogLevelEnum.WARN&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,h,l)}error(h,...l){var o,c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,h,l)}};n.LogService=S=d([y(0,m.IOptionsService)],S),n.setTraceLogger=function(h){k=h},n.traceCall=function(h,l,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...p){if(k.logLevel!==m.LogLevelEnum.TRACE)return c.apply(this,p);k.trace(`GlyphRenderer#${c.name}(${p.map(w=>JSON.stringify(w)).join(", ")})`);const g=c.apply(this,p);return k.trace(`GlyphRenderer#${c.name} return`,g),g}}},7302:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=u(8460),y=u(844),f=u(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends y.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h=Object.assign({},n.DEFAULT_OPTIONS);for(const l in S)if(l in h)try{const o=S[l];h[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=h,this.options=Object.assign({},h),this._setupOptions()}onSpecificOptionChange(S,h){return this.onOptionChange(l=>{l===S&&h(this.rawOptions[S])})}onMultipleOptionChange(S,h){return this.onOptionChange(l=>{S.indexOf(l)!==-1&&h()})}_setupOptions(){const S=l=>{if(!(l in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},h=(l,o)=>{if(!(l in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);o=this._sanitizeAndValidateOption(l,o),this.rawOptions[l]!==o&&(this.rawOptions[l]=o,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const o={get:S.bind(this,l),set:h.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(S,h){switch(S){case"cursorStyle":if(h||(h=n.DEFAULT_OPTIONS[S]),!function(l){return l==="block"||l==="underline"||l==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${S}`);break;case"wordSeparator":h||(h=n.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=m.includes(h)?h:n.DEFAULT_OPTIONS[S];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${S} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${S} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}n.OptionsService=C},2660:function(_,n,u){var d=this&&this.__decorate||function(C,k,S,h){var l,o=arguments.length,c=o<3?k:h===null?h=Object.getOwnPropertyDescriptor(k,S):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,k,S,h);else for(var p=C.length-1;p>=0;p--)(l=C[p])&&(c=(o<3?l(c):o>3?l(k,S,c):l(k,S))||c);return o>3&&c&&Object.defineProperty(k,S,c),c},y=this&&this.__param||function(C,k){return function(S,h){k(S,h,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const f=u(2585);let m=n.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const k=this._bufferService.buffer;if(C.id===void 0){const p=k.addMarker(k.ybase+k.y),g={data:C,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(g,p)),this._dataByLinkId.set(g.id,g),g.id}const S=C,h=this._getEntryIdKey(S),l=this._entriesWithId.get(h);if(l)return this.addLineToLink(l.id,k.ybase+k.y),l.id;const o=k.addMarker(k.ybase+k.y),c={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(c,o)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,k){const S=this._dataByLinkId.get(C);if(S&&S.lines.every(h=>h.line!==k)){const h=this._bufferService.buffer.addMarker(k);S.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(S,h))}}getLinkData(C){var k;return(k=this._dataByLinkId.get(C))===null||k===void 0?void 0:k.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,k){const S=C.lines.indexOf(k);S!==-1&&(C.lines.splice(S,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};n.OscLinkService=m=d([y(0,f.IBufferService)],m)},8343:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(y){return y[d]||[]},n.createDecorator=function(y){if(n.serviceRegistry.has(y))return n.serviceRegistry.get(y);const f=function(m,C,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,h,l){h[u]===h?h[d].push({id:S,index:l}):(h[d]=[{id:S,index:l}],h[u]=h)})(f,m,k)};return f.toString=()=>y,n.serviceRegistry.set(y,f),f}},2585:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(8343);var y;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"}(y||(n.LogLevelEnum=y={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(_,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=u(8460),y=u(225);n.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const f=new y.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let m=0;const C=f.length;for(let k=0;k<C;++k){let S=f.charCodeAt(k);if(55296<=S&&S<=56319){if(++k>=C)return m+this.wcwidth(S);const h=f.charCodeAt(k);56320<=h&&h<=57343?S=1024*(S-55296)+h-56320+65536:m+=this.wcwidth(h)}m+=this.wcwidth(S)}return m}}}},i={};function s(_){var n=i[_];if(n!==void 0)return n.exports;var u=i[_]={exports:{}};return r[_].call(u.exports,u,u.exports,s),u.exports}var a={};return(()=>{var _=a;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const n=s(9042),u=s(3236),d=s(844),y=s(5741),f=s(8285),m=s(7975),C=s(7090),k=["cols","rows"];class S extends d.Disposable{constructor(l){super(),this._core=this.register(new u.Terminal(l)),this._addonManager=this.register(new y.AddonManager),this._publicOptions=Object.assign({},this._core.options);const o=p=>this._core.options[p],c=(p,g)=>{this._checkReadonlyOptions(p),this._core.options[p]=g};for(const p in this._core.options){const g={get:o.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,g)}}_checkReadonlyOptions(l){if(k.includes(l))throw new Error(`Option "${l}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const o in l)this._publicOptions[o]=l[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(l,o){this._verifyIntegers(l,o),this._core.resize(l,o)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){var o,c,p;return this._checkProposedApi(),this._verifyPositiveIntegers((o=l.x)!==null&&o!==void 0?o:0,(c=l.width)!==null&&c!==void 0?c:0,(p=l.height)!==null&&p!==void 0?p:0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,o,c){this._verifyIntegers(l,o,c),this._core.select(l,o,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,o){this._verifyIntegers(l,o),this._core.selectLines(l,o)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,o){this._core.write(l,o)}writeln(l,o){this._core.write(l),this._core.write(`\r
59
+ `,o)}paste(l){this._core.paste(l)}refresh(l,o){this._verifyIntegers(l,o),this._core.refresh(l,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return n}_verifyIntegers(...l){for(const o of l)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const o of l)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}_.Terminal=S})(),a})())})(Bd);var xp=Bd.exports,me;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const a={};for(const _ of s)a[_]=_;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),_={};for(const n of a)_[n]=s[n];return e.objectValues(_)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const _ in s)Object.prototype.hasOwnProperty.call(s,_)&&a.push(_);return a},e.find=(s,a)=>{for(const _ of s)if(a(_))return _},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function i(s,a=" | "){return s.map(_=>typeof _=="string"?`'${_}'`:_).join(a)}e.joinValues=i,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(me||(me={}));var au;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(au||(au={}));const ie=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_r=e=>{switch(typeof e){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(e)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(e)?ie.array:e===null?ie.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ie.promise:typeof Map<"u"&&e instanceof Map?ie.map:typeof Set<"u"&&e instanceof Set?ie.set:typeof Date<"u"&&e instanceof Date?ie.date:ie.object;default:return ie.unknown}},X=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ar extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},i={_errors:[]},s=a=>{for(const _ of a.issues)if(_.code==="invalid_union")_.unionErrors.map(s);else if(_.code==="invalid_return_type")s(_.returnTypeError);else if(_.code==="invalid_arguments")s(_.argumentsError);else if(_.path.length===0)i._errors.push(r(_));else{let n=i,u=0;for(;u<_.path.length;){const d=_.path[u];u===_.path.length-1?(n[d]=n[d]||{_errors:[]},n[d]._errors.push(r(_))):n[d]=n[d]||{_errors:[]},n=n[d],u++}}};return s(this),i}static assert(t){if(!(t instanceof ar))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},i=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(t(s))}else i.push(t(s));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}}ar.create=e=>new ar(e);const Ia=(e,t)=>{let r;switch(e.code){case X.invalid_type:e.received===ie.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,me.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(e.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(e.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:me.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case X.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case X.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:r="Number must be finite";break;default:r=t.defaultError,me.assertNever(e)}return{message:r}};let Lp=Ia;function Rp(){return Lp}const Tp=e=>{const{data:t,path:r,errorMaps:i,issueData:s}=e,a=[...r,...s.path||[]],_={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let n="";const u=i.filter(d=>!!d).slice().reverse();for(const d of u)n=d(_,{data:t,defaultError:n}).message;return{...s,path:a,message:n}};function J(e,t){const r=Rp(),i=Tp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ia?void 0:Ia].filter(s=>!!s)});e.common.issues.push(i)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const i=[];for(const s of r){if(s.status==="aborted")return oe;s.status==="dirty"&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){const i=[];for(const s of r){const a=await s.key,_=await s.value;i.push({key:a,value:_})}return yt.mergeObjectSync(t,i)}static mergeObjectSync(t,r){const i={};for(const s of r){const{key:a,value:_}=s;if(a.status==="aborted"||_.status==="aborted")return oe;a.status==="dirty"&&t.dirty(),_.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof _.value<"u"||s.alwaysSet)&&(i[a.value]=_.value)}return{status:t.value,value:i}}}const oe=Object.freeze({status:"aborted"}),rs=e=>({status:"dirty",value:e}),Tt=e=>({status:"valid",value:e}),lu=e=>e.status==="aborted",cu=e=>e.status==="dirty",Hi=e=>e.status==="valid",jn=e=>typeof Promise<"u"&&e instanceof Promise;var se;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(se||(se={}));class Ar{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uu=(e,t)=>{if(Hi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ar(e.common.issues);return this._error=r,this._error}}};function he(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(_,n)=>{const{message:u}=e;return _.code==="invalid_enum_value"?{message:u??n.defaultError}:typeof n.data>"u"?{message:u??i??n.defaultError}:_.code!=="invalid_type"?{message:n.defaultError}:{message:u??r??n.defaultError}},description:s}}class ve{get description(){return this._def.description}_getType(t){return _r(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:_r(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new yt,ctx:{common:t.parent.common,data:t.data,parsedType:_r(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(jn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){const i={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_r(t)},s=this._parseSync({data:t,path:i.path,parent:i});return uu(i,s)}"~validate"(t){var i,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_r(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return Hi(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(s=(i=a==null?void 0:a.message)==null?void 0:i.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>Hi(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){const i={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_r(t)},s=this._parse({data:t,path:i.path,parent:i}),a=await(jn(s)?s:Promise.resolve(s));return uu(i,a)}refine(t,r){const i=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const _=t(s),n=()=>a.addIssue({code:X.custom,...i(s)});return typeof Promise<"u"&&_ instanceof Promise?_.then(u=>u?!0:(n(),!1)):_?!0:(n(),!1)})}refinement(t,r){return this._refinement((i,s)=>t(i)?!0:(s.addIssue(typeof r=="function"?r(i,s):r),!1))}_refinement(t){return new ii({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return rr.create(this,this._def)}nullable(){return si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return Vn.create(this,this._def)}or(t){return Un.create([this,t],this._def)}and(t){return Wn.create(this,t,this._def)}transform(t){return new ii({...he(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Kn({...he(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new jd({typeName:ae.ZodBranded,type:this,...he(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Zn({...he(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Hl.create(this,t)}readonly(){return qn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Dp=/^c[^\s-]{8,}$/i,Ap=/^[0-9a-z]+$/,Mp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Op=/^[a-z0-9_-]{21}$/i,Bp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ip=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Np=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uo;const Fp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Up=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$p=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Vp=new RegExp(`^${Nd}$`);function Hd(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Kp(e){return new RegExp(`^${Hd(e)}$`)}function Zp(e){let t=`${Nd}T${Hd(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function qp(e,t){return!!((t==="v4"||!t)&&Fp.test(e)||(t==="v6"||!t)&&zp.test(e))}function Xp(e,t){if(!Bp.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(i));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Gp(e,t){return!!((t==="v4"||!t)&&jp.test(e)||(t==="v6"||!t)&&Up.test(e))}class yr extends ve{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ie.string){const a=this._getOrReturnCtx(t);return J(a,{code:X.invalid_type,expected:ie.string,received:a.parsedType}),oe}const i=new yt;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),J(s,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),J(s,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="length"){const _=t.data.length>a.value,n=t.data.length<a.value;(_||n)&&(s=this._getOrReturnCtx(t,s),_?J(s,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):n&&J(s,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")Np.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"email",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")Uo||(Uo=new RegExp(Hp,"u")),Uo.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"emoji",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")Pp.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"uuid",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="nanoid")Op.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"nanoid",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")Dp.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"cuid",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")Ap.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"cuid2",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")Mp.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"ulid",code:X.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),J(s,{validation:"url",code:X.invalid_string,message:a.message}),i.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"regex",code:X.invalid_string,message:a.message}),i.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?Zp(a).test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="date"?Vp.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:"date",message:a.message}),i.dirty()):a.kind==="time"?Kp(a).test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{code:X.invalid_string,validation:"time",message:a.message}),i.dirty()):a.kind==="duration"?Ip.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"duration",code:X.invalid_string,message:a.message}),i.dirty()):a.kind==="ip"?qp(t.data,a.version)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"ip",code:X.invalid_string,message:a.message}),i.dirty()):a.kind==="jwt"?Xp(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"jwt",code:X.invalid_string,message:a.message}),i.dirty()):a.kind==="cidr"?Gp(t.data,a.version)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"cidr",code:X.invalid_string,message:a.message}),i.dirty()):a.kind==="base64"?Wp.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"base64",code:X.invalid_string,message:a.message}),i.dirty()):a.kind==="base64url"?$p.test(t.data)||(s=this._getOrReturnCtx(t,s),J(s,{validation:"base64url",code:X.invalid_string,message:a.message}),i.dirty()):me.assertNever(a);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(s=>t.test(s),{validation:r,code:X.invalid_string,...se.errToObj(i)})}_addCheck(t){return new yr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...se.errToObj(t)})}url(t){return this._addCheck({kind:"url",...se.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...se.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...se.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...se.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...se.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...se.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...se.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...se.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...se.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...se.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...se.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...se.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...se.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...se.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...se.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...se.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...se.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...se.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...se.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...se.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...se.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...se.errToObj(r)})}nonempty(t){return this.min(1,se.errToObj(t))}trim(){return new yr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new yr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new yr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}yr.create=e=>new yr({checks:[],typeName:ae.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...he(e)});function Yp(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i,a=Number.parseInt(e.toFixed(s).replace(".","")),_=Number.parseInt(t.toFixed(s).replace(".",""));return a%_/10**s}class Fi extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ie.number){const a=this._getOrReturnCtx(t);return J(a,{code:X.invalid_type,expected:ie.number,received:a.parsedType}),oe}let i;const s=new yt;for(const a of this._def.checks)a.kind==="int"?me.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{code:X.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Yp(t.data,a.value)!==0&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{code:X.not_finite,message:a.message}),s.dirty()):me.assertNever(a);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,se.toString(r))}gt(t,r){return this.setLimit("min",t,!1,se.toString(r))}lte(t,r){return this.setLimit("max",t,!0,se.toString(r))}lt(t,r){return this.setLimit("max",t,!1,se.toString(r))}setLimit(t,r,i,s){return new Fi({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:se.toString(s)}]})}_addCheck(t){return new Fi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:se.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:se.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&me.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Fi.create=e=>new Fi({checks:[],typeName:ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...he(e)});class Ts extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ie.bigint)return this._getInvalidInput(t);let i;const s=new yt;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),J(i,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):me.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return J(r,{code:X.invalid_type,expected:ie.bigint,received:r.parsedType}),oe}gte(t,r){return this.setLimit("min",t,!0,se.toString(r))}gt(t,r){return this.setLimit("min",t,!1,se.toString(r))}lte(t,r){return this.setLimit("max",t,!0,se.toString(r))}lt(t,r){return this.setLimit("max",t,!1,se.toString(r))}setLimit(t,r,i,s){return new Ts({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:se.toString(s)}]})}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ts.create=e=>new Ts({checks:[],typeName:ae.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...he(e)});class Na extends ve{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ie.boolean){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.boolean,received:i.parsedType}),oe}return Tt(t.data)}}Na.create=e=>new Na({typeName:ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...he(e)});class zn extends ve{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ie.date){const a=this._getOrReturnCtx(t);return J(a,{code:X.invalid_type,expected:ie.date,received:a.parsedType}),oe}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return J(a,{code:X.invalid_date}),oe}const i=new yt;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),J(s,{code:X.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),J(s,{code:X.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):me.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zn({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:se.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:se.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}zn.create=e=>new zn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ae.ZodDate,...he(e)});class hu extends ve{_parse(t){if(this._getType(t)!==ie.symbol){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.symbol,received:i.parsedType}),oe}return Tt(t.data)}}hu.create=e=>new hu({typeName:ae.ZodSymbol,...he(e)});class Ha extends ve{_parse(t){if(this._getType(t)!==ie.undefined){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.undefined,received:i.parsedType}),oe}return Tt(t.data)}}Ha.create=e=>new Ha({typeName:ae.ZodUndefined,...he(e)});class Fa extends ve{_parse(t){if(this._getType(t)!==ie.null){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.null,received:i.parsedType}),oe}return Tt(t.data)}}Fa.create=e=>new Fa({typeName:ae.ZodNull,...he(e)});class du extends ve{constructor(){super(...arguments),this._any=!0}_parse(t){return Tt(t.data)}}du.create=e=>new du({typeName:ae.ZodAny,...he(e)});class fu extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tt(t.data)}}fu.create=e=>new fu({typeName:ae.ZodUnknown,...he(e)});class Mr extends ve{_parse(t){const r=this._getOrReturnCtx(t);return J(r,{code:X.invalid_type,expected:ie.never,received:r.parsedType}),oe}}Mr.create=e=>new Mr({typeName:ae.ZodNever,...he(e)});class _u extends ve{_parse(t){if(this._getType(t)!==ie.undefined){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.void,received:i.parsedType}),oe}return Tt(t.data)}}_u.create=e=>new _u({typeName:ae.ZodVoid,...he(e)});class Kt extends ve{_parse(t){const{ctx:r,status:i}=this._processInputParams(t),s=this._def;if(r.parsedType!==ie.array)return J(r,{code:X.invalid_type,expected:ie.array,received:r.parsedType}),oe;if(s.exactLength!==null){const _=r.data.length>s.exactLength.value,n=r.data.length<s.exactLength.value;(_||n)&&(J(r,{code:_?X.too_big:X.too_small,minimum:n?s.exactLength.value:void 0,maximum:_?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(J(r,{code:X.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(J(r,{code:X.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((_,n)=>s.type._parseAsync(new Ar(r,_,r.path,n)))).then(_=>yt.mergeArray(i,_));const a=[...r.data].map((_,n)=>s.type._parseSync(new Ar(r,_,r.path,n)));return yt.mergeArray(i,a)}get element(){return this._def.type}min(t,r){return new Kt({...this._def,minLength:{value:t,message:se.toString(r)}})}max(t,r){return new Kt({...this._def,maxLength:{value:t,message:se.toString(r)}})}length(t,r){return new Kt({...this._def,exactLength:{value:t,message:se.toString(r)}})}nonempty(t){return this.min(1,t)}}Kt.create=(e,t)=>new Kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...he(t)});function di(e){if(e instanceof Be){const t={};for(const r in e.shape){const i=e.shape[r];t[r]=rr.create(di(i))}return new Be({...e._def,shape:()=>t})}else return e instanceof Kt?new Kt({...e._def,type:di(e.element)}):e instanceof rr?rr.create(di(e.unwrap())):e instanceof si?si.create(di(e.unwrap())):e instanceof ti?ti.create(e.items.map(t=>di(t))):e}class Be extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=me.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ie.object){const d=this._getOrReturnCtx(t);return J(d,{code:X.invalid_type,expected:ie.object,received:d.parsedType}),oe}const{status:i,ctx:s}=this._processInputParams(t),{shape:a,keys:_}=this._getCached(),n=[];if(!(this._def.catchall instanceof Mr&&this._def.unknownKeys==="strip"))for(const d in s.data)_.includes(d)||n.push(d);const u=[];for(const d of _){const y=a[d],f=s.data[d];u.push({key:{status:"valid",value:d},value:y._parse(new Ar(s,f,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Mr){const d=this._def.unknownKeys;if(d==="passthrough")for(const y of n)u.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(d==="strict")n.length>0&&(J(s,{code:X.unrecognized_keys,keys:n}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const y of n){const f=s.data[y];u.push({key:{status:"valid",value:y},value:d._parse(new Ar(s,f,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const y of u){const f=await y.key,m=await y.value;d.push({key:f,value:m,alwaysSet:y.alwaysSet})}return d}).then(d=>yt.mergeObjectSync(i,d)):yt.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return se.errToObj,new Be({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{var a,_;const s=((_=(a=this._def).errorMap)==null?void 0:_.call(a,r,i).message)??i.defaultError;return r.code==="unrecognized_keys"?{message:se.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(t){return new Be({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Be({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Be({...this._def,catchall:t})}pick(t){const r={};for(const i of me.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new Be({...this._def,shape:()=>r})}omit(t){const r={};for(const i of me.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new Be({...this._def,shape:()=>r})}deepPartial(){return di(this)}partial(t){const r={};for(const i of me.objectKeys(this.shape)){const s=this.shape[i];t&&!t[i]?r[i]=s:r[i]=s.optional()}return new Be({...this._def,shape:()=>r})}required(t){const r={};for(const i of me.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let a=this.shape[i];for(;a instanceof rr;)a=a._def.innerType;r[i]=a}return new Be({...this._def,shape:()=>r})}keyof(){return Fd(me.objectKeys(this.shape))}}Be.create=(e,t)=>new Be({shape:()=>e,unknownKeys:"strip",catchall:Mr.create(),typeName:ae.ZodObject,...he(t)});Be.strictCreate=(e,t)=>new Be({shape:()=>e,unknownKeys:"strict",catchall:Mr.create(),typeName:ae.ZodObject,...he(t)});Be.lazycreate=(e,t)=>new Be({shape:e,unknownKeys:"strip",catchall:Mr.create(),typeName:ae.ZodObject,...he(t)});class Un extends ve{_parse(t){const{ctx:r}=this._processInputParams(t),i=this._def.options;function s(a){for(const n of a)if(n.result.status==="valid")return n.result;for(const n of a)if(n.result.status==="dirty")return r.common.issues.push(...n.ctx.common.issues),n.result;const _=a.map(n=>new ar(n.ctx.common.issues));return J(r,{code:X.invalid_union,unionErrors:_}),oe}if(r.common.async)return Promise.all(i.map(async a=>{const _={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:_}),ctx:_}})).then(s);{let a;const _=[];for(const u of i){const d={...r,common:{...r.common,issues:[]},parent:null},y=u._parseSync({data:r.data,path:r.path,parent:d});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:d}),d.common.issues.length&&_.push(d.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const n=_.map(u=>new ar(u));return J(r,{code:X.invalid_union,unionErrors:n}),oe}}get options(){return this._def.options}}Un.create=(e,t)=>new Un({options:e,typeName:ae.ZodUnion,...he(t)});const Gt=e=>e instanceof za?Gt(e.schema):e instanceof ii?Gt(e.innerType()):e instanceof $n?[e.value]:e instanceof ri?e.options:e instanceof Ua?me.objectValues(e.enum):e instanceof Kn?Gt(e._def.innerType):e instanceof Ha?[void 0]:e instanceof Fa?[null]:e instanceof rr?[void 0,...Gt(e.unwrap())]:e instanceof si?[null,...Gt(e.unwrap())]:e instanceof jd||e instanceof qn?Gt(e.unwrap()):e instanceof Zn?Gt(e._def.innerType):[];class Nl extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ie.object)return J(r,{code:X.invalid_type,expected:ie.object,received:r.parsedType}),oe;const i=this.discriminator,s=r.data[i],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(J(r,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){const s=new Map;for(const a of r){const _=Gt(a.shape[t]);if(!_.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const n of _){if(s.has(n))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(n)}`);s.set(n,a)}}return new Nl({typeName:ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...he(i)})}}function ja(e,t){const r=_r(e),i=_r(t);if(e===t)return{valid:!0,data:e};if(r===ie.object&&i===ie.object){const s=me.objectKeys(t),a=me.objectKeys(e).filter(n=>s.indexOf(n)!==-1),_={...e,...t};for(const n of a){const u=ja(e[n],t[n]);if(!u.valid)return{valid:!1};_[n]=u.data}return{valid:!0,data:_}}else if(r===ie.array&&i===ie.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const _=e[a],n=t[a],u=ja(_,n);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===ie.date&&i===ie.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Wn extends ve{_parse(t){const{status:r,ctx:i}=this._processInputParams(t),s=(a,_)=>{if(lu(a)||lu(_))return oe;const n=ja(a.value,_.value);return n.valid?((cu(a)||cu(_))&&r.dirty(),{status:r.value,value:n.data}):(J(i,{code:X.invalid_intersection_types}),oe)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([a,_])=>s(a,_)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Wn.create=(e,t,r)=>new Wn({left:e,right:t,typeName:ae.ZodIntersection,...he(r)});class ti extends ve{_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ie.array)return J(i,{code:X.invalid_type,expected:ie.array,received:i.parsedType}),oe;if(i.data.length<this._def.items.length)return J(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&i.data.length>this._def.items.length&&(J(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...i.data].map((_,n)=>{const u=this._def.items[n]||this._def.rest;return u?u._parse(new Ar(i,_,i.path,n)):null}).filter(_=>!!_);return i.common.async?Promise.all(a).then(_=>yt.mergeArray(r,_)):yt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new ti({...this._def,rest:t})}}ti.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ti({items:e,typeName:ae.ZodTuple,rest:null,...he(t)})};class pu extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ie.map)return J(i,{code:X.invalid_type,expected:ie.map,received:i.parsedType}),oe;const s=this._def.keyType,a=this._def.valueType,_=[...i.data.entries()].map(([n,u],d)=>({key:s._parse(new Ar(i,n,i.path,[d,"key"])),value:a._parse(new Ar(i,u,i.path,[d,"value"]))}));if(i.common.async){const n=new Map;return Promise.resolve().then(async()=>{for(const u of _){const d=await u.key,y=await u.value;if(d.status==="aborted"||y.status==="aborted")return oe;(d.status==="dirty"||y.status==="dirty")&&r.dirty(),n.set(d.value,y.value)}return{status:r.value,value:n}})}else{const n=new Map;for(const u of _){const d=u.key,y=u.value;if(d.status==="aborted"||y.status==="aborted")return oe;(d.status==="dirty"||y.status==="dirty")&&r.dirty(),n.set(d.value,y.value)}return{status:r.value,value:n}}}}pu.create=(e,t,r)=>new pu({valueType:t,keyType:e,typeName:ae.ZodMap,...he(r)});class Ds extends ve{_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ie.set)return J(i,{code:X.invalid_type,expected:ie.set,received:i.parsedType}),oe;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(J(i,{code:X.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(J(i,{code:X.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function _(u){const d=new Set;for(const y of u){if(y.status==="aborted")return oe;y.status==="dirty"&&r.dirty(),d.add(y.value)}return{status:r.value,value:d}}const n=[...i.data.values()].map((u,d)=>a._parse(new Ar(i,u,i.path,d)));return i.common.async?Promise.all(n).then(u=>_(u)):_(n)}min(t,r){return new Ds({...this._def,minSize:{value:t,message:se.toString(r)}})}max(t,r){return new Ds({...this._def,maxSize:{value:t,message:se.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ds.create=(e,t)=>new Ds({valueType:e,minSize:null,maxSize:null,typeName:ae.ZodSet,...he(t)});class za extends ve{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}za.create=(e,t)=>new za({getter:e,typeName:ae.ZodLazy,...he(t)});class $n extends ve{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return J(r,{received:r.data,code:X.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}$n.create=(e,t)=>new $n({value:e,typeName:ae.ZodLiteral,...he(t)});function Fd(e,t){return new ri({values:e,typeName:ae.ZodEnum,...he(t)})}class ri extends ve{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),i=this._def.values;return J(r,{expected:me.joinValues(i),received:r.parsedType,code:X.invalid_type}),oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),i=this._def.values;return J(r,{received:r.data,code:X.invalid_enum_value,options:i}),oe}return Tt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ri.create(t,{...this._def,...r})}exclude(t,r=this._def){return ri.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}ri.create=Fd;class Ua extends ve{_parse(t){const r=me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=me.objectValues(r);return J(i,{expected:me.joinValues(s),received:i.parsedType,code:X.invalid_type}),oe}if(this._cache||(this._cache=new Set(me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=me.objectValues(r);return J(i,{received:i.data,code:X.invalid_enum_value,options:s}),oe}return Tt(t.data)}get enum(){return this._def.values}}Ua.create=(e,t)=>new Ua({values:e,typeName:ae.ZodNativeEnum,...he(t)});class Vn extends ve{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ie.promise&&r.common.async===!1)return J(r,{code:X.invalid_type,expected:ie.promise,received:r.parsedType}),oe;const i=r.parsedType===ie.promise?r.data:Promise.resolve(r.data);return Tt(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Vn.create=(e,t)=>new Vn({type:e,typeName:ae.ZodPromise,...he(t)});class ii extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:i}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:_=>{J(i,_),_.fatal?r.abort():r.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const _=s.transform(i.data,a);if(i.common.async)return Promise.resolve(_).then(async n=>{if(r.value==="aborted")return oe;const u=await this._def.schema._parseAsync({data:n,path:i.path,parent:i});return u.status==="aborted"?oe:u.status==="dirty"||r.value==="dirty"?rs(u.value):u});{if(r.value==="aborted")return oe;const n=this._def.schema._parseSync({data:_,path:i.path,parent:i});return n.status==="aborted"?oe:n.status==="dirty"||r.value==="dirty"?rs(n.value):n}}if(s.type==="refinement"){const _=n=>{const u=s.refinement(n,a);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return n};if(i.common.async===!1){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?oe:(n.status==="dirty"&&r.dirty(),_(n.value),{status:r.value,value:n.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(n=>n.status==="aborted"?oe:(n.status==="dirty"&&r.dirty(),_(n.value).then(()=>({status:r.value,value:n.value}))))}if(s.type==="transform")if(i.common.async===!1){const _=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Hi(_))return oe;const n=s.transform(_.value,a);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:n}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(_=>Hi(_)?Promise.resolve(s.transform(_.value,a)).then(n=>({status:r.value,value:n})):oe);me.assertNever(s)}}ii.create=(e,t,r)=>new ii({schema:e,typeName:ae.ZodEffects,effect:t,...he(r)});ii.createWithPreprocess=(e,t,r)=>new ii({schema:t,effect:{type:"preprocess",transform:e},typeName:ae.ZodEffects,...he(r)});class rr extends ve{_parse(t){return this._getType(t)===ie.undefined?Tt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rr.create=(e,t)=>new rr({innerType:e,typeName:ae.ZodOptional,...he(t)});class si extends ve{_parse(t){return this._getType(t)===ie.null?Tt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}si.create=(e,t)=>new si({innerType:e,typeName:ae.ZodNullable,...he(t)});class Kn extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);let i=r.data;return r.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Kn.create=(e,t)=>new Kn({innerType:e,typeName:ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...he(t)});class Zn extends ve{_parse(t){const{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return jn(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ar(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ar(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Zn.create=(e,t)=>new Zn({innerType:e,typeName:ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...he(t)});class vu extends ve{_parse(t){if(this._getType(t)!==ie.nan){const i=this._getOrReturnCtx(t);return J(i,{code:X.invalid_type,expected:ie.nan,received:i.parsedType}),oe}return{status:"valid",value:t.data}}}vu.create=e=>new vu({typeName:ae.ZodNaN,...he(e)});class jd extends ve{_parse(t){const{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}}class Hl extends ve{_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?oe:a.status==="dirty"?(r.dirty(),rs(a.value)):this._def.out._parseAsync({data:a.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?oe:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(t,r){return new Hl({in:t,out:r,typeName:ae.ZodPipeline})}}class qn extends ve{_parse(t){const r=this._def.innerType._parse(t),i=s=>(Hi(s)&&(s.value=Object.freeze(s.value)),s);return jn(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}}qn.create=(e,t)=>new qn({innerType:e,typeName:ae.ZodReadonly,...he(t)});var ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ae||(ae={}));const Qe=yr.create,Sr=Fi.create,Zr=Na.create;Mr.create;const Qp=Kt.create,He=Be.create;Un.create;const zd=Nl.create;Wn.create;ti.create;const Ue=$n.create;ri.create;Vn.create;rr.create;si.create;zd("type",[He({type:Ue("input"),data:Qe().min(1)}),He({type:Ue("resize"),cols:Sr().int().min(2),rows:Sr().int().min(2)}),He({type:Ue("typing"),active:Zr()}),He({type:Ue("toggle_collab"),enabled:Zr()}),He({type:Ue("take_control")}),He({type:Ue("release_control")}),He({type:Ue("ping"),t:Sr()}),He({type:Ue("kill_session")})]);var Jp=He({id:Qe(),name:Qe(),color:Qe(),typing:Zr(),lastActive:Sr()}),ev=zd("type",[He({type:Ue("hello"),clientId:Qe(),roomId:Qe(),color:Qe(),collabMode:Zr(),controllerId:Qe().nullable()}),He({type:Ue("presence"),clients:Qp(Jp)}),He({type:Ue("output"),data:Qe()}),He({type:Ue("snapshot"),data:Qe(),alternateScreen:Zr().optional(),cursorHidden:Zr().optional()}),He({type:Ue("collab"),enabled:Zr(),controllerId:Qe().nullable()}),He({type:Ue("input_rejected"),reason:Qe()}),He({type:Ue("error"),message:Qe()}),He({type:Ue("session_ended"),exitCode:Sr().int().nullable(),signal:Qe().nullable(),message:Qe()}),He({type:Ue("pong"),t:Sr()}),He({type:Ue("active_size"),clientId:Qe(),cols:Sr().int(),rows:Sr().int()})]),tv=e=>{try{const t=JSON.parse(e),r=ev.safeParse(t);return r.success?r.data:null}catch{return null}};const rv=(e,t)=>[...e].sort((r,i)=>t&&r.id===t?-1:t&&i.id===t?1:r.name.localeCompare(i.name)),iv=e=>e.typing?"typing":(Date.now()-e.lastActive)/1e3<15?"active":"idle",sv=800,nv=e=>{const t=e.charCodeAt(0);return t>=32&&t<=126},ov=e=>{let t="",r=0;for(;r<e.length;){const i=e[r];if(i==="\x1B"){if(r+=1,e[r]==="[")for(r+=1;r<e.length;){const s=e.charCodeAt(r);if(s>=64&&s<=126){r+=1;break}r+=1}else r+=1;continue}nv(i)&&(t+=i),r+=1}return t},av=(e={})=>{const t=e.maxPendingMs??sv,r=e.now??(()=>Date.now());let i="",s=0,a=0;return{onInput:(y,f)=>{if(!f)return"";const m=ov(y);return m?(i+=m,s=r(),m):""},reconcileOutput:y=>{if(!i)return y;if(r()-s>t)return i="",a=0,y;let f=0;const m=Math.min(i.length,y.length);for(;f<m&&y[f]===i[f];)f+=1;return f>0?(i=i.slice(f),a=0,y.slice(f)):(a+=1,a>=2&&(i="",a=0),y)},reset:()=>{i="",a=0},getPending:()=>i}},mu=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgent||"";return/iPad|iPhone|iPod/.test(e)},lv={abc:[["q","w","e","r","t","y","u","i","o","p"],["a","s","d","f","g","h","j","k","l"],["SHIFT","z","x","c","v","b","n","m","BKSP"],["123","PASTE","SPACE","RET"]],num:[["1","2","3","4","5","6","7","8","9","0"],["-","/",":",";","(",")","$","&","@",'"'],["SHIFT",".",",","?","!","'","BKSP"],["ABC","PASTE","SPACE","RET"]]},cv=[{label:"Esc",key:"\x1B"},{label:"Tab",key:" "},{label:"Ctrl",mod:"ctrl"},{label:"Alt",mod:"alt"},{label:"←",key:"\x1B[D"},{label:"↓",key:"\x1B[B"},{label:"↑",key:"\x1B[A"},{label:"→",key:"\x1B[C"},{label:"KB",fn:"sysKb"}],uv=({filled:e})=>j.jsx("svg",{viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",fill:e?"currentColor":"none",children:j.jsx("path",{d:"M12 4L4 16h16L12 4z"})}),hv=()=>j.jsxs("svg",{viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[j.jsx("path",{d:"M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"}),j.jsx("line",{x1:"18",y1:"9",x2:"12",y2:"15"}),j.jsx("line",{x1:"12",y1:"9",x2:"18",y2:"15"})]}),dv=()=>j.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[j.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"}),j.jsx("line",{x1:"6",y1:"10",x2:"6.01",y2:"10"}),j.jsx("line",{x1:"10",y1:"10",x2:"10.01",y2:"10"}),j.jsx("line",{x1:"14",y1:"10",x2:"14.01",y2:"10"}),j.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),j.jsx("line",{x1:"8",y1:"14",x2:"16",y2:"14"})]}),fv=()=>j.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[j.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),j.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]}),_v=({onInput:e,visible:t,onToggle:r,hapticsEnabled:i=!0})=>{const[s,a]=Z.useState("abc"),[_,n]=Z.useState(!1),[u,d]=Z.useState(!1),[y,f]=Z.useState(!1),[m,C]=Z.useState(!1),[k,S]=Z.useState(!1),[h,l]=Z.useState(!1),[o,c]=Z.useState(!1),[p,g]=Z.useState(""),w=Z.useRef(0),x=Z.useRef(null),v=Z.useRef(null),b=Z.useRef(null),R=Z.useRef(null),O=Z.useRef(e),A=Z.useRef(_),M=Z.useRef(u),F=Z.useRef(y);O.current=e,A.current=_,M.current=u,F.current=y,Z.useEffect(()=>{if(!mu())return;const N=document.createElement("input");N.type="checkbox",N.id="hay-haptic-switch",N.setAttribute("switch",""),N.style.position="fixed",N.style.left="-9999px",N.style.top="-9999px",N.style.opacity="0",N.style.pointerEvents="none",document.body.appendChild(N);const K=document.createElement("label");return K.htmlFor="hay-haptic-switch",K.style.position="fixed",K.style.left="-9999px",K.style.top="-9999px",K.style.opacity="0",K.style.pointerEvents="none",document.body.appendChild(K),R.current=K,()=>{document.body.removeChild(N),document.body.removeChild(K),R.current=null}},[]);const U=N=>{N.currentTarget.classList.add("kb-pressed")},I=N=>{N.currentTarget.classList.remove("kb-pressed")},H=Z.useCallback(()=>{var N;if(i)try{mu()?(N=R.current)==null||N.click():navigator.vibrate&&navigator.vibrate(5)}catch{}},[i]),E=Z.useCallback(N=>{let K=N;if(F.current&&N.length===1){const Y=N.toUpperCase().charCodeAt(0);Y>=65&&Y<=90&&(K=String.fromCharCode(Y-64),f(!1))}O.current(K),A.current&&!M.current&&K.length===1&&(w.current=0)},[]),T=Z.useCallback(async()=>{try{if(navigator.clipboard&&navigator.clipboard.readText){const N=await navigator.clipboard.readText();N&&E(N)}}catch{}},[E]),D=Z.useCallback(()=>{const N=b.current;if(!N)return;N.style.height="auto";const K=Math.min(window.innerHeight*.4,240);N.style.height=`${Math.min(N.scrollHeight,K)}px`},[]),P=Z.useCallback(()=>{var N;(N=b.current)==null||N.blur(),S(!1)},[]),W=Z.useCallback(()=>{const N=b.current;if(!N)return;try{N.focus({preventScroll:!0})}catch{N.focus()}const K=N.value.length;typeof N.setSelectionRange=="function"&&N.setSelectionRange(K,K),D()},[D]),G=Z.useCallback(()=>{Pd.flushSync(()=>{S(!0)}),W()},[W]),re=Z.useCallback(()=>{k?P():G()},[k,P,G]),ee=Z.useCallback(()=>{const N=p;N&&(E(N),g("")),b.current&&(b.current.style.height=""),P()},[E,P,p]);Z.useEffect(()=>{if(!k||!b.current)return;const K=()=>{W()},Y=requestAnimationFrame(K),pe=requestAnimationFrame(K);return()=>{cancelAnimationFrame(Y),cancelAnimationFrame(pe)}},[k,D]),Z.useEffect(()=>{k&&D()},[p,k,D]);const _e=Z.useCallback(()=>{const N=Date.now(),K=w.current&&N-w.current<300;u?(d(!1),n(!1),w.current=0):_?K?(d(!0),n(!1),w.current=0):(n(!1),w.current=N):(n(!0),w.current=N)},[u,_]),L=Z.useCallback(()=>{E(""),x.current=window.setTimeout(()=>{v.current=window.setInterval(()=>{E("")},50)},500)},[E]),B=Z.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),v.current&&(clearInterval(v.current),v.current=null)},[]);Z.useEffect(()=>{if(t&&!h)try{localStorage.getItem("hay-syskb-seen")?l(!0):(l(!0),setTimeout(()=>{c(!0),setTimeout(()=>{c(!1),localStorage.setItem("hay-syskb-seen","1")},4e3)},1e3))}catch{l(!0)}},[t,h]);const V=Z.useCallback(N=>{const K=A.current||M.current?N.toUpperCase():N;E(K),A.current&&!M.current&&n(!1)},[E]),z=(N,K,Y)=>{const pe=_||u;if(N==="SHIFT")return j.jsx("button",{type:"button",className:`kb-key kb-act${pe?" kb-on":""}`,style:{flexGrow:1.25},onTouchStart:ne=>{ne.preventDefault(),U(ne),_e()},onTouchEnd:I,onTouchCancel:I,onClick:H,children:j.jsx(uv,{filled:pe})},N);if(N==="BKSP")return j.jsx("button",{type:"button",className:"kb-key kb-act",style:{flexGrow:1.25},onTouchStart:ne=>{ne.preventDefault(),U(ne),L()},onTouchEnd:ne=>{I(ne),B()},onTouchCancel:ne=>{I(ne),B()},onClick:H,children:j.jsx(hv,{})},N);if(N==="PASTE")return j.jsx("button",{type:"button",className:"kb-key kb-act",style:{flexGrow:1.25},onTouchStart:U,onTouchEnd:ne=>{I(ne),T()},onTouchCancel:I,onClick:H,children:j.jsx(fv,{})},N);if(N==="RET")return j.jsx("button",{type:"button",className:"kb-key kb-pri kb-bottom",style:{flexGrow:2.5},onTouchStart:ne=>{ne.preventDefault(),U(ne),E("\r")},onTouchEnd:I,onTouchCancel:I,onClick:H,children:"return"},N);if(N==="SPACE")return j.jsx("button",{type:"button",className:"kb-key kb-bottom",style:{flexGrow:5},onTouchStart:ne=>{ne.preventDefault(),U(ne),E(" ")},onTouchEnd:I,onTouchCancel:I,onClick:H,children:"space"},N);if(N==="123")return j.jsx("button",{type:"button",className:"kb-key kb-act kb-bottom",style:{flexGrow:1.25},onTouchStart:ne=>{ne.preventDefault(),U(ne),a("num")},onTouchEnd:I,onTouchCancel:I,onClick:H,children:"123"},N);if(N==="ABC")return j.jsx("button",{type:"button",className:"kb-key kb-act kb-bottom",style:{flexGrow:1.25},onTouchStart:ne=>{ne.preventDefault(),U(ne),a("abc")},onTouchEnd:I,onTouchCancel:I,onClick:H,children:"ABC"},N);const le=_||u?N.toUpperCase():N;return j.jsx("button",{type:"button",className:"kb-key",onTouchStart:ne=>{ne.preventDefault(),U(ne),V(N)},onTouchEnd:I,onTouchCancel:I,onClick:H,children:le},`${N}-${K}`)};return t?j.jsxs(j.Fragment,{children:[o&&j.jsx("div",{className:"kb-hint-overlay",children:j.jsxs("div",{className:"kb-hint",children:["Tap the pulsing ",j.jsx("strong",{children:"KB"})," button for smooth typing with native keyboard, spellcheck, autocomplete and dictation"]})}),k&&j.jsx("div",{className:"kb-sys-overlay",onClick:re,children:j.jsx("div",{className:"kb-sys-dialog",onClick:N=>N.stopPropagation(),children:j.jsx("textarea",{ref:b,className:"kb-sys-input",placeholder:"Type here...",autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",rows:1,value:p,onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),ee())},onChange:N=>{g(N.currentTarget.value)},onInput:D})})}),j.jsxs("div",{className:"mobile-keyboard",children:[j.jsx("div",{className:"kb-acc-row",children:cv.map((N,K)=>{if(N.mod){const Y=N.mod==="ctrl"?y:m;return j.jsx("button",{type:"button",className:`kb-key kb-act kb-acc${Y?" kb-on":""}`,onTouchStart:pe=>{pe.preventDefault(),U(pe),N.mod==="ctrl"?f(le=>!le):C(le=>!le)},onTouchEnd:I,onTouchCancel:I,onClick:H,children:N.label},N.label)}return N.fn==="sysKb"?j.jsx("button",{type:"button",className:`kb-key kb-act kb-acc kb-syskb${o?" kb-pulse":""}`,onTouchStart:Y=>{Y.preventDefault(),U(Y);try{localStorage.setItem("hay-syskb-seen","1")}catch{}re()},onTouchEnd:I,onTouchCancel:I,onClick:H,children:j.jsx(dv,{})},N.label):j.jsx("button",{type:"button",className:"kb-key kb-act kb-acc",onTouchStart:Y=>{Y.preventDefault(),U(Y),N.key&&E(N.key)},onTouchEnd:I,onTouchCancel:I,onClick:H,children:N.label},N.label)})}),j.jsx("div",{className:"kb-keys",children:lv[s].map((N,K)=>{const Y=K===2;return j.jsx("div",{className:`kb-row${K===1?" kb-r2":""}${Y?" kb-r3":""}`,children:N.map((pe,le)=>{const ne=[];return pe==="SHIFT"&&Y?(ne.push(z(pe,le)),ne.push(j.jsx("div",{className:"kb-gap"},"gap-after-shift")),ne):pe==="BKSP"&&Y?(ne.push(j.jsx("div",{className:"kb-gap"},"gap-before-bksp")),ne.push(z(pe,le)),ne):z(pe,le)})},K)})})]})]}):null},pv=()=>`room-${Math.random().toString(36).slice(2,7)}`,vv=()=>{const e=window.__HOP_SESSION__;if(e!=null&&e.wsUrl){const{protocol:s,host:a}=window.location;return`${s==="https:"?"wss":"ws"}://${a}${e.wsUrl}`}const{protocol:t,host:r}=window.location;return`${t==="https:"?"wss":"ws"}://${r}/ws`},Wo=e=>{const t=iv(e);return t==="typing"?"typing":t==="active"?"active":"idle"},gu=e=>{const t=new URL(window.location.href);return t.searchParams.set("room",e),t.searchParams.delete("name"),t.toString()},mv={background:"#0b1117",foreground:"#e6edf3",cursor:"#f97316",selection:"#1f2937",black:"#0b1117",red:"#ef4444",green:"#22c55e",yellow:"#f59e0b",blue:"#3b82f6",magenta:"#d946ef",cyan:"#14b8a6",white:"#e5e7eb"},yu=()=>{if(typeof window>"u")return!1;const e=navigator.userAgent||"";return/iPhone|iPad|iPod|Android/i.test(e)||window.innerWidth<768},gv=()=>window.__HOP_SESSION__,yv=()=>{const e=new URLSearchParams(window.location.search),t=gv(),[r,i]=Z.useState(()=>e.get("name")??localStorage.getItem("hay_name")??"User"),[s,a]=Z.useState(()=>t!=null&&t.room?t.room:e.get("room")??pv()),[_,n]=Z.useState(()=>t!=null&&t.room?{name:e.get("name")??localStorage.getItem("hay_name")??"User",room:t.room}:null),[u,d]=Z.useState("idle"),[y,f]=Z.useState([]),[m,C]=Z.useState(!0),[k,S]=Z.useState(null),[h,l]=Z.useState(null),[o,c]=Z.useState(null),[p,g]=Z.useState(!0),[w,x]=Z.useState(!0),[v,b]=Z.useState(!1),[R,O]=Z.useState(0),[A,M]=Z.useState(!1),[F,U]=Z.useState({x:20,y:window.innerHeight-80}),I=Z.useRef(null),[H]=Z.useState(()=>yu()),[E,T]=Z.useState(()=>yu()),[D,P]=Z.useState(()=>localStorage.getItem("hay_selection_mode")==="true"),[W,G]=Z.useState(()=>localStorage.getItem("hay_haptics_enabled")!=="false"),[re,ee]=Z.useState([]),[_e,L]=Z.useState(!1),[B,V]=Z.useState(()=>{const $=localStorage.getItem("hay_font_size");return $?parseInt($,10):14}),[z,N]=Z.useState(()=>localStorage.getItem("hay_view_mode")==="fit"?"fit":"full"),K=Z.useRef(null),Y=Z.useRef(null),pe=Z.useRef(null),le=Z.useRef(null),ne=Z.useRef(av()),ce=Z.useRef(!1),Zt=Z.useRef(null),qe=Z.useRef(null);Z.useEffect(()=>{localStorage.setItem("hay_selection_mode",D?"true":"false")},[D]),Z.useEffect(()=>{localStorage.setItem("hay_haptics_enabled",W?"true":"false")},[W]);const Ir=Z.useRef(!1),Nr=Z.useRef(null),Hr=Z.useRef(w),Ne=Z.useRef(z),Ht=Z.useRef(0),Pe=Z.useRef(null),wt=Z.useRef(!0),Dt=$=>{c($),Nr.current&&window.clearTimeout(Nr.current),Nr.current=window.setTimeout(()=>{c(null)},3e3)},Ft=Z.useMemo(()=>gu(_?_.room:s),[_,s]),cr=Z.useMemo(()=>rv(y,h),[y,h]);Z.useMemo(()=>{var $;return k?(($=y.find(Q=>Q.id===k))==null?void 0:$.name)??"Someone":""},[y,k]);const ft=p&&u==="connected"&&!m&&k===h;Z.useEffect(()=>{ce.current&&!ft&&ne.current.reset(),ce.current=ft},[ft]),Z.useEffect(()=>{Hr.current=w},[w]),Z.useEffect(()=>{Ne.current=z,localStorage.setItem("hay_view_mode",z),z==="fit"&&Y.current&&setTimeout(()=>{Fr(),ur()},0)},[z]);const qt=$=>{var Q;((Q=K.current)==null?void 0:Q.readyState)===WebSocket.OPEN&&K.current.send(JSON.stringify($))},be=$=>{qt({type:"typing",active:$})},Is=$=>{const Q=$.replace(/\x1b\[I/g,"").replace(/\x1b\[O/g,"");if(!Q)return;const Ce=ne.current.onInput(Q,ft);Ce&&ho(Ce),qt({type:"input",data:Q}),Hr.current&&Ne.current==="fit"&&(Fr(),ur()),Ir.current||(Ir.current=!0,be(!0)),Zt.current&&window.clearTimeout(Zt.current),Zt.current=window.setTimeout(()=>{Ir.current=!1,be(!1)},1200)},ur=()=>{Y.current&&qt({type:"resize",cols:Y.current.cols,rows:Y.current.rows})},Fr=()=>{var li,Hs,Wi;if(!Y.current||!le.current)return;const $=Y.current,Q=$._core;if(!((Wi=(Hs=(li=Q==null?void 0:Q._renderService)==null?void 0:li.dimensions)==null?void 0:Hs.css)!=null&&Wi.cell))return;const Ce=Q._renderService.dimensions.css.cell.width,de=Q._renderService.dimensions.css.cell.height;if(!Ce||!de)return;const ke=le.current.closest(".terminal-scroll");if(!ke)return;const ue=ke.getBoundingClientRect(),ze=window.getComputedStyle(ke),ot=parseFloat(ze.paddingLeft)||0,tt=parseFloat(ze.paddingRight)||0,Xe=parseFloat(ze.paddingTop)||0,ye=parseFloat(ze.paddingBottom)||0,_t=ue.width-ot-tt,jr=ue.height-Xe-ye,ai=Math.max(2,Math.floor(_t/Ce)),zr=Math.max(1,Math.floor(jr/de));($.cols!==ai||$.rows!==zr)&&$.resize(ai,zr)},ho=$=>{var ke;if(!Y.current)return;const Q=(ke=le.current)==null?void 0:ke.querySelector(".xterm-viewport"),Ce=Q?Q.scrollTop>=Q.scrollHeight-Q.clientHeight-5:!0,de=$.replace(/\x1b\[I/g,"").replace(/\x1b\[O/g,"");Y.current.write(de,()=>{var ue;Ce&&((ue=Y.current)==null||ue.scrollToBottom())})},Ud=$=>{if(!wt.current)return;const Q=Math.min(1e3*Math.pow(2,Ht.current),3e4);Ht.current+=1,Dt(`Reconnecting in ${Math.round(Q/1e3)}s...`),Pe.current=window.setTimeout(()=>{Pe.current=null,wt.current&&Fl($)},Q)},Fl=$=>{var ze,ot,tt;Pe.current&&(window.clearTimeout(Pe.current),Pe.current=null);const Q=vv(),Ce=((ze=Y.current)==null?void 0:ze.cols)??80,de=((ot=Y.current)==null?void 0:ot.rows)??24,ke=`${Q}?room=${encodeURIComponent($.room)}&name=${encodeURIComponent($.name)}&cols=${Ce}&rows=${de}`;(tt=K.current)==null||tt.close(),d("connecting"),wt.current=!0;const ue=new WebSocket(ke);K.current=ue,ue.addEventListener("open",()=>{d("connected"),Ht.current=0,ur()}),ue.addEventListener("message",Xe=>{const ye=tv(Xe.data);if(ye)switch(ye.type){case"hello":l(ye.clientId),C(ye.collabMode),S(ye.controllerId);break;case"presence":f(ye.clients);break;case"output":{const _t=ne.current.reconcileOutput(ye.data);_t&&ho(_t)}break;case"snapshot":ne.current.reset(),Y.current&&Y.current.clear(),ho(ye.data),Y.current&&(typeof ye.cursorHidden=="boolean"?Y.current.write(ye.cursorHidden?"\x1B[?25l":"\x1B[?25h"):ye.alternateScreen&&Y.current.write("\x1B[?25l"));break;case"collab":C(ye.enabled),S(ye.controllerId),Dt(ye.enabled?"Collaborative typing enabled":"Control locked to a single editor");break;case"input_rejected":Dt(ye.reason);break;case"active_size":if(Y.current){const _t=Y.current.cols,jr=Y.current.rows;(ye.cols!==_t||ye.rows!==jr)&&Y.current.resize(ye.cols,ye.rows)}break;case"session_ended":wt.current=!1,Dt(ye.message),ue.close(),d("disconnected");break}}),ue.addEventListener("close",()=>{ne.current.reset(),d("disconnected"),Ud($)}),ue.addEventListener("error",()=>{ne.current.reset(),d("disconnected")})};Z.useEffect(()=>{!_||!v||Fl(_)},[_,v,R]),Z.useEffect(()=>{if(!_||!le.current||Y.current)return;const $=new xp.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:B,lineHeight:1.3,cursorBlink:!0,theme:mv}),Q=new Ep;$.loadAddon(Q),$.open(le.current),Q.fit(),Y.current=$,pe.current=Q,Ne.current==="fit"&&setTimeout(()=>{Fr(),ur()},0);const Ce=[4,10,11,12,52,104,110,111,112];for(const ue of Ce)$.parser.registerOscHandler(ue,()=>!0);if($.parser.registerCsiHandler({final:"I"},()=>!0),$.parser.registerCsiHandler({final:"O"},()=>!0),b(!0),H){const ue=le.current.querySelector("textarea");ue&&(ue.setAttribute("readonly","true"),ue.setAttribute("tabindex","-1"),ue.style.opacity="0",ue.style.pointerEvents="none")}else $.onData(Is);$.attachCustomKeyEventHandler(ue=>ue.ctrlKey&&ue.shiftKey&&(ue.key==="c"||ue.key==="v")?!1:(ue.ctrlKey&&!ue.altKey&&!ue.metaKey,!0));const de=new ResizeObserver(()=>{Ne.current==="fit"&&(Fr(),$.refresh(0,$.rows-1),ur())}),ke=le.current.closest(".terminal-scroll");return ke&&de.observe(ke),()=>{de.disconnect(),$.__touchCleanup&&$.__touchCleanup(),$.dispose(),Y.current=null,pe.current=null,b(!1)}},[_]),Z.useEffect(()=>{var Zl;if(!H||!v)return;const $=Y.current,Q=(Zl=le.current)==null?void 0:Zl.closest(".terminal-scroll");if(!$||!Q||($.__touchCleanup&&($.__touchCleanup(),$.__touchCleanup=null),D))return;let Ce=0,de=0,ke=[],ue=0,ze=0,ot=null,tt=!1,Xe=!1,ye=0,_t=0,jr=0,ai=0;const zr=()=>{var jt,Xt,ci,ui;const Se=$._core,at=(ui=(ci=(Xt=(jt=Se==null?void 0:Se._renderService)==null?void 0:jt.dimensions)==null?void 0:Xt.css)==null?void 0:ci.cell)==null?void 0:ui.height;return at&&at>0?at:18},li=Se=>{const at=(Se[0].clientX+Se[1].clientX)/2,jt=(Se[0].clientY+Se[1].clientY)/2;return{x:at,y:jt}},Hs=.94,Wi=.25,Wl=()=>{ot!==null&&(cancelAnimationFrame(ot),ot=null),ze=0},$l=()=>{if(Math.abs(ze)<Wi){ot=null;return}de+=ze;const Se=Math.trunc(de/zr());Se!==0&&($.scrollLines(Se),de-=Se*zr()),ze*=Hs,ot=requestAnimationFrame($l)},Vl=Se=>{var at;if(Wl(),Se.cancelable&&Se.preventDefault(),Se.touches.length===2){Xe=!0;const jt=li(Se.touches);jr=jt.x,ai=jt.y;const Xt=(at=le.current)==null?void 0:at.closest(".terminal-scroll");Xt&&(ye=Xt.scrollLeft,_t=Xt.scrollTop);return}if(Se.touches.length!==1){Xe=!1,tt=!1;return}Xe=!1,Ce=Se.touches[0].clientY,ue=Date.now(),de=0,ke=[],tt=!0},Kl=Se=>{var ql,Xl;if(Se.touches.length===2){if(!Xe){Xe=!0;const Yl=li(Se.touches);jr=Yl.x,ai=Yl.y;const po=(ql=le.current)==null?void 0:ql.closest(".terminal-scroll");po&&(ye=po.scrollLeft,_t=po.scrollTop)}const Gl=li(Se.touches),Zd=jr-Gl.x,qd=ai-Gl.y,_o=(Xl=le.current)==null?void 0:Xl.closest(".terminal-scroll");_o&&(_o.scrollLeft=ye+Zd,_o.scrollTop=_t+qd),Se.preventDefault();return}if(Se.touches.length!==1)return;Xe&&(Xe=!1,tt=!0);const at=Se.touches[0].clientY,jt=Date.now(),Xt=Ce-at,ci=Math.max(1,jt-ue);ci>0&&ci<100&&(ke.push(Xt/ci),ke.length>5&&ke.shift()),Se.preventDefault(),de+=Xt;const ui=Math.trunc(de/zr());ui!==0&&($.scrollLines(ui),de-=ui*zr()),Ce=at,ue=jt},Fs=()=>{if(Xe){Xe=!1;return}if(tt&&ke.length>0){let Se=0;for(const at of ke)Math.abs(at)>Math.abs(Se)&&(Se=at);ze=Se*16,Math.abs(ze)>=Wi&&(ot=requestAnimationFrame($l))}tt=!1};return Q.addEventListener("touchstart",Vl,{passive:!1,capture:!0}),Q.addEventListener("touchmove",Kl,{passive:!1,capture:!0}),Q.addEventListener("touchend",Fs,{passive:!0,capture:!0}),Q.addEventListener("touchcancel",Fs,{passive:!0,capture:!0}),$.__touchCleanup=()=>{Wl(),Q.removeEventListener("touchstart",Vl,{capture:!0}),Q.removeEventListener("touchmove",Kl,{capture:!0}),Q.removeEventListener("touchend",Fs,{capture:!0}),Q.removeEventListener("touchcancel",Fs,{capture:!0})},()=>{$.__touchCleanup&&($.__touchCleanup(),$.__touchCleanup=null)}},[H,D,v]),Z.useEffect(()=>{var Ce;if(!v||!H)return;const $=Y.current;if(!$)return;const Q=(Ce=$._core)==null?void 0:Ce.viewport;if(Q)return qe.current||(qe.current={start:typeof Q.handleTouchStart=="function"?Q.handleTouchStart.bind(Q):void 0,move:typeof Q.handleTouchMove=="function"?Q.handleTouchMove.bind(Q):void 0}),D?(Q.handleTouchStart=()=>{},Q.handleTouchMove=()=>!0):qe.current&&(qe.current.start&&(Q.handleTouchStart=qe.current.start),qe.current.move&&(Q.handleTouchMove=qe.current.move)),()=>{qe.current&&(qe.current.start&&(Q.handleTouchStart=qe.current.start),qe.current.move&&(Q.handleTouchMove=qe.current.move))}},[v,H,D]),Z.useEffect(()=>{var de;if(!H||!D)return;const $=(de=le.current)==null?void 0:de.closest(".terminal-scroll");if(!$)return;const Q=()=>{var ue;const ke=(ue=le.current)==null?void 0:ue.querySelector(".xterm");ke&&(ke.style.webkitUserSelect="none",ke.style.userSelect="none",requestAnimationFrame(()=>{ke.style.webkitUserSelect="",ke.style.userSelect=""}))},Ce=()=>{var ot,tt,Xe,ye,_t;const ke=window.getSelection();if(!ke||!ke.isCollapsed)return;const ue=(ot=le.current)==null?void 0:ot.querySelector("textarea"),ze=document.activeElement;ke.removeAllRanges(),ue==null||ue.blur(),ze&&ze!==document.body&&ze.blur(),(Xe=(tt=Y.current)==null?void 0:tt.clearSelection)==null||Xe.call(tt),(_t=(ye=Y.current)==null?void 0:ye.blur)==null||_t.call(ye),Q()};return $.addEventListener("click",Ce,!0),()=>{$.removeEventListener("click",Ce,!0)}},[H,D]),Z.useEffect(()=>{var $;return _||(wt.current=!1,Pe.current&&(window.clearTimeout(Pe.current),Pe.current=null),($=K.current)==null||$.close(),K.current=null,ne.current.reset(),Ht.current=0),()=>{var Q;wt.current=!1,Pe.current&&window.clearTimeout(Pe.current),(Q=K.current)==null||Q.close()}},[_]);const Ns=Z.useCallback(async()=>{L(!0);try{const Q=await(await fetch("/api/sessions")).json(),Ce=new Map;for(const de of Q.sessions||[])Ce.set(de.name,{name:de.name,displayName:de.displayName||de.name,active:(Q.active||[]).includes(de.name),starting:(Q.starting||[]).includes(de.name),type:de.type,port:de.port});for(const de of Q.active||[])Ce.has(de)||Ce.set(de,{name:de,displayName:de,active:!0,starting:!1});ee(Array.from(Ce.values()))}catch($){console.error("Failed to fetch sessions:",$)}finally{L(!1)}},[]);Z.useEffect(()=>{A&&Ns()},[A,Ns]),Z.useEffect(()=>{H||Ns()},[Ns,H]),Z.useEffect(()=>{Y.current&&(Y.current.options.fontSize=B,Ne.current==="fit"?(Fr(),ur()):Y.current.refresh(0,Y.current.rows-1)),localStorage.setItem("hay_font_size",String(B))},[B]);const Wd=$=>{window.location.href=`/s/${encodeURIComponent($)}/`},$d=$=>{if($.preventDefault(),!r.trim()||!s.trim()){Dt("Enter a name and room to start.");return}localStorage.setItem("hay_name",r.trim()),n({name:r.trim(),room:s.trim()})},Vd=async()=>{try{await navigator.clipboard.writeText(Ft),Dt("Share link copied.")}catch{Dt("Copy failed. Select the link manually.")}},jl=($,Q)=>{I.current={dragging:!1,startX:$,startY:Q,startPosX:F.x,startPosY:F.y}},zl=($,Q)=>{if(!I.current)return;const Ce=$-I.current.startX,de=Q-I.current.startY;(Math.abs(Ce)>5||Math.abs(de)>5)&&(I.current.dragging=!0),I.current.dragging&&U({x:Math.max(0,Math.min(window.innerWidth-56,I.current.startPosX+Ce)),y:Math.max(0,Math.min(window.innerHeight-56,I.current.startPosY+de))})},fo=()=>{I.current&&!I.current.dragging&&M(!0),I.current=null},Ul=Z.useCallback(()=>{T($=>!$),setTimeout(()=>{Ne.current==="fit"&&(Fr(),ur())},100)},[]),Kd=Z.useCallback($=>{Is($)},[]);return j.jsxs("div",{className:"app",children:[j.jsxs("header",{className:"topbar",children:[j.jsxs("div",{className:"brand",children:[j.jsx("span",{className:"brand-mark",children:"◎"}),j.jsxs("div",{children:[j.jsx("p",{className:"brand-title",children:"Hay"}),j.jsx("p",{className:"brand-subtitle",children:"Collaborative terminal sharing for Hop."})]})]}),j.jsxs("div",{className:"presence-strip",children:[cr.map($=>j.jsxs("div",{className:`presence-chip ${$.id===h?"self":""}`,title:`${$.name} · ${Wo($)}`,children:[j.jsx("span",{className:"presence-dot",style:{backgroundColor:$.color}}),j.jsx("span",{className:"presence-name",children:$.name}),j.jsx("span",{className:`presence-status ${Wo($)}`,children:Wo($)})]},$.id)),cr.length===0&&j.jsx("span",{className:"presence-empty",children:"No viewers yet"})]})]}),_?j.jsxs("main",{className:`session${H&&E?" has-keyboard":""}${D?" selection-mode":""}`,children:[j.jsx("button",{type:"button",className:"drawer-toggle",style:{left:F.x,top:F.y,bottom:"auto"},onMouseDown:$=>jl($.clientX,$.clientY),onMouseMove:$=>zl($.clientX,$.clientY),onMouseUp:fo,onMouseLeave:fo,onTouchStart:$=>jl($.touches[0].clientX,$.touches[0].clientY),onTouchMove:$=>zl($.touches[0].clientX,$.touches[0].clientY),onTouchEnd:fo,children:j.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[j.jsx("circle",{cx:"12",cy:"12",r:"3"}),j.jsx("path",{d:"M12 1v4M12 19v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M1 12h4M19 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83"})]})}),A&&j.jsx("div",{className:"drawer-overlay",onClick:()=>M(!1)}),j.jsxs("section",{className:`controls ${A?"open":""}`,children:[j.jsx("button",{type:"button",className:"drawer-close",onClick:()=>M(!1),children:"✕"}),j.jsxs("div",{className:"room-info",children:[j.jsx("p",{className:"room-label",children:"Session"}),j.jsx("h2",{children:_.room}),j.jsx("p",{className:"room-meta",children:u==="connected"?"Live":u==="connecting"?"Connecting":"Offline"})]}),j.jsxs("div",{className:"control-actions",children:[H&&j.jsx("button",{type:"button",onClick:()=>{Ul(),M(!1)},children:E?"Hide keyboard":"Show keyboard"}),j.jsx("button",{type:"button",onClick:Vd,children:"Copy link"}),j.jsx("button",{type:"button",onClick:()=>{Fr(),ur()},children:"Fit to screen"}),u==="disconnected"&&j.jsx("button",{type:"button",onClick:()=>O($=>$+1),children:"Reconnect"})]}),j.jsxs("div",{className:"font-size-control",children:[j.jsx("label",{children:"Font size"}),j.jsxs("div",{className:"font-size-buttons",children:[j.jsx("button",{type:"button",onClick:()=>V($=>Math.max(8,$-1)),children:"−"}),j.jsxs("span",{children:[B,"px"]}),j.jsx("button",{type:"button",onClick:()=>V($=>Math.min(24,$+1)),children:"+"})]})]}),j.jsxs("div",{className:"view-mode-control",children:[j.jsx("label",{children:"View mode"}),j.jsxs("div",{className:"view-mode-buttons",children:[j.jsx("button",{type:"button",className:z==="fit"?"active":"",onClick:()=>N("fit"),children:"Auto-fit"}),j.jsx("button",{type:"button",className:z==="full"?"active":"",onClick:()=>N("full"),children:"Manual"})]})]}),H&&j.jsxs("div",{className:"selection-mode-control",children:[j.jsx("label",{children:"Selection mode"}),j.jsxs("div",{className:"view-mode-buttons",children:[j.jsx("button",{type:"button",className:D?"":"active",onClick:()=>P(!1),children:"Scroll"}),j.jsx("button",{type:"button",className:D?"active":"",onClick:()=>P(!0),children:"Select"})]})]}),H&&j.jsxs("div",{className:"haptics-control",children:[j.jsx("label",{children:"Haptics"}),j.jsxs("div",{className:"view-mode-buttons",children:[j.jsx("button",{type:"button",className:W?"active":"",onClick:()=>G(!0),children:"On"}),j.jsx("button",{type:"button",className:W?"":"active",onClick:()=>G(!1),children:"Off"})]})]}),o&&j.jsx("p",{className:"notice",children:o}),(()=>{const $=re.filter(Q=>Q.name!==(_==null?void 0:_.room));return j.jsxs("div",{className:"session-switcher",children:[j.jsx("p",{className:"session-switcher-label",children:"Switch session"}),_e?j.jsx("div",{className:"session-list-loading",children:"Loading..."}):$.length===0?j.jsx("div",{className:"session-list-empty",children:"No other sessions"}):j.jsx("div",{className:"session-list",children:$.map(Q=>j.jsxs("button",{type:"button",className:`session-list-item${Q.active?" active":""}${Q.starting?" starting":""}`,onClick:()=>Wd(Q.name),children:[j.jsx("span",{className:"session-list-name",children:Q.displayName}),Q.active&&j.jsx("span",{className:"session-badge live",children:"LIVE"}),Q.starting&&!Q.active&&j.jsx("span",{className:"session-badge starting",children:"STARTING"}),Q.type==="port"&&j.jsxs("span",{className:"session-badge port",children:["PORT ",Q.port]})]},Q.name))})]})})()]}),j.jsxs("section",{className:"terminal",children:[j.jsx("div",{className:"terminal-frame",onClick:()=>{var $;H||($=Y.current)==null||$.focus()},children:j.jsx("div",{className:"terminal-scroll",children:j.jsx("div",{className:"terminal-inner",ref:le})})}),j.jsxs("div",{className:"terminal-footer",children:[j.jsx("span",{children:u==="connected"?"Live":"Awaiting connection"}),j.jsxs("span",{children:[cr.length," viewer",cr.length===1?"":"s"]})]})]}),H&&j.jsx(_v,{onInput:Kd,visible:E,onToggle:Ul,hapticsEnabled:W})]}):j.jsx("main",{className:"join",children:j.jsxs("div",{className:"join-card",children:[j.jsx("h1",{children:"Terminal session"}),j.jsx("p",{children:"Connect to an existing session or start a new one."}),j.jsxs("form",{onSubmit:$d,className:"join-form",children:[j.jsxs("label",{children:["Display name",j.jsx("input",{value:r,onChange:$=>i($.target.value),placeholder:"Casey"})]}),j.jsxs("label",{children:["Session",j.jsx("input",{value:s,onChange:$=>a($.target.value),placeholder:"my-session"})]}),j.jsx("button",{type:"submit",className:"primary",children:"Connect"})]})]})})]})},Su=document.getElementById("root");Su&&Od(Su).render(j.jsx(df.StrictMode,{children:j.jsx(yv,{})}));
60
+ //# sourceMappingURL=index-FDfdolCs.js.map