hop2 0.11.0 → 0.11.2
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.
- package/.github/workflows/ci.yml +25 -0
- package/.github/workflows/publish.yml +130 -0
- package/DESIGN-input-acks.md +349 -0
- package/MULTI-AGENT-CHECKLIST.md +5 -5
- package/README-MCP.md +84 -5
- package/README.md +55 -4
- package/demo/README.md +52 -0
- package/demo/capture/capture-env.mjs +108 -0
- package/demo/capture/capture.mjs +634 -0
- package/demo/capture/dispatch-task.mjs +44 -0
- package/demo/capture/mcp-client.mjs +61 -0
- package/demo/capture/native-css.mjs +49 -0
- package/demo/capture/setup-04.mjs +67 -0
- package/demo/capture/setup-sessions.mjs +40 -0
- package/demo/capture/spawn-aurora.mjs +53 -0
- package/demo/capture/tools/agent.sh +30 -0
- package/demo/capture/tools/build.sh +18 -0
- package/demo/capture/tools/metrics.sh +17 -0
- package/docs/hero-overview.svg +119 -0
- package/docs/hero.svg +118 -0
- package/docs/restore-reliability.md +139 -0
- package/docs/session-identity.md +76 -0
- package/docs/switcher-first-ux.md +103 -0
- package/hay/CHANGELOG.md +59 -1
- package/hay/apps/cli/package.json +3 -2
- package/hay/apps/cli/src/index.ts +705 -28
- package/hay/apps/server/src/pty.ts +36 -2
- package/hay/apps/server/src/rooms.ts +525 -34
- package/hay/apps/server/test/rooms.test.ts +411 -1
- package/hay/apps/web/index.html +2 -0
- package/hay/apps/web/package.json +14 -12
- package/hay/apps/web/scripts/run-e2e.mjs +42 -5
- package/hay/apps/web/src/App.tsx +2492 -281
- package/hay/apps/web/src/components/ContextMenu.tsx +109 -0
- package/hay/apps/web/src/components/MobileKeyboard.tsx +135 -14
- package/hay/apps/web/src/components/SecondaryPane.tsx +218 -0
- package/hay/apps/web/src/components/SessionSwitcher.tsx +2525 -0
- package/hay/apps/web/src/setupTests.ts +23 -0
- package/hay/apps/web/src/styles.css +2460 -180
- package/hay/apps/web/src/utils/fileDrop.ts +15 -0
- package/hay/apps/web/src/utils/keyboardProtocol.ts +22 -0
- package/hay/apps/web/src/utils/optimisticEcho.ts +83 -7
- package/hay/apps/web/src/utils/scrollFlywheel.ts +145 -0
- package/hay/apps/web/src/utils/switcherModel.ts +314 -0
- package/hay/apps/web/src/utils/terminalSearch.ts +54 -0
- package/hay/apps/web/src/vite-env.d.ts +3 -0
- package/hay/apps/web/test/SessionSwitcher.test.tsx +324 -0
- package/hay/apps/web/test/fileDrop.test.ts +22 -0
- package/hay/apps/web/test/optimisticEcho.test.ts +17 -0
- package/hay/apps/web/test/scrollFlywheel.test.ts +113 -0
- package/hay/apps/web/test/switcherModel.test.ts +377 -0
- package/hay/apps/web/test/terminalSearch.test.ts +37 -0
- package/hay/apps/web/vite.config.ts +20 -0
- package/hay/package-lock.json +1696 -1171
- package/hay/packages/shared/src/protocol.ts +25 -2
- package/hay-web/assets/index-BohAWpcL.css +1 -0
- package/hay-web/assets/index-DfGT3DuO.js +130 -0
- package/hay-web/assets/index-DfGT3DuO.js.map +1 -0
- package/hay-web/index.html +4 -2
- package/hop +4348 -302
- package/hopa +465 -0
- package/mcp/hop-mcp.js +2878 -122
- package/package.json +7 -4
- package/scripts/claude-session-hook.js +152 -0
- package/scripts/hay-host.js +227 -4
- package/scripts/hop-math.js +316 -0
- package/scripts/salvage-and-restart-host.js +217 -0
- package/skills/hop-manager/SKILL.md +62 -0
- package/skills/hop-session/SKILL.md +42 -0
- package/skills/hopa/SKILL.md +75 -0
- package/tests/agent-skill.unit.test.cjs +60 -0
- package/tests/composer-state.unit.test.cjs +102 -0
- package/tests/hop-mcp.integration.test.cjs +476 -94
- package/tests/hopa-parity.unit.test.cjs +188 -0
- package/tests/readable-echo.unit.test.cjs +94 -0
- package/tests/readable-flush.unit.test.cjs +93 -0
- package/tests/submit-verification.unit.test.cjs +331 -0
- package/tests/terminal-api.integration.test.cjs +301 -13
- package/hay-web/assets/index-BzJB9r_I.js +0 -64
- package/hay-web/assets/index-BzJB9r_I.js.map +0 -1
- package/hay-web/assets/index-DG8Ntznc.css +0 -32
- package/sessions.html +0 -726
|
@@ -1,64 +0,0 @@
|
|
|
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 e_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},To={},yh={exports:{}},me={};/**
|
|
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 sn=Symbol.for("react.element"),t_=Symbol.for("react.portal"),r_=Symbol.for("react.fragment"),i_=Symbol.for("react.strict_mode"),s_=Symbol.for("react.profiler"),n_=Symbol.for("react.provider"),o_=Symbol.for("react.context"),a_=Symbol.for("react.forward_ref"),l_=Symbol.for("react.suspense"),c_=Symbol.for("react.memo"),u_=Symbol.for("react.lazy"),$c=Symbol.iterator;function h_(e){return e===null||typeof e!="object"?null:(e=$c&&e[$c]||e["@@iterator"],typeof e=="function"?e:null)}var Sh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wh=Object.assign,Ch={};function us(e,t,r){this.props=e,this.context=t,this.refs=Ch,this.updater=r||Sh}us.prototype.isReactComponent={};us.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")};us.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kh(){}kh.prototype=us.prototype;function Rl(e,t,r){this.props=e,this.context=t,this.refs=Ch,this.updater=r||Sh}var Tl=Rl.prototype=new kh;Tl.constructor=Rl;wh(Tl,us.prototype);Tl.isPureReactComponent=!0;var Vc=Array.isArray,bh=Object.prototype.hasOwnProperty,Dl={current:null},xh={key:!0,ref:!0,__self:!0,__source:!0};function Eh(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)bh.call(t,i)&&!xh.hasOwnProperty(i)&&(s[i]=t[i]);var n=arguments.length-2;if(n===1)s.children=r;else if(1<n){for(var h=Array(n),d=0;d<n;d++)h[d]=arguments[d+2];s.children=h}if(e&&e.defaultProps)for(i in n=e.defaultProps,n)s[i]===void 0&&(s[i]=n[i]);return{$$typeof:sn,type:e,key:a,ref:_,props:s,_owner:Dl.current}}function d_(e,t){return{$$typeof:sn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Al(e){return typeof e=="object"&&e!==null&&e.$$typeof===sn}function f_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Kc=/\/+/g;function ta(e,t){return typeof e=="object"&&e!==null&&e.key!=null?f_(""+e.key):t.toString(36)}function Nn(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 sn:case t_:_=!0}}if(_)return _=e,s=s(_),e=i===""?"."+ta(_,0):i,Vc(s)?(r="",e!=null&&(r=e.replace(Kc,"$&/")+"/"),Nn(s,t,r,"",function(d){return d})):s!=null&&(Al(s)&&(s=d_(s,r+(!s.key||_&&_.key===s.key?"":(""+s.key).replace(Kc,"$&/")+"/")+e)),t.push(s)),1;if(_=0,i=i===""?".":i+":",Vc(e))for(var n=0;n<e.length;n++){a=e[n];var h=i+ta(a,n);_+=Nn(a,t,r,h,s)}else if(h=h_(e),typeof h=="function")for(e=h.call(e),n=0;!(a=e.next()).done;)a=a.value,h=i+ta(a,n++),_+=Nn(a,t,r,h,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 Sn(e,t,r){if(e==null)return e;var i=[],s=0;return Nn(e,i,"","",function(a){return t.call(r,a,s++)}),i}function __(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 dt={current:null},Hn={transition:null},p_={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:Hn,ReactCurrentOwner:Dl};function Lh(){throw Error("act(...) is not supported in production builds of React.")}me.Children={map:Sn,forEach:function(e,t,r){Sn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Sn(e,function(){t++}),t},toArray:function(e){return Sn(e,function(t){return t})||[]},only:function(e){if(!Al(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Component=us;me.Fragment=r_;me.Profiler=s_;me.PureComponent=Rl;me.StrictMode=i_;me.Suspense=l_;me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p_;me.act=Lh;me.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=wh({},e.props),s=e.key,a=e.ref,_=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,_=Dl.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(h in t)bh.call(t,h)&&!xh.hasOwnProperty(h)&&(i[h]=t[h]===void 0&&n!==void 0?n[h]:t[h])}var h=arguments.length-2;if(h===1)i.children=r;else if(1<h){n=Array(h);for(var d=0;d<h;d++)n[d]=arguments[d+2];i.children=n}return{$$typeof:sn,type:e.type,key:s,ref:a,props:i,_owner:_}};me.createContext=function(e){return e={$$typeof:o_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:n_,_context:e},e.Consumer=e};me.createElement=Eh;me.createFactory=function(e){var t=Eh.bind(null,e);return t.type=e,t};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:a_,render:e}};me.isValidElement=Al;me.lazy=function(e){return{$$typeof:u_,_payload:{_status:-1,_result:e},_init:__}};me.memo=function(e,t){return{$$typeof:c_,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=Hn.transition;Hn.transition={};try{e()}finally{Hn.transition=t}};me.unstable_act=Lh;me.useCallback=function(e,t){return dt.current.useCallback(e,t)};me.useContext=function(e){return dt.current.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};me.useEffect=function(e,t){return dt.current.useEffect(e,t)};me.useId=function(){return dt.current.useId()};me.useImperativeHandle=function(e,t,r){return dt.current.useImperativeHandle(e,t,r)};me.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};me.useMemo=function(e,t){return dt.current.useMemo(e,t)};me.useReducer=function(e,t,r){return dt.current.useReducer(e,t,r)};me.useRef=function(e){return dt.current.useRef(e)};me.useState=function(e){return dt.current.useState(e)};me.useSyncExternalStore=function(e,t,r){return dt.current.useSyncExternalStore(e,t,r)};me.useTransition=function(){return dt.current.useTransition()};me.version="18.3.1";yh.exports=me;var U=yh.exports;const v_=e_(U);/**
|
|
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 m_=U,g_=Symbol.for("react.element"),y_=Symbol.for("react.fragment"),S_=Object.prototype.hasOwnProperty,w_=m_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C_={key:!0,ref:!0,__self:!0,__source:!0};function Rh(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)S_.call(t,i)&&!C_.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:g_,type:e,key:a,ref:_,props:s,_owner:w_.current}}To.Fragment=y_;To.jsx=Rh;To.jsxs=Rh;gh.exports=To;var I=gh.exports,Th={exports:{}},At={},Dh={exports:{}},Ah={};/**
|
|
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 M=D-1>>>1,H=E[M];if(0<s(H,T))E[M]=T,E[D]=H,D=M;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 M=0,H=E.length,q=H>>>1;M<q;){var te=2*(M+1)-1,J=E[te],fe=te+1,L=E[fe];if(0>s(J,D))fe<H&&0>s(L,J)?(E[M]=L,E[fe]=D,M=fe):(E[M]=J,E[te]=D,M=te);else if(fe<H&&0>s(L,D))E[M]=L,E[fe]=D,M=fe;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 h=[],d=[],y=1,f=null,m=3,w=!1,k=!1,S=!1,u=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(h,T);else break;T=r(d)}}function p(E){if(S=!1,c(E),!k)if(r(h)!==null)k=!0,Z(g);else{var T=r(d);T!==null&&V(p,T.startTime-E)}}function g(E,T){k=!1,S&&(S=!1,l(v),v=-1),w=!0;var D=m;try{for(c(T),f=r(h);f!==null&&(!(f.expirationTime>T)||E&&!P());){var M=f.callback;if(typeof M=="function"){f.callback=null,m=f.priorityLevel;var H=M(f.expirationTime<=T);T=e.unstable_now(),typeof H=="function"?f.callback=H:f===r(h)&&i(h),c(T)}else i(h);f=r(h)}if(f!==null)var q=!0;else{var te=r(d);te!==null&&V(p,te.startTime-T),q=!1}return q}finally{f=null,m=D,w=!1}}var C=!1,x=null,v=-1,b=5,R=-1;function P(){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?O():(C=!1,x=null)}}else C=!1}var O;if(typeof o=="function")O=function(){o(A)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,W=F.port2;F.port1.onmessage=A,O=function(){W.postMessage(null)}}else O=function(){u(A,0)};function Z(E){x=E,C||(C=!0,O())}function V(E,T){v=u(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||w||(k=!0,Z(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(h)},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 M=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?M+D:M):D=M,E){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=D+H,E={id:y++,callback:T,priorityLevel:E,startTime:D,expirationTime:H,sortIndex:-1},D>M?(E.sortIndex=D,t(d,E),r(h)===null&&E===r(d)&&(S?(l(v),v=-1):S=!0,V(p,D-M))):(E.sortIndex=H,t(h,E),k||w||(k=!0,Z(g))),E},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(E){var T=m;return function(){var D=m;m=T;try{return E.apply(this,arguments)}finally{m=D}}}})(Ah);Dh.exports=Ah;var k_=Dh.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 b_=U,Tt=k_;function X(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 Mh=new Set,Hs={};function bi(e,t){ts(e,t),ts(e+"Capture",t)}function ts(e,t){for(Hs[e]=t,e=0;e<t.length;e++)Mh.add(t[e])}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ta=Object.prototype.hasOwnProperty,x_=/^[: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]*$/,Zc={},qc={};function E_(e){return Ta.call(qc,e)?!0:Ta.call(Zc,e)?!1:x_.test(e)?qc[e]=!0:(Zc[e]=!0,!1)}function L_(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 R_(e,t,r,i){if(t===null||typeof t>"u"||L_(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 ft(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 st={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){st[e]=new ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];st[t]=new ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){st[e]=new ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){st[e]=new ft(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){st[e]=new ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){st[e]=new ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){st[e]=new ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){st[e]=new ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){st[e]=new ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ml=/[\-:]([a-z])/g;function Pl(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(Ml,Pl);st[t]=new ft(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(Ml,Pl);st[t]=new ft(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(Ml,Pl);st[t]=new ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){st[e]=new ft(e,1,!1,e.toLowerCase(),null,!1,!1)});st.xlinkHref=new ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){st[e]=new ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ol(e,t,r,i){var s=st.hasOwnProperty(t)?st[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(R_(t,r,s,i)&&(r=null),i||s===null?E_(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 kr=b_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wn=Symbol.for("react.element"),Ni=Symbol.for("react.portal"),Hi=Symbol.for("react.fragment"),Bl=Symbol.for("react.strict_mode"),Da=Symbol.for("react.profiler"),Ph=Symbol.for("react.provider"),Oh=Symbol.for("react.context"),Il=Symbol.for("react.forward_ref"),Aa=Symbol.for("react.suspense"),Ma=Symbol.for("react.suspense_list"),Nl=Symbol.for("react.memo"),Ar=Symbol.for("react.lazy"),Bh=Symbol.for("react.offscreen"),Xc=Symbol.iterator;function vs(e){return e===null||typeof e!="object"?null:(e=Xc&&e[Xc]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,ra;function bs(e){if(ra===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ra=t&&t[1]||""}return`
|
|
34
|
-
`+ra+e}var ia=!1;function sa(e,t){if(!e||ia)return"";ia=!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 h=`
|
|
37
|
-
`+s[_].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=_&&0<=n);break}}}finally{ia=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?bs(e):""}function T_(e){switch(e.tag){case 5:return bs(e.type);case 16:return bs("Lazy");case 13:return bs("Suspense");case 19:return bs("SuspenseList");case 0:case 2:case 15:return e=sa(e.type,!1),e;case 11:return e=sa(e.type.render,!1),e;case 1:return e=sa(e.type,!0),e;default:return""}}function Pa(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 Hi:return"Fragment";case Ni:return"Portal";case Da:return"Profiler";case Bl:return"StrictMode";case Aa:return"Suspense";case Ma:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oh:return(e.displayName||"Context")+".Consumer";case Ph:return(e._context.displayName||"Context")+".Provider";case Il:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nl:return t=e.displayName||null,t!==null?t:Pa(e.type)||"Memo";case Ar:t=e._payload,e=e._init;try{return Pa(e(t))}catch{}}return null}function D_(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 Pa(t);case 8:return t===Bl?"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 Xr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ih(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function A_(e){var t=Ih(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 Cn(e){e._valueTracker||(e._valueTracker=A_(e))}function Nh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Ih(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Xn(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 Oa(e,t){var r=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Yc(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Xr(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 Hh(e,t){t=t.checked,t!=null&&Ol(e,"checked",t,!1)}function Ba(e,t){Hh(e,t);var r=Xr(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")?Ia(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ia(e,t.type,Xr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gc(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 Ia(e,t,r){(t!=="number"||Xn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var xs=Array.isArray;function Xi(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=""+Xr(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 Na(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qc(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(X(92));if(xs(r)){if(1<r.length)throw Error(X(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Xr(r)}}function jh(e,t){var r=Xr(t.value),i=Xr(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 Jc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Fh(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 Ha(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Fh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kn,zh=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(kn=kn||document.createElement("div"),kn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function js(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ts={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},M_=["Webkit","ms","Moz","O"];Object.keys(Ts).forEach(function(e){M_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ts[t]=Ts[e]})});function Uh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ts.hasOwnProperty(e)&&Ts[e]?(""+t).trim():t+"px"}function Wh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=Uh(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var P_=je({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 ja(e,t){if(t){if(P_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function Fa(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 za=null;function Hl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,Yi=null,Gi=null;function eu(e){if(e=an(e)){if(typeof Ua!="function")throw Error(X(280));var t=e.stateNode;t&&(t=Oo(t),Ua(e.stateNode,e.type,t))}}function $h(e){Yi?Gi?Gi.push(e):Gi=[e]:Yi=e}function Vh(){if(Yi){var e=Yi,t=Gi;if(Gi=Yi=null,eu(e),t)for(e=0;e<t.length;e++)eu(t[e])}}function Kh(e,t){return e(t)}function Zh(){}var na=!1;function qh(e,t,r){if(na)return e(t,r);na=!0;try{return Kh(e,t,r)}finally{na=!1,(Yi!==null||Gi!==null)&&(Zh(),Vh())}}function Fs(e,t){var r=e.stateNode;if(r===null)return null;var i=Oo(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(X(231,t,typeof r));return r}var Wa=!1;if(gr)try{var ms={};Object.defineProperty(ms,"passive",{get:function(){Wa=!0}}),window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{Wa=!1}function O_(e,t,r,i,s,a,_,n,h){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(y){this.onError(y)}}var Ds=!1,Yn=null,Gn=!1,$a=null,B_={onError:function(e){Ds=!0,Yn=e}};function I_(e,t,r,i,s,a,_,n,h){Ds=!1,Yn=null,O_.apply(B_,arguments)}function N_(e,t,r,i,s,a,_,n,h){if(I_.apply(this,arguments),Ds){if(Ds){var d=Yn;Ds=!1,Yn=null}else throw Error(X(198));Gn||(Gn=!0,$a=d)}}function xi(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 Xh(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 tu(e){if(xi(e)!==e)throw Error(X(188))}function H_(e){var t=e.alternate;if(!t){if(t=xi(e),t===null)throw Error(X(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 tu(s),e;if(a===i)return tu(s),t;a=a.sibling}throw Error(X(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(X(189))}}if(r.alternate!==i)throw Error(X(190))}if(r.tag!==3)throw Error(X(188));return r.stateNode.current===r?e:t}function Yh(e){return e=H_(e),e!==null?Gh(e):null}function Gh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Gh(e);if(t!==null)return t;e=e.sibling}return null}var Qh=Tt.unstable_scheduleCallback,ru=Tt.unstable_cancelCallback,j_=Tt.unstable_shouldYield,F_=Tt.unstable_requestPaint,Ue=Tt.unstable_now,z_=Tt.unstable_getCurrentPriorityLevel,jl=Tt.unstable_ImmediatePriority,Jh=Tt.unstable_UserBlockingPriority,Qn=Tt.unstable_NormalPriority,U_=Tt.unstable_LowPriority,ed=Tt.unstable_IdlePriority,Do=null,or=null;function W_(e){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(Do,e,void 0,(e.current.flags&128)===128)}catch{}}var Yt=Math.clz32?Math.clz32:K_,$_=Math.log,V_=Math.LN2;function K_(e){return e>>>=0,e===0?32:31-($_(e)/V_|0)|0}var bn=64,xn=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 Jn(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-Yt(t),s=1<<r,i|=e[r],t&=~s;return i}function Z_(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 q_(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var _=31-Yt(a),n=1<<_,h=s[_];h===-1?(!(n&r)||n&i)&&(s[_]=Z_(n,t)):h<=t&&(e.expiredLanes|=n),a&=~n}}function Va(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function td(){var e=bn;return bn<<=1,!(bn&4194240)&&(bn=64),e}function oa(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function nn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=r}function X_(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-Yt(r),a=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~a}}function Fl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Yt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var Te=0;function rd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var id,zl,sd,nd,od,Ka=!1,En=[],zr=null,Ur=null,Wr=null,zs=new Map,Us=new Map,Or=[],Y_="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 iu(e,t){switch(e){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":zs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Us.delete(t.pointerId)}}function gs(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=an(t),t!==null&&zl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function G_(e,t,r,i,s){switch(t){case"focusin":return zr=gs(zr,e,t,r,i,s),!0;case"dragenter":return Ur=gs(Ur,e,t,r,i,s),!0;case"mouseover":return Wr=gs(Wr,e,t,r,i,s),!0;case"pointerover":var a=s.pointerId;return zs.set(a,gs(zs.get(a)||null,e,t,r,i,s)),!0;case"gotpointercapture":return a=s.pointerId,Us.set(a,gs(Us.get(a)||null,e,t,r,i,s)),!0}return!1}function ad(e){var t=ui(e.target);if(t!==null){var r=xi(t);if(r!==null){if(t=r.tag,t===13){if(t=Xh(r),t!==null){e.blockedOn=t,od(e.priority,function(){sd(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 jn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Za(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);za=i,r.target.dispatchEvent(i),za=null}else return t=an(r),t!==null&&zl(t),e.blockedOn=r,!1;t.shift()}return!0}function su(e,t,r){jn(e)&&r.delete(t)}function Q_(){Ka=!1,zr!==null&&jn(zr)&&(zr=null),Ur!==null&&jn(Ur)&&(Ur=null),Wr!==null&&jn(Wr)&&(Wr=null),zs.forEach(su),Us.forEach(su)}function ys(e,t){e.blockedOn===t&&(e.blockedOn=null,Ka||(Ka=!0,Tt.unstable_scheduleCallback(Tt.unstable_NormalPriority,Q_)))}function Ws(e){function t(s){return ys(s,e)}if(0<En.length){ys(En[0],e);for(var r=1;r<En.length;r++){var i=En[r];i.blockedOn===e&&(i.blockedOn=null)}}for(zr!==null&&ys(zr,e),Ur!==null&&ys(Ur,e),Wr!==null&&ys(Wr,e),zs.forEach(t),Us.forEach(t),r=0;r<Or.length;r++)i=Or[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Or.length&&(r=Or[0],r.blockedOn===null);)ad(r),r.blockedOn===null&&Or.shift()}var Qi=kr.ReactCurrentBatchConfig,eo=!0;function J_(e,t,r,i){var s=Te,a=Qi.transition;Qi.transition=null;try{Te=1,Ul(e,t,r,i)}finally{Te=s,Qi.transition=a}}function ep(e,t,r,i){var s=Te,a=Qi.transition;Qi.transition=null;try{Te=4,Ul(e,t,r,i)}finally{Te=s,Qi.transition=a}}function Ul(e,t,r,i){if(eo){var s=Za(e,t,r,i);if(s===null)va(e,t,i,to,r),iu(e,i);else if(G_(s,e,t,r,i))i.stopPropagation();else if(iu(e,i),t&4&&-1<Y_.indexOf(e)){for(;s!==null;){var a=an(s);if(a!==null&&id(a),a=Za(e,t,r,i),a===null&&va(e,t,i,to,r),a===s)break;s=a}s!==null&&i.stopPropagation()}else va(e,t,i,null,r)}}var to=null;function Za(e,t,r,i){if(to=null,e=Hl(i),e=ui(e),e!==null)if(t=xi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Xh(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 to=e,null}function ld(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(z_()){case jl:return 1;case Jh:return 4;case Qn:case U_:return 16;case ed:return 536870912;default:return 16}default:return 16}}var Nr=null,Wl=null,Fn=null;function cd(){if(Fn)return Fn;var e,t=Wl,r=t.length,i,s="value"in Nr?Nr.value:Nr.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 Fn=s.slice(e,1<i?1-i:void 0)}function zn(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 Ln(){return!0}function nu(){return!1}function Mt(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)?Ln:nu,this.isPropagationStopped=nu,this}return je(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=Ln)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=Mt(hs),on=je({},hs,{view:0,detail:0}),tp=Mt(on),aa,la,Ss,Ao=je({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vl,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!==Ss&&(Ss&&e.type==="mousemove"?(aa=e.screenX-Ss.screenX,la=e.screenY-Ss.screenY):la=aa=0,Ss=e),aa)},movementY:function(e){return"movementY"in e?e.movementY:la}}),ou=Mt(Ao),rp=je({},Ao,{dataTransfer:0}),ip=Mt(rp),sp=je({},on,{relatedTarget:0}),ca=Mt(sp),np=je({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),op=Mt(np),ap=je({},hs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lp=Mt(ap),cp=je({},hs,{data:0}),au=Mt(cp),up={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hp={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"},dp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dp[e])?!!t[e]:!1}function Vl(){return fp}var _p=je({},on,{key:function(e){if(e.key){var t=up[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vl,charCode:function(e){return e.type==="keypress"?zn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pp=Mt(_p),vp=je({},Ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lu=Mt(vp),mp=je({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vl}),gp=Mt(mp),yp=je({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sp=Mt(yp),wp=je({},Ao,{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}),Cp=Mt(wp),kp=[9,13,27,32],Kl=gr&&"CompositionEvent"in window,As=null;gr&&"documentMode"in document&&(As=document.documentMode);var bp=gr&&"TextEvent"in window&&!As,ud=gr&&(!Kl||As&&8<As&&11>=As),cu=" ",uu=!1;function hd(e,t){switch(e){case"keyup":return kp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ji=!1;function xp(e,t){switch(e){case"compositionend":return dd(t);case"keypress":return t.which!==32?null:(uu=!0,cu);case"textInput":return e=t.data,e===cu&&uu?null:e;default:return null}}function Ep(e,t){if(ji)return e==="compositionend"||!Kl&&hd(e,t)?(e=cd(),Fn=Wl=Nr=null,ji=!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 ud&&t.locale!=="ko"?null:t.data;default:return null}}var Lp={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 hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lp[e.type]:t==="textarea"}function fd(e,t,r,i){$h(i),t=ro(t,"onChange"),0<t.length&&(r=new $l("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Ms=null,$s=null;function Rp(e){bd(e,0)}function Mo(e){var t=Ui(e);if(Nh(t))return e}function Tp(e,t){if(e==="change")return t}var _d=!1;if(gr){var ua;if(gr){var ha="oninput"in document;if(!ha){var du=document.createElement("div");du.setAttribute("oninput","return;"),ha=typeof du.oninput=="function"}ua=ha}else ua=!1;_d=ua&&(!document.documentMode||9<document.documentMode)}function fu(){Ms&&(Ms.detachEvent("onpropertychange",pd),$s=Ms=null)}function pd(e){if(e.propertyName==="value"&&Mo($s)){var t=[];fd(t,$s,e,Hl(e)),qh(Rp,t)}}function Dp(e,t,r){e==="focusin"?(fu(),Ms=t,$s=r,Ms.attachEvent("onpropertychange",pd)):e==="focusout"&&fu()}function Ap(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Mo($s)}function Mp(e,t){if(e==="click")return Mo(t)}function Pp(e,t){if(e==="input"||e==="change")return Mo(t)}function Op(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:Op;function Vs(e,t){if(Qt(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(!Ta.call(t,s)||!Qt(e[s],t[s]))return!1}return!0}function _u(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pu(e,t){var r=_u(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=_u(r)}}function vd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function md(){for(var e=window,t=Xn();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xn(e.document)}return t}function Zl(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 Bp(e){var t=md(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&vd(r.ownerDocument.documentElement,r)){if(i!==null&&Zl(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=pu(r,a);var _=pu(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 Ip=gr&&"documentMode"in document&&11>=document.documentMode,Fi=null,qa=null,Ps=null,Xa=!1;function vu(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Xa||Fi==null||Fi!==Xn(i)||(i=Fi,"selectionStart"in i&&Zl(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}),Ps&&Vs(Ps,i)||(Ps=i,i=ro(qa,"onSelect"),0<i.length&&(t=new $l("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Fi)))}function Rn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var zi={animationend:Rn("Animation","AnimationEnd"),animationiteration:Rn("Animation","AnimationIteration"),animationstart:Rn("Animation","AnimationStart"),transitionend:Rn("Transition","TransitionEnd")},da={},gd={};gr&&(gd=document.createElement("div").style,"AnimationEvent"in window||(delete zi.animationend.animation,delete zi.animationiteration.animation,delete zi.animationstart.animation),"TransitionEvent"in window||delete zi.transitionend.transition);function Po(e){if(da[e])return da[e];if(!zi[e])return e;var t=zi[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in gd)return da[e]=t[r];return e}var yd=Po("animationend"),Sd=Po("animationiteration"),wd=Po("animationstart"),Cd=Po("transitionend"),kd=new Map,mu="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 Jr(e,t){kd.set(e,t),bi(t,[e])}for(var fa=0;fa<mu.length;fa++){var _a=mu[fa],Np=_a.toLowerCase(),Hp=_a[0].toUpperCase()+_a.slice(1);Jr(Np,"on"+Hp)}Jr(yd,"onAnimationEnd");Jr(Sd,"onAnimationIteration");Jr(wd,"onAnimationStart");Jr("dblclick","onDoubleClick");Jr("focusin","onFocus");Jr("focusout","onBlur");Jr(Cd,"onTransitionEnd");ts("onMouseEnter",["mouseout","mouseover"]);ts("onMouseLeave",["mouseout","mouseover"]);ts("onPointerEnter",["pointerout","pointerover"]);ts("onPointerLeave",["pointerout","pointerover"]);bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ls="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(" "),jp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ls));function gu(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,N_(i,t,void 0,e),e.currentTarget=null}function bd(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[_],h=n.instance,d=n.currentTarget;if(n=n.listener,h!==a&&s.isPropagationStopped())break e;gu(s,n,d),a=h}else for(_=0;_<i.length;_++){if(n=i[_],h=n.instance,d=n.currentTarget,n=n.listener,h!==a&&s.isPropagationStopped())break e;gu(s,n,d),a=h}}}if(Gn)throw e=$a,Gn=!1,$a=null,e}function Ae(e,t){var r=t[el];r===void 0&&(r=t[el]=new Set);var i=e+"__bubble";r.has(i)||(xd(t,e,2,!1),r.add(i))}function pa(e,t,r){var i=0;t&&(i|=4),xd(r,e,i,t)}var Tn="_reactListening"+Math.random().toString(36).slice(2);function Ks(e){if(!e[Tn]){e[Tn]=!0,Mh.forEach(function(r){r!=="selectionchange"&&(jp.has(r)||pa(r,!1,e),pa(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tn]||(t[Tn]=!0,pa("selectionchange",!1,t))}}function xd(e,t,r,i){switch(ld(t)){case 1:var s=J_;break;case 4:s=ep;break;default:s=Ul}r=s.bind(null,t,r,e),s=void 0,!Wa||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 va(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 h=_.tag;if((h===3||h===4)&&(h=_.stateNode.containerInfo,h===s||h.nodeType===8&&h.parentNode===s))return;_=_.return}for(;n!==null;){if(_=ui(n),_===null)return;if(h=_.tag,h===5||h===6){i=a=_;continue e}n=n.parentNode}}i=i.return}qh(function(){var d=a,y=Hl(r),f=[];e:{var m=kd.get(e);if(m!==void 0){var w=$l,k=e;switch(e){case"keypress":if(zn(r)===0)break e;case"keydown":case"keyup":w=pp;break;case"focusin":k="focus",w=ca;break;case"focusout":k="blur",w=ca;break;case"beforeblur":case"afterblur":w=ca;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":w=ou;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=ip;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=gp;break;case yd:case Sd:case wd:w=op;break;case Cd:w=Sp;break;case"scroll":w=tp;break;case"wheel":w=Cp;break;case"copy":case"cut":case"paste":w=lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=lu}var S=(t&4)!==0,u=!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=Fs(o,l),p!=null&&S.push(Zs(o,p,c)))),u)break;o=o.return}0<S.length&&(m=new w(m,k,null,r,y),f.push({event:m,listeners:S}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",m&&r!==za&&(k=r.relatedTarget||r.fromElement)&&(ui(k)||k[yr]))break e;if((w||m)&&(m=y.window===y?y:(m=y.ownerDocument)?m.defaultView||m.parentWindow:window,w?(k=r.relatedTarget||r.toElement,w=d,k=k?ui(k):null,k!==null&&(u=xi(k),k!==u||k.tag!==5&&k.tag!==6)&&(k=null)):(w=null,k=d),w!==k)){if(S=ou,p="onMouseLeave",l="onMouseEnter",o="mouse",(e==="pointerout"||e==="pointerover")&&(S=lu,p="onPointerLeave",l="onPointerEnter",o="pointer"),u=w==null?m:Ui(w),c=k==null?m:Ui(k),m=new S(p,o+"leave",w,r,y),m.target=u,m.relatedTarget=c,p=null,ui(y)===d&&(S=new S(l,o+"enter",k,r,y),S.target=c,S.relatedTarget=u,p=S),u=p,w&&k)t:{for(S=w,l=k,o=0,c=S;c;c=Bi(c))o++;for(c=0,p=l;p;p=Bi(p))c++;for(;0<o-c;)S=Bi(S),o--;for(;0<c-o;)l=Bi(l),c--;for(;o--;){if(S===l||l!==null&&S===l.alternate)break t;S=Bi(S),l=Bi(l)}S=null}else S=null;w!==null&&yu(f,m,w,S,!1),k!==null&&u!==null&&yu(f,u,k,S,!0)}}e:{if(m=d?Ui(d):window,w=m.nodeName&&m.nodeName.toLowerCase(),w==="select"||w==="input"&&m.type==="file")var g=Tp;else if(hu(m))if(_d)g=Pp;else{g=Ap;var C=Dp}else(w=m.nodeName)&&w.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(g=Mp);if(g&&(g=g(e,d))){fd(f,g,r,y);break e}C&&C(e,m,d),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&Ia(m,"number",m.value)}switch(C=d?Ui(d):window,e){case"focusin":(hu(C)||C.contentEditable==="true")&&(Fi=C,qa=d,Ps=null);break;case"focusout":Ps=qa=Fi=null;break;case"mousedown":Xa=!0;break;case"contextmenu":case"mouseup":case"dragend":Xa=!1,vu(f,r,y);break;case"selectionchange":if(Ip)break;case"keydown":case"keyup":vu(f,r,y)}var x;if(Kl)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 ji?hd(e,r)&&(v="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(v="onCompositionStart");v&&(ud&&r.locale!=="ko"&&(ji||v!=="onCompositionStart"?v==="onCompositionEnd"&&ji&&(x=cd()):(Nr=y,Wl="value"in Nr?Nr.value:Nr.textContent,ji=!0)),C=ro(d,v),0<C.length&&(v=new au(v,e,null,r,y),f.push({event:v,listeners:C}),x?v.data=x:(x=dd(r),x!==null&&(v.data=x)))),(x=bp?xp(e,r):Ep(e,r))&&(d=ro(d,"onBeforeInput"),0<d.length&&(y=new au("onBeforeInput","beforeinput",null,r,y),f.push({event:y,listeners:d}),y.data=x))}bd(f,t)})}function Zs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ro(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=Fs(e,r),a!=null&&i.unshift(Zs(e,a,s)),a=Fs(e,t),a!=null&&i.push(Zs(e,a,s))),e=e.return}return i}function Bi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yu(e,t,r,i,s){for(var a=t._reactName,_=[];r!==null&&r!==i;){var n=r,h=n.alternate,d=n.stateNode;if(h!==null&&h===i)break;n.tag===5&&d!==null&&(n=d,s?(h=Fs(r,a),h!=null&&_.unshift(Zs(r,h,n))):s||(h=Fs(r,a),h!=null&&_.push(Zs(r,h,n)))),r=r.return}_.length!==0&&e.push({event:t,listeners:_})}var Fp=/\r\n?/g,zp=/\u0000|\uFFFD/g;function Su(e){return(typeof e=="string"?e:""+e).replace(Fp,`
|
|
38
|
-
`).replace(zp,"")}function Dn(e,t,r){if(t=Su(t),Su(e)!==t&&r)throw Error(X(425))}function io(){}var Ya=null,Ga=null;function Qa(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 Ja=typeof setTimeout=="function"?setTimeout:void 0,Up=typeof clearTimeout=="function"?clearTimeout:void 0,wu=typeof Promise=="function"?Promise:void 0,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof wu<"u"?function(e){return wu.resolve(null).then(e).catch($p)}:Ja;function $p(e){setTimeout(function(){throw e})}function ma(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),Ws(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);Ws(t)}function $r(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 Cu(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 ds=Math.random().toString(36).slice(2),nr="__reactFiber$"+ds,qs="__reactProps$"+ds,yr="__reactContainer$"+ds,el="__reactEvents$"+ds,Vp="__reactListeners$"+ds,Kp="__reactHandles$"+ds;function ui(e){var t=e[nr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[yr]||r[nr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Cu(e);e!==null;){if(r=e[nr])return r;e=Cu(e)}return t}e=r,r=e.parentNode}return null}function an(e){return e=e[nr]||e[yr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ui(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function Oo(e){return e[qs]||null}var tl=[],Wi=-1;function ei(e){return{current:e}}function Me(e){0>Wi||(e.current=tl[Wi],tl[Wi]=null,Wi--)}function De(e,t){Wi++,tl[Wi]=e.current,e.current=t}var Yr={},lt=ei(Yr),wt=ei(!1),pi=Yr;function rs(e,t){var r=e.type.contextTypes;if(!r)return Yr;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 Ct(e){return e=e.childContextTypes,e!=null}function so(){Me(wt),Me(lt)}function ku(e,t,r){if(lt.current!==Yr)throw Error(X(168));De(lt,t),De(wt,r)}function Ed(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(X(108,D_(e)||"Unknown",s));return je({},r,i)}function no(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yr,pi=lt.current,De(lt,e),De(wt,wt.current),!0}function bu(e,t,r){var i=e.stateNode;if(!i)throw Error(X(169));r?(e=Ed(e,t,pi),i.__reactInternalMemoizedMergedChildContext=e,Me(wt),Me(lt),De(lt,e)):Me(wt),De(wt,r)}var fr=null,Bo=!1,ga=!1;function Ld(e){fr===null?fr=[e]:fr.push(e)}function Zp(e){Bo=!0,Ld(e)}function ti(){if(!ga&&fr!==null){ga=!0;var e=0,t=Te;try{var r=fr;for(Te=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}fr=null,Bo=!1}catch(s){throw fr!==null&&(fr=fr.slice(e+1)),Qh(jl,ti),s}finally{Te=t,ga=!1}}return null}var $i=[],Vi=0,oo=null,ao=0,It=[],Nt=0,vi=null,_r=1,pr="";function li(e,t){$i[Vi++]=ao,$i[Vi++]=oo,oo=e,ao=t}function Rd(e,t,r){It[Nt++]=_r,It[Nt++]=pr,It[Nt++]=vi,vi=e;var i=_r;e=pr;var s=32-Yt(i)-1;i&=~(1<<s),r+=1;var a=32-Yt(t)+s;if(30<a){var _=s-s%5;a=(i&(1<<_)-1).toString(32),i>>=_,s-=_,_r=1<<32-Yt(t)+s|r<<s|i,pr=a+e}else _r=1<<a|r<<s|i,pr=e}function ql(e){e.return!==null&&(li(e,1),Rd(e,1,0))}function Xl(e){for(;e===oo;)oo=$i[--Vi],$i[Vi]=null,ao=$i[--Vi],$i[Vi]=null;for(;e===vi;)vi=It[--Nt],It[Nt]=null,pr=It[--Nt],It[Nt]=null,_r=It[--Nt],It[Nt]=null}var Rt=null,Lt=null,Pe=!1,Xt=null;function Td(e,t){var r=Ht(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 xu(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,Rt=e,Lt=$r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rt=e,Lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=vi!==null?{id:_r,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ht(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Rt=e,Lt=null,!0):!1;default:return!1}}function rl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function il(e){if(Pe){var t=Lt;if(t){var r=t;if(!xu(e,t)){if(rl(e))throw Error(X(418));t=$r(r.nextSibling);var i=Rt;t&&xu(e,t)?Td(i,r):(e.flags=e.flags&-4097|2,Pe=!1,Rt=e)}}else{if(rl(e))throw Error(X(418));e.flags=e.flags&-4097|2,Pe=!1,Rt=e}}}function Eu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rt=e}function An(e){if(e!==Rt)return!1;if(!Pe)return Eu(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qa(e.type,e.memoizedProps)),t&&(t=Lt)){if(rl(e))throw Dd(),Error(X(418));for(;t;)Td(e,t),t=$r(t.nextSibling)}if(Eu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Lt=$r(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Lt=null}}else Lt=Rt?$r(e.stateNode.nextSibling):null;return!0}function Dd(){for(var e=Lt;e;)e=$r(e.nextSibling)}function is(){Lt=Rt=null,Pe=!1}function Yl(e){Xt===null?Xt=[e]:Xt.push(e)}var qp=kr.ReactCurrentBatchConfig;function ws(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(X(309));var i=r.stateNode}if(!i)throw Error(X(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(X(284));if(!r._owner)throw Error(X(290,e))}return e}function Mn(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Lu(e){var t=e._init;return t(e._payload)}function Ad(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=qr(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=xa(c,l.mode,p),o.return=l,o):(o=s(o,c),o.return=l,o)}function h(l,o,c,p){var g=c.type;return g===Hi?y(l,o,c.props.children,p,c.key):o!==null&&(o.elementType===g||typeof g=="object"&&g!==null&&g.$$typeof===Ar&&Lu(g)===o.type)?(p=s(o,c.props),p.ref=ws(l,o,c),p.return=l,p):(p=qn(c.type,c.key,c.props,null,l.mode,p),p.ref=ws(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=Ea(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=_i(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=xa(""+o,l.mode,c),o.return=l,o;if(typeof o=="object"&&o!==null){switch(o.$$typeof){case wn:return c=qn(o.type,o.key,o.props,null,l.mode,c),c.ref=ws(l,null,o),c.return=l,c;case Ni:return o=Ea(o,l.mode,c),o.return=l,o;case Ar:var p=o._init;return f(l,p(o._payload),c)}if(xs(o)||vs(o))return o=_i(o,l.mode,c,null),o.return=l,o;Mn(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 wn:return c.key===g?h(l,o,c,p):null;case Ni:return c.key===g?d(l,o,c,p):null;case Ar:return g=c._init,m(l,o,g(c._payload),p)}if(xs(c)||vs(c))return g!==null?null:y(l,o,c,p,null);Mn(l,c)}return null}function w(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 wn:return l=l.get(p.key===null?c:p.key)||null,h(o,l,p,g);case Ni:return l=l.get(p.key===null?c:p.key)||null,d(o,l,p,g);case Ar:var C=p._init;return w(l,o,c,C(p._payload),g)}if(xs(p)||vs(p))return l=l.get(c)||null,y(o,l,p,g,null);Mn(o,p)}return null}function k(l,o,c,p){for(var g=null,C=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),C===null?g=R:C.sibling=R,C=R,x=b}if(v===c.length)return r(l,x),Pe&&li(l,v),g;if(x===null){for(;v<c.length;v++)x=f(l,c[v],p),x!==null&&(o=a(x,o,v),C===null?g=x:C.sibling=x,C=x);return Pe&&li(l,v),g}for(x=i(l,x);v<c.length;v++)b=w(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),C===null?g=b:C.sibling=b,C=b);return e&&x.forEach(function(P){return t(l,P)}),Pe&&li(l,v),g}function S(l,o,c,p){var g=vs(c);if(typeof g!="function")throw Error(X(150));if(c=g.call(c),c==null)throw Error(X(151));for(var C=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 P=m(l,x,R.value,p);if(P===null){x===null&&(x=b);break}e&&x&&P.alternate===null&&t(l,x),o=a(P,o,v),C===null?g=P:C.sibling=P,C=P,x=b}if(R.done)return r(l,x),Pe&&li(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),C===null?g=R:C.sibling=R,C=R);return Pe&&li(l,v),g}for(x=i(l,x);!R.done;v++,R=c.next())R=w(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),C===null?g=R:C.sibling=R,C=R);return e&&x.forEach(function(A){return t(l,A)}),Pe&&li(l,v),g}function u(l,o,c,p){if(typeof c=="object"&&c!==null&&c.type===Hi&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case wn:e:{for(var g=c.key,C=o;C!==null;){if(C.key===g){if(g=c.type,g===Hi){if(C.tag===7){r(l,C.sibling),o=s(C,c.props.children),o.return=l,l=o;break e}}else if(C.elementType===g||typeof g=="object"&&g!==null&&g.$$typeof===Ar&&Lu(g)===C.type){r(l,C.sibling),o=s(C,c.props),o.ref=ws(l,C,c),o.return=l,l=o;break e}r(l,C);break}else t(l,C);C=C.sibling}c.type===Hi?(o=_i(c.props.children,l.mode,p,c.key),o.return=l,l=o):(p=qn(c.type,c.key,c.props,null,l.mode,p),p.ref=ws(l,o,c),p.return=l,l=p)}return _(l);case Ni:e:{for(C=c.key;o!==null;){if(o.key===C)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=Ea(c,l.mode,p),o.return=l,l=o}return _(l);case Ar:return C=c._init,u(l,o,C(c._payload),p)}if(xs(c))return k(l,o,c,p);if(vs(c))return S(l,o,c,p);Mn(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=xa(c,l.mode,p),o.return=l,l=o),_(l)):r(l,o)}return u}var ss=Ad(!0),Md=Ad(!1),lo=ei(null),co=null,Ki=null,Gl=null;function Ql(){Gl=Ki=co=null}function Jl(e){var t=lo.current;Me(lo),e._currentValue=t}function sl(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 Ji(e,t){co=e,Gl=Ki=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(St=!0),e.firstContext=null)}function Ft(e){var t=e._currentValue;if(Gl!==e)if(e={context:e,memoizedValue:t,next:null},Ki===null){if(co===null)throw Error(X(308));Ki=e,co.dependencies={lanes:0,firstContext:e}}else Ki=Ki.next=e;return t}var hi=null;function ec(e){hi===null?hi=[e]:hi.push(e)}function Pd(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,ec(t)):(r.next=s.next,s.next=r),t.interleaved=r,Sr(e,i)}function Sr(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 Mr=!1;function tc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Od(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 vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ke&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,Sr(e,r)}return s=i.interleaved,s===null?(t.next=t,ec(i)):(t.next=s.next,s.next=t),i.interleaved=t,Sr(e,r)}function Un(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,Fl(e,r)}}function Ru(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 uo(e,t,r,i){var s=e.updateQueue;Mr=!1;var a=s.firstBaseUpdate,_=s.lastBaseUpdate,n=s.shared.pending;if(n!==null){s.shared.pending=null;var h=n,d=h.next;h.next=null,_===null?a=d:_.next=d,_=h;var y=e.alternate;y!==null&&(y=y.updateQueue,n=y.lastBaseUpdate,n!==_&&(n===null?y.firstBaseUpdate=d:n.next=d,y.lastBaseUpdate=h))}if(a!==null){var f=s.baseState;_=0,y=d=h=null,n=a;do{var m=n.lane,w=n.eventTime;if((i&m)===m){y!==null&&(y=y.next={eventTime:w,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var k=e,S=n;switch(m=t,w=r,S.tag){case 1:if(k=S.payload,typeof k=="function"){f=k.call(w,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(w,f,m):k,m==null)break e;f=je({},f,m);break e;case 2:Mr=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[n]:m.push(n))}else w={eventTime:w,lane:m,tag:n.tag,payload:n.payload,callback:n.callback,next:null},y===null?(d=y=w,h=f):y=y.next=w,_|=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&&(h=f),s.baseState=h,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);gi|=_,e.lanes=_,e.memoizedState=f}}function Tu(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(X(191,s));s.call(i)}}}var ln={},ar=ei(ln),Xs=ei(ln),Ys=ei(ln);function di(e){if(e===ln)throw Error(X(174));return e}function rc(e,t){switch(De(Ys,t),De(Xs,e),De(ar,ln),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ha(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ha(t,e)}Me(ar),De(ar,t)}function ns(){Me(ar),Me(Xs),Me(Ys)}function Bd(e){di(Ys.current);var t=di(ar.current),r=Ha(t,e.type);t!==r&&(De(Xs,e),De(ar,r))}function ic(e){Xs.current===e&&(Me(ar),Me(Xs))}var Ne=ei(0);function ho(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 ya=[];function sc(){for(var e=0;e<ya.length;e++)ya[e]._workInProgressVersionPrimary=null;ya.length=0}var Wn=kr.ReactCurrentDispatcher,Sa=kr.ReactCurrentBatchConfig,mi=0,He=null,Xe=null,Ge=null,fo=!1,Os=!1,Gs=0,Xp=0;function nt(){throw Error(X(321))}function nc(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Qt(e[r],t[r]))return!1;return!0}function oc(e,t,r,i,s,a){if(mi=a,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wn.current=e===null||e.memoizedState===null?Jp:ev,e=r(i,s),Os){a=0;do{if(Os=!1,Gs=0,25<=a)throw Error(X(301));a+=1,Ge=Xe=null,t.updateQueue=null,Wn.current=tv,e=r(i,s)}while(Os)}if(Wn.current=_o,t=Xe!==null&&Xe.next!==null,mi=0,Ge=Xe=He=null,fo=!1,t)throw Error(X(300));return e}function ac(){var e=Gs!==0;return Gs=0,e}function sr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function zt(){if(Xe===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=Ge===null?He.memoizedState:Ge.next;if(t!==null)Ge=t,Xe=e;else{if(e===null)throw Error(X(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function Qs(e,t){return typeof t=="function"?t(e):t}function wa(e){var t=zt(),r=t.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=e;var i=Xe,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,h=null,d=a;do{var y=d.lane;if((mi&y)===y)h!==null&&(h=h.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};h===null?(n=h=f,_=i):h=h.next=f,He.lanes|=y,gi|=y}d=d.next}while(d!==null&&d!==a);h===null?_=i:h.next=n,Qt(i,t.memoizedState)||(St=!0),t.memoizedState=i,t.baseState=_,t.baseQueue=h,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do a=s.lane,He.lanes|=a,gi|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ca(e){var t=zt(),r=t.queue;if(r===null)throw Error(X(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);Qt(a,t.memoizedState)||(St=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,i]}function Id(){}function Nd(e,t){var r=He,i=zt(),s=t(),a=!Qt(i.memoizedState,s);if(a&&(i.memoizedState=s,St=!0),i=i.queue,lc(Fd.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||Ge!==null&&Ge.memoizedState.tag&1){if(r.flags|=2048,Js(9,jd.bind(null,r,i,s,t),void 0,null),Qe===null)throw Error(X(349));mi&30||Hd(r,t,s)}return s}function Hd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function jd(e,t,r,i){t.value=r,t.getSnapshot=i,zd(t)&&Ud(e)}function Fd(e,t,r){return r(function(){zd(t)&&Ud(e)})}function zd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Qt(e,r)}catch{return!0}}function Ud(e){var t=Sr(e,1);t!==null&&Gt(t,e,1,-1)}function Du(e){var t=sr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qs,lastRenderedState:e},t.queue=e,e=e.dispatch=Qp.bind(null,He,e),[t.memoizedState,e]}function Js(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.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 Wd(){return zt().memoizedState}function $n(e,t,r,i){var s=sr();He.flags|=e,s.memoizedState=Js(1|t,r,void 0,i===void 0?null:i)}function Io(e,t,r,i){var s=zt();i=i===void 0?null:i;var a=void 0;if(Xe!==null){var _=Xe.memoizedState;if(a=_.destroy,i!==null&&nc(i,_.deps)){s.memoizedState=Js(t,r,a,i);return}}He.flags|=e,s.memoizedState=Js(1|t,r,a,i)}function Au(e,t){return $n(8390656,8,e,t)}function lc(e,t){return Io(2048,8,e,t)}function $d(e,t){return Io(4,2,e,t)}function Vd(e,t){return Io(4,4,e,t)}function Kd(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 Zd(e,t,r){return r=r!=null?r.concat([e]):null,Io(4,4,Kd.bind(null,t,e),r)}function cc(){}function qd(e,t){var r=zt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&nc(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Xd(e,t){var r=zt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&nc(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Yd(e,t,r){return mi&21?(Qt(r,t)||(r=td(),He.lanes|=r,gi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,St=!0),e.memoizedState=r)}function Yp(e,t){var r=Te;Te=r!==0&&4>r?r:4,e(!0);var i=Sa.transition;Sa.transition={};try{e(!1),t()}finally{Te=r,Sa.transition=i}}function Gd(){return zt().memoizedState}function Gp(e,t,r){var i=Zr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Qd(e))Jd(t,r);else if(r=Pd(e,t,r,i),r!==null){var s=ht();Gt(r,e,i,s),ef(r,t,i)}}function Qp(e,t,r){var i=Zr(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Qd(e))Jd(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,Qt(n,_)){var h=t.interleaved;h===null?(s.next=s,ec(t)):(s.next=h.next,h.next=s),t.interleaved=s;return}}catch{}finally{}r=Pd(e,t,s,i),r!==null&&(s=ht(),Gt(r,e,i,s),ef(r,t,i))}}function Qd(e){var t=e.alternate;return e===He||t!==null&&t===He}function Jd(e,t){Os=fo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ef(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Fl(e,r)}}var _o={readContext:Ft,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},Jp={readContext:Ft,useCallback:function(e,t){return sr().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:Au,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,$n(4194308,4,Kd.bind(null,t,e),r)},useLayoutEffect:function(e,t){return $n(4194308,4,e,t)},useInsertionEffect:function(e,t){return $n(4,2,e,t)},useMemo:function(e,t){var r=sr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=sr();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=Gp.bind(null,He,e),[i.memoizedState,e]},useRef:function(e){var t=sr();return e={current:e},t.memoizedState=e},useState:Du,useDebugValue:cc,useDeferredValue:function(e){return sr().memoizedState=e},useTransition:function(){var e=Du(!1),t=e[0];return e=Yp.bind(null,e[1]),sr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=He,s=sr();if(Pe){if(r===void 0)throw Error(X(407));r=r()}else{if(r=t(),Qe===null)throw Error(X(349));mi&30||Hd(i,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,Au(Fd.bind(null,i,a,e),[e]),i.flags|=2048,Js(9,jd.bind(null,i,a,r,t),void 0,null),r},useId:function(){var e=sr(),t=Qe.identifierPrefix;if(Pe){var r=pr,i=_r;r=(i&~(1<<32-Yt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Gs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Xp++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ev={readContext:Ft,useCallback:qd,useContext:Ft,useEffect:lc,useImperativeHandle:Zd,useInsertionEffect:$d,useLayoutEffect:Vd,useMemo:Xd,useReducer:wa,useRef:Wd,useState:function(){return wa(Qs)},useDebugValue:cc,useDeferredValue:function(e){var t=zt();return Yd(t,Xe.memoizedState,e)},useTransition:function(){var e=wa(Qs)[0],t=zt().memoizedState;return[e,t]},useMutableSource:Id,useSyncExternalStore:Nd,useId:Gd,unstable_isNewReconciler:!1},tv={readContext:Ft,useCallback:qd,useContext:Ft,useEffect:lc,useImperativeHandle:Zd,useInsertionEffect:$d,useLayoutEffect:Vd,useMemo:Xd,useReducer:Ca,useRef:Wd,useState:function(){return Ca(Qs)},useDebugValue:cc,useDeferredValue:function(e){var t=zt();return Xe===null?t.memoizedState=e:Yd(t,Xe.memoizedState,e)},useTransition:function(){var e=Ca(Qs)[0],t=zt().memoizedState;return[e,t]},useMutableSource:Id,useSyncExternalStore:Nd,useId:Gd,unstable_isNewReconciler:!1};function Zt(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function nl(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:je({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var No={isMounted:function(e){return(e=e._reactInternals)?xi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=ht(),s=Zr(e),a=vr(i,s);a.payload=t,r!=null&&(a.callback=r),t=Vr(e,a,s),t!==null&&(Gt(t,e,s,i),Un(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=ht(),s=Zr(e),a=vr(i,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Vr(e,a,s),t!==null&&(Gt(t,e,s,i),Un(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ht(),i=Zr(e),s=vr(r,i);s.tag=2,t!=null&&(s.callback=t),t=Vr(e,s,i),t!==null&&(Gt(t,e,i,r),Un(t,e,i))}};function Mu(e,t,r,i,s,a,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,a,_):t.prototype&&t.prototype.isPureReactComponent?!Vs(r,i)||!Vs(s,a):!0}function tf(e,t,r){var i=!1,s=Yr,a=t.contextType;return typeof a=="object"&&a!==null?a=Ft(a):(s=Ct(t)?pi:lt.current,i=t.contextTypes,a=(i=i!=null)?rs(e,s):Yr),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=No,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function Pu(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&&No.enqueueReplaceState(t,t.state,null)}function ol(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},tc(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=Ft(a):(a=Ct(t)?pi:lt.current,s.context=rs(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(nl(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&&No.enqueueReplaceState(s,s.state,null),uo(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var r="",i=t;do r+=T_(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 ka(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function al(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var rv=typeof WeakMap=="function"?WeakMap:Map;function rf(e,t,r){r=vr(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){vo||(vo=!0,ml=i),al(e,t)},r}function sf(e,t,r){r=vr(-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(){al(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){al(e,t),typeof i!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),r}function Ou(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new rv;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=vv.bind(null,e,t,r),t.then(e,e))}function Bu(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 Iu(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=vr(-1,1),t.tag=2,Vr(r,t,1))),r.lanes|=1),e)}var iv=kr.ReactCurrentOwner,St=!1;function ut(e,t,r,i){t.child=e===null?Md(t,null,r,i):ss(t,e.child,r,i)}function Nu(e,t,r,i,s){r=r.render;var a=t.ref;return Ji(t,s),i=oc(e,t,r,i,a,s),r=ac(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,wr(e,t,s)):(Pe&&r&&ql(t),t.flags|=1,ut(e,t,i,s),t.child)}function Hu(e,t,r,i,s){if(e===null){var a=r.type;return typeof a=="function"&&!mc(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,nf(e,t,a,i,s)):(e=qn(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:Vs,r(_,i)&&e.ref===t.ref)return wr(e,t,s)}return t.flags|=1,e=qr(a,i),e.ref=t.ref,e.return=t,t.child=e}function nf(e,t,r,i,s){if(e!==null){var a=e.memoizedProps;if(Vs(a,i)&&e.ref===t.ref)if(St=!1,t.pendingProps=i=a,(e.lanes&s)!==0)e.flags&131072&&(St=!0);else return t.lanes=e.lanes,wr(e,t,s)}return ll(e,t,r,i,s)}function of(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},De(qi,Et),Et|=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,De(qi,Et),Et|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=a!==null?a.baseLanes:r,De(qi,Et),Et|=i}else a!==null?(i=a.baseLanes|r,t.memoizedState=null):i=r,De(qi,Et),Et|=i;return ut(e,t,s,r),t.child}function af(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ll(e,t,r,i,s){var a=Ct(r)?pi:lt.current;return a=rs(t,a),Ji(t,s),r=oc(e,t,r,i,a,s),i=ac(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,wr(e,t,s)):(Pe&&i&&ql(t),t.flags|=1,ut(e,t,r,s),t.child)}function ju(e,t,r,i,s){if(Ct(r)){var a=!0;no(t)}else a=!1;if(Ji(t,s),t.stateNode===null)Vn(e,t),tf(t,r,i),ol(t,r,i,s),i=!0;else if(e===null){var _=t.stateNode,n=t.memoizedProps;_.props=n;var h=_.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ft(d):(d=Ct(r)?pi:lt.current,d=rs(t,d));var y=r.getDerivedStateFromProps,f=typeof y=="function"||typeof _.getSnapshotBeforeUpdate=="function";f||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(n!==i||h!==d)&&Pu(t,_,i,d),Mr=!1;var m=t.memoizedState;_.state=m,uo(t,i,_,s),h=t.memoizedState,n!==i||m!==h||wt.current||Mr?(typeof y=="function"&&(nl(t,r,y,i),h=t.memoizedState),(n=Mr||Mu(t,r,n,i,m,h,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=h),_.props=i,_.state=h,_.context=d,i=n):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{_=t.stateNode,Od(e,t),n=t.memoizedProps,d=t.type===t.elementType?n:Zt(t.type,n),_.props=d,f=t.pendingProps,m=_.context,h=r.contextType,typeof h=="object"&&h!==null?h=Ft(h):(h=Ct(r)?pi:lt.current,h=rs(t,h));var w=r.getDerivedStateFromProps;(y=typeof w=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(n!==f||m!==h)&&Pu(t,_,i,h),Mr=!1,m=t.memoizedState,_.state=m,uo(t,i,_,s);var k=t.memoizedState;n!==f||m!==k||wt.current||Mr?(typeof w=="function"&&(nl(t,r,w,i),k=t.memoizedState),(d=Mr||Mu(t,r,d,i,m,k,h)||!1)?(y||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(i,k,h),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(i,k,h)),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=h,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 cl(e,t,r,i,a,s)}function cl(e,t,r,i,s,a){af(e,t);var _=(t.flags&128)!==0;if(!i&&!_)return s&&bu(t,r,!1),wr(e,t,a);i=t.stateNode,iv.current=t;var n=_&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&_?(t.child=ss(t,e.child,null,a),t.child=ss(t,null,n,a)):ut(e,t,n,a),t.memoizedState=i.state,s&&bu(t,r,!0),t.child}function lf(e){var t=e.stateNode;t.pendingContext?ku(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ku(e,t.context,!1),rc(e,t.containerInfo)}function Fu(e,t,r,i,s){return is(),Yl(s),t.flags|=256,ut(e,t,r,i),t.child}var ul={dehydrated:null,treeContext:null,retryLane:0};function hl(e){return{baseLanes:e,cachePool:null,transitions:null}}function cf(e,t,r){var i=t.pendingProps,s=Ne.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),De(Ne,s&1),e===null)return il(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=Fo(_,i,0,null),e=_i(e,i,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=hl(r),t.memoizedState=ul,e):uc(t,_));if(s=e.memoizedState,s!==null&&(n=s.dehydrated,n!==null))return sv(e,t,_,i,n,s,r);if(a){a=i.fallback,_=t.mode,s=e.child,n=s.sibling;var h={mode:"hidden",children:i.children};return!(_&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=h,t.deletions=null):(i=qr(s,h),i.subtreeFlags=s.subtreeFlags&14680064),n!==null?a=qr(n,a):(a=_i(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?hl(r):{baseLanes:_.baseLanes|r,cachePool:null,transitions:_.transitions},a.memoizedState=_,a.childLanes=e.childLanes&~r,t.memoizedState=ul,i}return a=e.child,e=a.sibling,i=qr(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 uc(e,t){return t=Fo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pn(e,t,r,i){return i!==null&&Yl(i),ss(t,e.child,null,r),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sv(e,t,r,i,s,a,_){if(r)return t.flags&256?(t.flags&=-257,i=ka(Error(X(422))),Pn(e,t,_,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=i.fallback,s=t.mode,i=Fo({mode:"visible",children:i.children},s,0,null),a=_i(a,s,_,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,t.mode&1&&ss(t,e.child,null,_),t.child.memoizedState=hl(_),t.memoizedState=ul,a);if(!(t.mode&1))return Pn(e,t,_,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var n=i.dgst;return i=n,a=Error(X(419)),i=ka(a,i,void 0),Pn(e,t,_,i)}if(n=(_&e.childLanes)!==0,St||n){if(i=Qe,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,Sr(e,s),Gt(i,e,s,-1))}return vc(),i=ka(Error(X(421))),Pn(e,t,_,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=mv.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,Lt=$r(s.nextSibling),Rt=t,Pe=!0,Xt=null,e!==null&&(It[Nt++]=_r,It[Nt++]=pr,It[Nt++]=vi,_r=e.id,pr=e.overflow,vi=t),t=uc(t,i.children),t.flags|=4096,t)}function zu(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),sl(e.return,t,r)}function ba(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 uf(e,t,r){var i=t.pendingProps,s=i.revealOrder,a=i.tail;if(ut(e,t,i.children,r),i=Ne.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&&zu(e,r,t);else if(e.tag===19)zu(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(De(Ne,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&&ho(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),ba(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&&ho(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}ba(t,!0,r,null,a);break;case"together":ba(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vn(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),gi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,r=qr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=qr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function nv(e,t,r){switch(t.tag){case 3:lf(t),is();break;case 5:Bd(t);break;case 1:Ct(t.type)&&no(t);break;case 4:rc(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;De(lo,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(De(Ne,Ne.current&1),t.flags|=128,null):r&t.child.childLanes?cf(e,t,r):(De(Ne,Ne.current&1),e=wr(e,t,r),e!==null?e.sibling:null);De(Ne,Ne.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return uf(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),De(Ne,Ne.current),i)break;return null;case 22:case 23:return t.lanes=0,of(e,t,r)}return wr(e,t,r)}var hf,dl,df,ff;hf=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}};dl=function(){};df=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,di(ar.current);var a=null;switch(r){case"input":s=Oa(e,s),i=Oa(e,i),a=[];break;case"select":s=je({},s,{value:void 0}),i=je({},i,{value:void 0}),a=[];break;case"textarea":s=Na(e,s),i=Na(e,i),a=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=io)}ja(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"&&(Hs.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in i){var h=i[d];if(n=s!=null?s[d]:void 0,i.hasOwnProperty(d)&&h!==n&&(h!=null||n!=null))if(d==="style")if(n){for(_ in n)!n.hasOwnProperty(_)||h&&h.hasOwnProperty(_)||(r||(r={}),r[_]="");for(_ in h)h.hasOwnProperty(_)&&n[_]!==h[_]&&(r||(r={}),r[_]=h[_])}else r||(a||(a=[]),a.push(d,r)),r=h;else d==="dangerouslySetInnerHTML"?(h=h?h.__html:void 0,n=n?n.__html:void 0,h!=null&&n!==h&&(a=a||[]).push(d,h)):d==="children"?typeof h!="string"&&typeof h!="number"||(a=a||[]).push(d,""+h):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Hs.hasOwnProperty(d)?(h!=null&&d==="onScroll"&&Ae("scroll",e),a||n===h||(a=[])):(a=a||[]).push(d,h))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};ff=function(e,t,r,i){r!==i&&(t.flags|=4)};function Cs(e,t){if(!Pe)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 ot(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 ov(e,t,r){var i=t.pendingProps;switch(Xl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return Ct(t.type)&&so(),ot(t),null;case 3:return i=t.stateNode,ns(),Me(wt),Me(lt),sc(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(An(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xt!==null&&(Sl(Xt),Xt=null))),dl(e,t),ot(t),null;case 5:ic(t);var s=di(Ys.current);if(r=t.type,e!==null&&t.stateNode!=null)df(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(X(166));return ot(t),null}if(e=di(ar.current),An(t)){i=t.stateNode,r=t.type;var a=t.memoizedProps;switch(i[nr]=t,i[qs]=a,e=(t.mode&1)!==0,r){case"dialog":Ae("cancel",i),Ae("close",i);break;case"iframe":case"object":case"embed":Ae("load",i);break;case"video":case"audio":for(s=0;s<Ls.length;s++)Ae(Ls[s],i);break;case"source":Ae("error",i);break;case"img":case"image":case"link":Ae("error",i),Ae("load",i);break;case"details":Ae("toggle",i);break;case"input":Yc(i,a),Ae("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},Ae("invalid",i);break;case"textarea":Qc(i,a),Ae("invalid",i)}ja(r,a),s=null;for(var _ in a)if(a.hasOwnProperty(_)){var n=a[_];_==="children"?typeof n=="string"?i.textContent!==n&&(a.suppressHydrationWarning!==!0&&Dn(i.textContent,n,e),s=["children",n]):typeof n=="number"&&i.textContent!==""+n&&(a.suppressHydrationWarning!==!0&&Dn(i.textContent,n,e),s=["children",""+n]):Hs.hasOwnProperty(_)&&n!=null&&_==="onScroll"&&Ae("scroll",i)}switch(r){case"input":Cn(i),Gc(i,a,!0);break;case"textarea":Cn(i),Jc(i);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(i.onclick=io)}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=Fh(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[nr]=t,e[qs]=i,hf(e,t,!1,!1),t.stateNode=e;e:{switch(_=Fa(r,i),r){case"dialog":Ae("cancel",e),Ae("close",e),s=i;break;case"iframe":case"object":case"embed":Ae("load",e),s=i;break;case"video":case"audio":for(s=0;s<Ls.length;s++)Ae(Ls[s],e);s=i;break;case"source":Ae("error",e),s=i;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),s=i;break;case"details":Ae("toggle",e),s=i;break;case"input":Yc(e,i),s=Oa(e,i),Ae("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=je({},i,{value:void 0}),Ae("invalid",e);break;case"textarea":Qc(e,i),s=Na(e,i),Ae("invalid",e);break;default:s=i}ja(r,s),n=s;for(a in n)if(n.hasOwnProperty(a)){var h=n[a];a==="style"?Wh(e,h):a==="dangerouslySetInnerHTML"?(h=h?h.__html:void 0,h!=null&&zh(e,h)):a==="children"?typeof h=="string"?(r!=="textarea"||h!=="")&&js(e,h):typeof h=="number"&&js(e,""+h):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Hs.hasOwnProperty(a)?h!=null&&a==="onScroll"&&Ae("scroll",e):h!=null&&Ol(e,a,h,_))}switch(r){case"input":Cn(e),Gc(e,i,!1);break;case"textarea":Cn(e),Jc(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Xr(i.value));break;case"select":e.multiple=!!i.multiple,a=i.value,a!=null?Xi(e,!!i.multiple,a,!1):i.defaultValue!=null&&Xi(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=io)}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 ot(t),null;case 6:if(e&&t.stateNode!=null)ff(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(X(166));if(r=di(Ys.current),di(ar.current),An(t)){if(i=t.stateNode,r=t.memoizedProps,i[nr]=t,(a=i.nodeValue!==r)&&(e=Rt,e!==null))switch(e.tag){case 3:Dn(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Dn(i.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[nr]=t,t.stateNode=i}return ot(t),null;case 13:if(Me(Ne),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&&Lt!==null&&t.mode&1&&!(t.flags&128))Dd(),is(),t.flags|=98560,a=!1;else if(a=An(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(X(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(X(317));a[nr]=t}else is(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),a=!1}else Xt!==null&&(Sl(Xt),Xt=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||Ne.current&1?Ye===0&&(Ye=3):vc())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return ns(),dl(e,t),e===null&&Ks(t.stateNode.containerInfo),ot(t),null;case 10:return Jl(t.type._context),ot(t),null;case 17:return Ct(t.type)&&so(),ot(t),null;case 19:if(Me(Ne),a=t.memoizedState,a===null)return ot(t),null;if(i=(t.flags&128)!==0,_=a.rendering,_===null)if(i)Cs(a,!1);else{if(Ye!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(_=ho(e),_!==null){for(t.flags|=128,Cs(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 De(Ne,Ne.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ue()>as&&(t.flags|=128,i=!0,Cs(a,!1),t.lanes=4194304)}else{if(!i)if(e=ho(_),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Cs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!_.alternate&&!Pe)return ot(t),null}else 2*Ue()-a.renderingStartTime>as&&r!==1073741824&&(t.flags|=128,i=!0,Cs(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=Ue(),t.sibling=null,r=Ne.current,De(Ne,i?r&1|2:r&1),t):(ot(t),null);case 22:case 23:return pc(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Et&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function av(e,t){switch(Xl(t),t.tag){case 1:return Ct(t.type)&&so(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),Me(wt),Me(lt),sc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ic(t),null;case 13:if(Me(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(Ne),null;case 4:return ns(),null;case 10:return Jl(t.type._context),null;case 22:case 23:return pc(),null;case 24:return null;default:return null}}var On=!1,at=!1,lv=typeof WeakSet=="function"?WeakSet:Set,re=null;function Zi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Fe(e,t,i)}else r.current=null}function fl(e,t,r){try{r()}catch(i){Fe(e,t,i)}}var Uu=!1;function cv(e,t){if(Ya=eo,e=md(),Zl(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,h=-1,d=0,y=0,f=e,m=null;t:for(;;){for(var w;f!==r||s!==0&&f.nodeType!==3||(n=_+s),f!==a||i!==0&&f.nodeType!==3||(h=_+i),f.nodeType===3&&(_+=f.nodeValue.length),(w=f.firstChild)!==null;)m=f,f=w;for(;;){if(f===e)break t;if(m===r&&++d===s&&(n=_),m===a&&++y===i&&(h=_),(w=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=w}r=n===-1||h===-1?null:{start:n,end:h}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ga={focusedElem:e,selectionRange:r},eo=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;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,u=k.memoizedState,l=t.stateNode,o=l.getSnapshotBeforeUpdate(t.elementType===t.type?S:Zt(t.type,S),u);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(X(163))}}catch(p){Fe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return k=Uu,Uu=!1,k}function Bs(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&&fl(t,r,a)}s=s.next}while(s!==i)}}function Ho(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 _l(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 _f(e){var t=e.alternate;t!==null&&(e.alternate=null,_f(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nr],delete t[qs],delete t[el],delete t[Vp],delete t[Kp])),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 pf(e){return e.tag===5||e.tag===3||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pf(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 pl(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=io));else if(i!==4&&(e=e.child,e!==null))for(pl(e,t,r),e=e.sibling;e!==null;)pl(e,t,r),e=e.sibling}function vl(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(vl(e,t,r),e=e.sibling;e!==null;)vl(e,t,r),e=e.sibling}var rt=null,qt=!1;function Dr(e,t,r){for(r=r.child;r!==null;)vf(e,t,r),r=r.sibling}function vf(e,t,r){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Do,r)}catch{}switch(r.tag){case 5:at||Zi(r,t);case 6:var i=rt,s=qt;rt=null,Dr(e,t,r),rt=i,qt=s,rt!==null&&(qt?(e=rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):rt.removeChild(r.stateNode));break;case 18:rt!==null&&(qt?(e=rt,r=r.stateNode,e.nodeType===8?ma(e.parentNode,r):e.nodeType===1&&ma(e,r),Ws(e)):ma(rt,r.stateNode));break;case 4:i=rt,s=qt,rt=r.stateNode.containerInfo,qt=!0,Dr(e,t,r),rt=i,qt=s;break;case 0:case 11:case 14:case 15:if(!at&&(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)&&fl(r,t,_),s=s.next}while(s!==i)}Dr(e,t,r);break;case 1:if(!at&&(Zi(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(n){Fe(r,t,n)}Dr(e,t,r);break;case 21:Dr(e,t,r);break;case 22:r.mode&1?(at=(i=at)||r.memoizedState!==null,Dr(e,t,r),at=i):Dr(e,t,r);break;default:Dr(e,t,r)}}function $u(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new lv),t.forEach(function(i){var s=gv.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function Kt(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:rt=n.stateNode,qt=!1;break e;case 3:rt=n.stateNode.containerInfo,qt=!0;break e;case 4:rt=n.stateNode.containerInfo,qt=!0;break e}n=n.return}if(rt===null)throw Error(X(160));vf(a,_,s),rt=null,qt=!1;var h=s.alternate;h!==null&&(h.return=null),s.return=null}catch(d){Fe(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mf(t,e),t=t.sibling}function mf(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kt(t,e),ir(e),i&4){try{Bs(3,e,e.return),Ho(3,e)}catch(S){Fe(e,e.return,S)}try{Bs(5,e,e.return)}catch(S){Fe(e,e.return,S)}}break;case 1:Kt(t,e),ir(e),i&512&&r!==null&&Zi(r,r.return);break;case 5:if(Kt(t,e),ir(e),i&512&&r!==null&&Zi(r,r.return),e.flags&32){var s=e.stateNode;try{js(s,"")}catch(S){Fe(e,e.return,S)}}if(i&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,_=r!==null?r.memoizedProps:a,n=e.type,h=e.updateQueue;if(e.updateQueue=null,h!==null)try{n==="input"&&a.type==="radio"&&a.name!=null&&Hh(s,a),Fa(n,_);var d=Fa(n,a);for(_=0;_<h.length;_+=2){var y=h[_],f=h[_+1];y==="style"?Wh(s,f):y==="dangerouslySetInnerHTML"?zh(s,f):y==="children"?js(s,f):Ol(s,y,f,d)}switch(n){case"input":Ba(s,a);break;case"textarea":jh(s,a);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var w=a.value;w!=null?Xi(s,!!a.multiple,w,!1):m!==!!a.multiple&&(a.defaultValue!=null?Xi(s,!!a.multiple,a.defaultValue,!0):Xi(s,!!a.multiple,a.multiple?[]:"",!1))}s[qs]=a}catch(S){Fe(e,e.return,S)}}break;case 6:if(Kt(t,e),ir(e),i&4){if(e.stateNode===null)throw Error(X(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(S){Fe(e,e.return,S)}}break;case 3:if(Kt(t,e),ir(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ws(t.containerInfo)}catch(S){Fe(e,e.return,S)}break;case 4:Kt(t,e),ir(e);break;case 13:Kt(t,e),ir(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(fc=Ue())),i&4&&$u(e);break;case 22:if(y=r!==null&&r.memoizedState!==null,e.mode&1?(at=(d=at)||y,Kt(t,e),at=d):Kt(t,e),ir(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!y&&e.mode&1)for(re=e,y=e.child;y!==null;){for(f=re=y;re!==null;){switch(m=re,w=m.child,m.tag){case 0:case 11:case 14:case 15:Bs(4,m,m.return);break;case 1:Zi(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){Fe(i,r,S)}}break;case 5:Zi(m,m.return);break;case 22:if(m.memoizedState!==null){Ku(f);continue}}w!==null?(w.return=m,re=w):Ku(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,h=f.memoizedProps.style,_=h!=null&&h.hasOwnProperty("display")?h.display:null,n.style.display=Uh("display",_))}catch(S){Fe(e,e.return,S)}}}else if(f.tag===6){if(y===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(S){Fe(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:Kt(t,e),ir(e),i&4&&$u(e);break;case 21:break;default:Kt(t,e),ir(e)}}function ir(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(pf(r)){var i=r;break e}r=r.return}throw Error(X(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(js(s,""),i.flags&=-33);var a=Wu(e);vl(e,a,s);break;case 3:case 4:var _=i.stateNode.containerInfo,n=Wu(e);pl(e,n,_);break;default:throw Error(X(161))}}catch(h){Fe(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uv(e,t,r){re=e,gf(e)}function gf(e,t,r){for(var i=(e.mode&1)!==0;re!==null;){var s=re,a=s.child;if(s.tag===22&&i){var _=s.memoizedState!==null||On;if(!_){var n=s.alternate,h=n!==null&&n.memoizedState!==null||at;n=On;var d=at;if(On=_,(at=h)&&!d)for(re=s;re!==null;)_=re,h=_.child,_.tag===22&&_.memoizedState!==null?Zu(s):h!==null?(h.return=_,re=h):Zu(s);for(;a!==null;)re=a,gf(a),a=a.sibling;re=s,On=n,at=d}Vu(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,re=a):Vu(e)}}function Vu(e){for(;re!==null;){var t=re;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:at||Ho(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!at)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Zt(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Tu(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}Tu(t,_,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;var h=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":h.autoFocus&&r.focus();break;case"img":h.src&&(r.src=h.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&&Ws(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}at||t.flags&512&&_l(t)}catch(m){Fe(t,t.return,m)}}if(t===e){re=null;break}if(r=t.sibling,r!==null){r.return=t.return,re=r;break}re=t.return}}function Ku(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var r=t.sibling;if(r!==null){r.return=t.return,re=r;break}re=t.return}}function Zu(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ho(4,t)}catch(h){Fe(t,r,h)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(h){Fe(t,s,h)}}var a=t.return;try{_l(t)}catch(h){Fe(t,a,h)}break;case 5:var _=t.return;try{_l(t)}catch(h){Fe(t,_,h)}}}catch(h){Fe(t,t.return,h)}if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}var hv=Math.ceil,po=kr.ReactCurrentDispatcher,hc=kr.ReactCurrentOwner,jt=kr.ReactCurrentBatchConfig,ke=0,Qe=null,Ze=null,it=0,Et=0,qi=ei(0),Ye=0,en=null,gi=0,jo=0,dc=0,Is=null,yt=null,fc=0,as=1/0,dr=null,vo=!1,ml=null,Kr=null,Bn=!1,Hr=null,mo=0,Ns=0,gl=null,Kn=-1,Zn=0;function ht(){return ke&6?Ue():Kn!==-1?Kn:Kn=Ue()}function Zr(e){return e.mode&1?ke&2&&it!==0?it&-it:qp.transition!==null?(Zn===0&&(Zn=td()),Zn):(e=Te,e!==0||(e=window.event,e=e===void 0?16:ld(e.type)),e):1}function Gt(e,t,r,i){if(50<Ns)throw Ns=0,gl=null,Error(X(185));nn(e,r,i),(!(ke&2)||e!==Qe)&&(e===Qe&&(!(ke&2)&&(jo|=r),Ye===4&&Br(e,it)),kt(e,i),r===1&&ke===0&&!(t.mode&1)&&(as=Ue()+500,Bo&&ti()))}function kt(e,t){var r=e.callbackNode;q_(e,t);var i=Jn(e,e===Qe?it:0);if(i===0)r!==null&&ru(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&ru(r),t===1)e.tag===0?Zp(qu.bind(null,e)):Ld(qu.bind(null,e)),Wp(function(){!(ke&6)&&ti()}),r=null;else{switch(rd(i)){case 1:r=jl;break;case 4:r=Jh;break;case 16:r=Qn;break;case 536870912:r=ed;break;default:r=Qn}r=Ef(r,yf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function yf(e,t){if(Kn=-1,Zn=0,ke&6)throw Error(X(327));var r=e.callbackNode;if(es()&&e.callbackNode!==r)return null;var i=Jn(e,e===Qe?it:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=go(e,i);else{t=i;var s=ke;ke|=2;var a=wf();(Qe!==e||it!==t)&&(dr=null,as=Ue()+500,fi(e,t));do try{_v();break}catch(n){Sf(e,n)}while(!0);Ql(),po.current=a,ke=s,Ze!==null?t=0:(Qe=null,it=0,t=Ye)}if(t!==0){if(t===2&&(s=Va(e),s!==0&&(i=s,t=yl(e,s))),t===1)throw r=en,fi(e,0),Br(e,i),kt(e,Ue()),r;if(t===6)Br(e,i);else{if(s=e.current.alternate,!(i&30)&&!dv(s)&&(t=go(e,i),t===2&&(a=Va(e),a!==0&&(i=a,t=yl(e,a))),t===1))throw r=en,fi(e,0),Br(e,i),kt(e,Ue()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(X(345));case 2:ci(e,yt,dr);break;case 3:if(Br(e,i),(i&130023424)===i&&(t=fc+500-Ue(),10<t)){if(Jn(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){ht(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Ja(ci.bind(null,e,yt,dr),t);break}ci(e,yt,dr);break;case 4:if(Br(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var _=31-Yt(i);a=1<<_,_=t[_],_>s&&(s=_),i&=~a}if(i=s,i=Ue()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*hv(i/1960))-i,10<i){e.timeoutHandle=Ja(ci.bind(null,e,yt,dr),i);break}ci(e,yt,dr);break;case 5:ci(e,yt,dr);break;default:throw Error(X(329))}}}return kt(e,Ue()),e.callbackNode===r?yf.bind(null,e):null}function yl(e,t){var r=Is;return e.current.memoizedState.isDehydrated&&(fi(e,t).flags|=256),e=go(e,t),e!==2&&(t=yt,yt=r,t!==null&&Sl(t)),e}function Sl(e){yt===null?yt=e:yt.push.apply(yt,e)}function dv(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(!Qt(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 Br(e,t){for(t&=~dc,t&=~jo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Yt(t),i=1<<r;e[r]=-1,t&=~i}}function qu(e){if(ke&6)throw Error(X(327));es();var t=Jn(e,0);if(!(t&1))return kt(e,Ue()),null;var r=go(e,t);if(e.tag!==0&&r===2){var i=Va(e);i!==0&&(t=i,r=yl(e,i))}if(r===1)throw r=en,fi(e,0),Br(e,t),kt(e,Ue()),r;if(r===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ci(e,yt,dr),kt(e,Ue()),null}function _c(e,t){var r=ke;ke|=1;try{return e(t)}finally{ke=r,ke===0&&(as=Ue()+500,Bo&&ti())}}function yi(e){Hr!==null&&Hr.tag===0&&!(ke&6)&&es();var t=ke;ke|=1;var r=jt.transition,i=Te;try{if(jt.transition=null,Te=1,e)return e()}finally{Te=i,jt.transition=r,ke=t,!(ke&6)&&ti()}}function pc(){Et=qi.current,Me(qi)}function fi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Up(r)),Ze!==null)for(r=Ze.return;r!==null;){var i=r;switch(Xl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&so();break;case 3:ns(),Me(wt),Me(lt),sc();break;case 5:ic(i);break;case 4:ns();break;case 13:Me(Ne);break;case 19:Me(Ne);break;case 10:Jl(i.type._context);break;case 22:case 23:pc()}r=r.return}if(Qe=e,Ze=e=qr(e.current,null),it=Et=t,Ye=0,en=null,dc=jo=gi=0,yt=Is=null,hi!==null){for(t=0;t<hi.length;t++)if(r=hi[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}hi=null}return e}function Sf(e,t){do{var r=Ze;try{if(Ql(),Wn.current=_o,fo){for(var i=He.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}fo=!1}if(mi=0,Ge=Xe=He=null,Os=!1,Gs=0,hc.current=null,r===null||r.return===null){Ye=1,en=t,Ze=null;break}e:{var a=e,_=r.return,n=r,h=t;if(t=it,n.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){var d=h,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 w=Bu(_);if(w!==null){w.flags&=-257,Iu(w,_,n,a,t),w.mode&1&&Ou(a,d,t),t=w,h=d;var k=t.updateQueue;if(k===null){var S=new Set;S.add(h),t.updateQueue=S}else k.add(h);break e}else{if(!(t&1)){Ou(a,d,t),vc();break e}h=Error(X(426))}}else if(Pe&&n.mode&1){var u=Bu(_);if(u!==null){!(u.flags&65536)&&(u.flags|=256),Iu(u,_,n,a,t),Yl(os(h,n));break e}}a=h=os(h,n),Ye!==4&&(Ye=2),Is===null?Is=[a]:Is.push(a),a=_;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var l=rf(a,h,t);Ru(a,l);break e;case 1:n=h;var o=a.type,c=a.stateNode;if(!(a.flags&128)&&(typeof o.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Kr===null||!Kr.has(c)))){a.flags|=65536,t&=-t,a.lanes|=t;var p=sf(a,n,t);Ru(a,p);break e}}a=a.return}while(a!==null)}kf(r)}catch(g){t=g,Ze===r&&r!==null&&(Ze=r=r.return);continue}break}while(!0)}function wf(){var e=po.current;return po.current=_o,e===null?_o:e}function vc(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),Qe===null||!(gi&268435455)&&!(jo&268435455)||Br(Qe,it)}function go(e,t){var r=ke;ke|=2;var i=wf();(Qe!==e||it!==t)&&(dr=null,fi(e,t));do try{fv();break}catch(s){Sf(e,s)}while(!0);if(Ql(),ke=r,po.current=i,Ze!==null)throw Error(X(261));return Qe=null,it=0,Ye}function fv(){for(;Ze!==null;)Cf(Ze)}function _v(){for(;Ze!==null&&!j_();)Cf(Ze)}function Cf(e){var t=xf(e.alternate,e,Et);e.memoizedProps=e.pendingProps,t===null?kf(e):Ze=t,hc.current=null}function kf(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=av(r,t),r!==null){r.flags&=32767,Ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,Ze=null;return}}else if(r=ov(r,t,Et),r!==null){Ze=r;return}if(t=t.sibling,t!==null){Ze=t;return}Ze=t=e}while(t!==null);Ye===0&&(Ye=5)}function ci(e,t,r){var i=Te,s=jt.transition;try{jt.transition=null,Te=1,pv(e,t,r,i)}finally{jt.transition=s,Te=i}return null}function pv(e,t,r,i){do es();while(Hr!==null);if(ke&6)throw Error(X(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(X(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(X_(e,a),e===Qe&&(Ze=Qe=null,it=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Bn||(Bn=!0,Ef(Qn,function(){return es(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=jt.transition,jt.transition=null;var _=Te;Te=1;var n=ke;ke|=4,hc.current=null,cv(e,r),mf(r,e),Bp(Ga),eo=!!Ya,Ga=Ya=null,e.current=r,uv(r),F_(),ke=n,Te=_,jt.transition=a}else e.current=r;if(Bn&&(Bn=!1,Hr=e,mo=s),a=e.pendingLanes,a===0&&(Kr=null),W_(r.stateNode),kt(e,Ue()),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(vo)throw vo=!1,e=ml,ml=null,e;return mo&1&&e.tag!==0&&es(),a=e.pendingLanes,a&1?e===gl?Ns++:(Ns=0,gl=e):Ns=0,ti(),null}function es(){if(Hr!==null){var e=rd(mo),t=jt.transition,r=Te;try{if(jt.transition=null,Te=16>e?16:e,Hr===null)var i=!1;else{if(e=Hr,Hr=null,mo=0,ke&6)throw Error(X(331));var s=ke;for(ke|=4,re=e.current;re!==null;){var a=re,_=a.child;if(re.flags&16){var n=a.deletions;if(n!==null){for(var h=0;h<n.length;h++){var d=n[h];for(re=d;re!==null;){var y=re;switch(y.tag){case 0:case 11:case 15:Bs(8,y,a)}var f=y.child;if(f!==null)f.return=y,re=f;else for(;re!==null;){y=re;var m=y.sibling,w=y.return;if(_f(y),y===d){re=null;break}if(m!==null){m.return=w,re=m;break}re=w}}}var k=a.alternate;if(k!==null){var S=k.child;if(S!==null){k.child=null;do{var u=S.sibling;S.sibling=null,S=u}while(S!==null)}}re=a}}if(a.subtreeFlags&2064&&_!==null)_.return=a,re=_;else e:for(;re!==null;){if(a=re,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Bs(9,a,a.return)}var l=a.sibling;if(l!==null){l.return=a.return,re=l;break e}re=a.return}}var o=e.current;for(re=o;re!==null;){_=re;var c=_.child;if(_.subtreeFlags&2064&&c!==null)c.return=_,re=c;else e:for(_=o;re!==null;){if(n=re,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:Ho(9,n)}}catch(g){Fe(n,n.return,g)}if(n===_){re=null;break e}var p=n.sibling;if(p!==null){p.return=n.return,re=p;break e}re=n.return}}if(ke=s,ti(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(Do,e)}catch{}i=!0}return i}finally{Te=r,jt.transition=t}}return!1}function Xu(e,t,r){t=os(r,t),t=rf(e,t,1),e=Vr(e,t,1),t=ht(),e!==null&&(nn(e,1,t),kt(e,t))}function Fe(e,t,r){if(e.tag===3)Xu(e,e,r);else for(;t!==null;){if(t.tag===3){Xu(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kr===null||!Kr.has(i))){e=os(r,e),e=sf(t,e,1),t=Vr(t,e,1),e=ht(),t!==null&&(nn(t,1,e),kt(t,e));break}}t=t.return}}function vv(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=ht(),e.pingedLanes|=e.suspendedLanes&r,Qe===e&&(it&r)===r&&(Ye===4||Ye===3&&(it&130023424)===it&&500>Ue()-fc?fi(e,0):dc|=r),kt(e,t)}function bf(e,t){t===0&&(e.mode&1?(t=xn,xn<<=1,!(xn&130023424)&&(xn=4194304)):t=1);var r=ht();e=Sr(e,t),e!==null&&(nn(e,t,r),kt(e,r))}function mv(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),bf(e,r)}function gv(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(X(314))}i!==null&&i.delete(t),bf(e,r)}var xf;xf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)St=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return St=!1,nv(e,t,r);St=!!(e.flags&131072)}else St=!1,Pe&&t.flags&1048576&&Rd(t,ao,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Vn(e,t),e=t.pendingProps;var s=rs(t,lt.current);Ji(t,r),s=oc(null,t,i,e,s,r);var a=ac();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,Ct(i)?(a=!0,no(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,tc(t),s.updater=No,t.stateNode=s,s._reactInternals=t,ol(t,i,e,r),t=cl(null,t,i,!0,a,r)):(t.tag=0,Pe&&a&&ql(t),ut(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Vn(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=Sv(i),e=Zt(i,e),s){case 0:t=ll(null,t,i,e,r);break e;case 1:t=ju(null,t,i,e,r);break e;case 11:t=Nu(null,t,i,e,r);break e;case 14:t=Hu(null,t,i,Zt(i.type,e),r);break e}throw Error(X(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Zt(i,s),ll(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Zt(i,s),ju(e,t,i,s,r);case 3:e:{if(lf(t),e===null)throw Error(X(387));i=t.pendingProps,a=t.memoizedState,s=a.element,Od(e,t),uo(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=os(Error(X(423)),t),t=Fu(e,t,i,r,s);break e}else if(i!==s){s=os(Error(X(424)),t),t=Fu(e,t,i,r,s);break e}else for(Lt=$r(t.stateNode.containerInfo.firstChild),Rt=t,Pe=!0,Xt=null,r=Md(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(is(),i===s){t=wr(e,t,r);break e}ut(e,t,i,r)}t=t.child}return t;case 5:return Bd(t),e===null&&il(t),i=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,_=s.children,Qa(i,s)?_=null:a!==null&&Qa(i,a)&&(t.flags|=32),af(e,t),ut(e,t,_,r),t.child;case 6:return e===null&&il(t),null;case 13:return cf(e,t,r);case 4:return rc(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ss(t,null,i,r):ut(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Zt(i,s),Nu(e,t,i,s,r);case 7:return ut(e,t,t.pendingProps,r),t.child;case 8:return ut(e,t,t.pendingProps.children,r),t.child;case 12:return ut(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,a=t.memoizedProps,_=s.value,De(lo,i._currentValue),i._currentValue=_,a!==null)if(Qt(a.value,_)){if(a.children===s.children&&!wt.current){t=wr(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 h=n.firstContext;h!==null;){if(h.context===i){if(a.tag===1){h=vr(-1,r&-r),h.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var y=d.pending;y===null?h.next=h:(h.next=y.next,y.next=h),d.pending=h}}a.lanes|=r,h=a.alternate,h!==null&&(h.lanes|=r),sl(a.return,r,t),n.lanes|=r;break}h=h.next}}else if(a.tag===10)_=a.type===t.type?null:a.child;else if(a.tag===18){if(_=a.return,_===null)throw Error(X(341));_.lanes|=r,n=_.alternate,n!==null&&(n.lanes|=r),sl(_,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=_}ut(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Ji(t,r),s=Ft(s),i=i(s),t.flags|=1,ut(e,t,i,r),t.child;case 14:return i=t.type,s=Zt(i,t.pendingProps),s=Zt(i.type,s),Hu(e,t,i,s,r);case 15:return nf(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Zt(i,s),Vn(e,t),t.tag=1,Ct(i)?(e=!0,no(t)):e=!1,Ji(t,r),tf(t,i,s),ol(t,i,s,r),cl(null,t,i,!0,e,r);case 19:return uf(e,t,r);case 22:return of(e,t,r)}throw Error(X(156,t.tag))};function Ef(e,t){return Qh(e,t)}function yv(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 Ht(e,t,r,i){return new yv(e,t,r,i)}function mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sv(e){if(typeof e=="function")return mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Il)return 11;if(e===Nl)return 14}return 2}function qr(e,t){var r=e.alternate;return r===null?(r=Ht(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 qn(e,t,r,i,s,a){var _=2;if(i=e,typeof e=="function")mc(e)&&(_=1);else if(typeof e=="string")_=5;else e:switch(e){case Hi:return _i(r.children,s,a,t);case Bl:_=8,s|=8;break;case Da:return e=Ht(12,r,t,s|2),e.elementType=Da,e.lanes=a,e;case Aa:return e=Ht(13,r,t,s),e.elementType=Aa,e.lanes=a,e;case Ma:return e=Ht(19,r,t,s),e.elementType=Ma,e.lanes=a,e;case Bh:return Fo(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ph:_=10;break e;case Oh:_=9;break e;case Il:_=11;break e;case Nl:_=14;break e;case Ar:_=16,i=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=Ht(_,r,t,s),t.elementType=e,t.type=i,t.lanes=a,t}function _i(e,t,r,i){return e=Ht(7,e,i,t),e.lanes=r,e}function Fo(e,t,r,i){return e=Ht(22,e,i,t),e.elementType=Bh,e.lanes=r,e.stateNode={isHidden:!1},e}function xa(e,t,r){return e=Ht(6,e,null,t),e.lanes=r,e}function Ea(e,t,r){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wv(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=oa(0),this.expirationTimes=oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oa(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function gc(e,t,r,i,s,a,_,n,h){return e=new wv(e,t,r,n,h),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ht(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},tc(a),e}function Cv(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ni,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Lf(e){if(!e)return Yr;e=e._reactInternals;e:{if(xi(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var r=e.type;if(Ct(r))return Ed(e,r,t)}return t}function Rf(e,t,r,i,s,a,_,n,h){return e=gc(r,i,!0,e,s,a,_,n,h),e.context=Lf(null),r=e.current,i=ht(),s=Zr(r),a=vr(i,s),a.callback=t??null,Vr(r,a,s),e.current.lanes=s,nn(e,s,i),kt(e,i),e}function zo(e,t,r,i){var s=t.current,a=ht(),_=Zr(s);return r=Lf(r),t.context===null?t.context=r:t.pendingContext=r,t=vr(a,_),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Vr(s,t,_),e!==null&&(Gt(e,s,_,a),Un(e,s,_)),_}function yo(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 Yu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function yc(e,t){Yu(e,t),(e=e.alternate)&&Yu(e,t)}function kv(){return null}var Tf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Sc(e){this._internalRoot=e}Uo.prototype.render=Sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));zo(e,t,null,null)};Uo.prototype.unmount=Sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yi(function(){zo(null,e,null,null)}),t[yr]=null}};function Uo(e){this._internalRoot=e}Uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=nd();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Or.length&&t!==0&&t<Or[r].priority;r++);Or.splice(r,0,e),r===0&&ad(e)}};function wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gu(){}function bv(e,t,r,i,s){if(s){if(typeof i=="function"){var a=i;i=function(){var d=yo(_);a.call(d)}}var _=Rf(t,i,e,0,null,!1,!1,"",Gu);return e._reactRootContainer=_,e[yr]=_.current,Ks(e.nodeType===8?e.parentNode:e),yi(),_}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var n=i;i=function(){var d=yo(h);n.call(d)}}var h=gc(e,0,!1,null,null,!1,!1,"",Gu);return e._reactRootContainer=h,e[yr]=h.current,Ks(e.nodeType===8?e.parentNode:e),yi(function(){zo(t,h,r,i)}),h}function $o(e,t,r,i,s){var a=r._reactRootContainer;if(a){var _=a;if(typeof s=="function"){var n=s;s=function(){var h=yo(_);n.call(h)}}zo(t,_,e,s)}else _=bv(r,t,e,s,i);return yo(_)}id=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Es(t.pendingLanes);r!==0&&(Fl(t,r|1),kt(t,Ue()),!(ke&6)&&(as=Ue()+500,ti()))}break;case 13:yi(function(){var i=Sr(e,1);if(i!==null){var s=ht();Gt(i,e,1,s)}}),yc(e,1)}};zl=function(e){if(e.tag===13){var t=Sr(e,134217728);if(t!==null){var r=ht();Gt(t,e,134217728,r)}yc(e,134217728)}};sd=function(e){if(e.tag===13){var t=Zr(e),r=Sr(e,t);if(r!==null){var i=ht();Gt(r,e,t,i)}yc(e,t)}};nd=function(){return Te};od=function(e,t){var r=Te;try{return Te=e,t()}finally{Te=r}};Ua=function(e,t,r){switch(t){case"input":if(Ba(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=Oo(i);if(!s)throw Error(X(90));Nh(i),Ba(i,s)}}}break;case"textarea":jh(e,r);break;case"select":t=r.value,t!=null&&Xi(e,!!r.multiple,t,!1)}};Kh=_c;Zh=yi;var xv={usingClientEntryPoint:!1,Events:[an,Ui,Oo,$h,Vh,_c]},ks={findFiberByHostInstance:ui,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ev={bundleType:ks.bundleType,version:ks.version,rendererPackageName:ks.rendererPackageName,rendererConfig:ks.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yh(e),e===null?null:e.stateNode},findFiberByHostInstance:ks.findFiberByHostInstance||kv,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 In=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!In.isDisabled&&In.supportsFiber)try{Do=In.inject(Ev),or=In}catch{}}At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xv;At.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wc(t))throw Error(X(200));return Cv(e,t,null,r)};At.createRoot=function(e,t){if(!wc(e))throw Error(X(299));var r=!1,i="",s=Tf;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=gc(e,1,!1,null,null,r,!1,i,s),e[yr]=t.current,Ks(e.nodeType===8?e.parentNode:e),new Sc(t)};At.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(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=Yh(t),e=e===null?null:e.stateNode,e};At.flushSync=function(e){return yi(e)};At.hydrate=function(e,t,r){if(!Wo(t))throw Error(X(200));return $o(null,e,t,!0,r)};At.hydrateRoot=function(e,t,r){if(!wc(e))throw Error(X(405));var i=r!=null&&r.hydratedSources||null,s=!1,a="",_=Tf;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),t=Rf(t,null,e,1,r??null,s,!1,a,_),e[yr]=t.current,Ks(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 Uo(t)};At.render=function(e,t,r){if(!Wo(t))throw Error(X(200));return $o(null,e,t,!1,r)};At.unmountComponentAtNode=function(e){if(!Wo(e))throw Error(X(40));return e._reactRootContainer?(yi(function(){$o(null,null,e,!1,function(){e._reactRootContainer=null,e[yr]=null})}),!0):!1};At.unstable_batchedUpdates=_c;At.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Wo(r))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return $o(e,t,r,!1,i)};At.version="18.3.1-next-f1338f8080-20240426";function Df(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Df)}catch(e){console.error(e)}}Df(),Th.exports=At;var Af=Th.exports,Mf,Qu=Af;Mf=Qu.createRoot,Qu.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 Lv=2,Rv=1,Tv=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,h=_.right+_.left,d=i-n,y=s-h-t;return{cols:Math.max(Lv,Math.floor(y/e.css.cell.width)),rows:Math.max(Rv,Math.floor(d/e.css.cell.height))}}},Pf={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(_,n,h){var d=this&&this.__decorate||function(c,p,g,C){var x,v=arguments.length,b=v<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,g):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,g,C);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,C){p(g,C,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const f=h(9042),m=h(6114),w=h(9924),k=h(844),S=h(5596),u=h(4725),l=h(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 w.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,C=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",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,p){const g=c.target,C=this._rowElements[p===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==C)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,u.IRenderService)],o)},3614:(_,n)=>{function h(m){return m.replace(/\r?\n/g,"\r")}function d(m,w){return w?"\x1B[200~"+m+"\x1B[201~":m}function y(m,w,k,S){m=d(m=h(m),k.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(m,!0),w.value=""}function f(m,w,k){const S=k.getBoundingClientRect(),u=m.clientX-S.left-10,l=m.clientY-S.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${u}px`,w.style.top=`${l}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=h,n.bracketTextForPaste=d,n.copyHandler=function(m,w){m.clipboardData&&m.clipboardData.setData("text/plain",w.selectionText),m.preventDefault()},n.handlePasteEvent=function(m,w,k,S){m.stopPropagation(),m.clipboardData&&y(m.clipboardData.getData("text/plain"),w,k,S)},n.paste=y,n.moveTextAreaUnderMouseCursor=f,n.rightClickHandler=function(m,w,k,S,u){f(m,w,k),u&&S.rightClickSelect(m),w.value=S.selectionText,w.select()}},7239:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=h(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(h,d,y,f){h.addEventListener(d,y,f);let m=!1;return{dispose:()=>{m||(m=!0,h.removeEventListener(d,y,f))}}}},6465:function(_,n,h){var d=this&&this.__decorate||function(u,l,o,c){var p,g=arguments.length,C=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,c);else for(var x=u.length-1;x>=0;x--)(p=u[x])&&(C=(g<3?p(C):g>3?p(l,o,C):p(l,o))||C);return g>3&&C&&Object.defineProperty(l,o,C),C},y=this&&this.__param||function(u,l){return function(o,c){l(o,c,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier2=void 0;const f=h(3656),m=h(8460),w=h(844),k=h(2585);let S=n.Linkifier2=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(u){super(),this._bufferService=u,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,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(u){return this._linkProviders.push(u),{dispose:()=>{const l=this._linkProviders.indexOf(u);l!==-1&&this._linkProviders.splice(l,1)}}}attachToDom(u,l,o){this._element=u,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(u){if(this._lastMouseEvent=u,!this._element||!this._mouseService)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=u.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(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,l){var o,c;this._activeProviderReplies&&l||((o=this._activeProviderReplies)===null||o===void 0||o.forEach(g=>{g==null||g.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=u.y);let p=!1;for(const[g,C]of this._linkProviders.entries())l?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(g)&&(p=this._checkLinkProviderResult(g,u,p)):C.provideLinks(u.y,x=>{var v,b;if(this._isMouseOut)return;const R=x==null?void 0:x.map(P=>({link:P}));(v=this._activeProviderReplies)===null||v===void 0||v.set(g,R),p=this._checkLinkProviderResult(g,u,p),((b=this._activeProviderReplies)===null||b===void 0?void 0:b.size)===this._linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)})}_removeIntersectingLinks(u,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 C=p[g],x=C.link.range.start.y<u?0:C.link.range.start.x,v=C.link.range.end.y>u?this._bufferService.cols:C.link.range.end.x;for(let b=x;b<=v;b++){if(o.has(b)){p.splice(g--,1);break}o.add(b)}}}}_checkLinkProviderResult(u,l,o){var c;if(!this._activeProviderReplies)return o;const p=this._activeProviderReplies.get(u);let g=!1;for(let C=0;C<u;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(g=!0);if(!g&&p){const C=p.find(x=>this._linkAtPosition(x.link,l));C&&(o=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let C=0;C<this._activeProviderReplies.size;C++){const x=(c=this._activeProviderReplies.get(C))===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(u){if(!this._element||!this._mouseService||!this._currentLink)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,l){this._element&&this._currentLink&&this._lastMouseEvent&&(!u||!l||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(u.link,l)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.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(u.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(u,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&&u.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(o,l.text)}_fireUnderlineEvent(u,l){const o=u.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(u,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&&u.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(o,l.text)}_linkAtPosition(u,l){const o=u.range.start.y*this._bufferService.cols+u.range.start.x,c=u.range.end.y*this._bufferService.cols+u.range.end.x,p=l.y*this._bufferService.cols+l.x;return o<=p&&p<=c}_positionFromMouseEvent(u,l,o){const c=o.getCoords(u,l,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,l,o,c,p){return{x1:u,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,h){var d=this&&this.__decorate||function(S,u,l,o){var c,p=arguments.length,g=p<3?u:o===null?o=Object.getOwnPropertyDescriptor(u,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,u,l,o);else for(var C=S.length-1;C>=0;C--)(c=S[C])&&(g=(p<3?c(g):p>3?c(u,l,g):c(u,l))||g);return p>3&&g&&Object.defineProperty(u,l,g),g},y=this&&this.__param||function(S,u){return function(l,o){u(l,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const f=h(511),m=h(2585);let w=n.OscLinkProvider=class{constructor(S,u,l){this._bufferService=S,this._optionsService=u,this._oscLinkService=l}provideLinks(S,u){var l;const o=this._bufferService.buffer.lines.get(S-1);if(!o)return void u(void 0);const c=[],p=this._optionsService.rawOptions.linkHandler,g=new f.CellData,C=o.getTrimmedLength();let x=-1,v=-1,b=!1;for(let R=0;R<C;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===C-1){const P=(l=this._oscLinkService.getLinkData(x))===null||l===void 0?void 0:l.uri;if(P){const A={start:{x:v+1,y:S},end:{x:R+(b||R!==C-1?0:1),y:S}};let O=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const F=new URL(P);["http:","https:"].includes(F.protocol)||(O=!0)}catch{O=!0}O||c.push({text:P,range:A,activate:(F,W)=>p?p.activate(F,W,A):k(0,W),hover:(F,W)=>{var Z;return(Z=p==null?void 0:p.hover)===null||Z===void 0?void 0:Z.call(p,F,W,A)},leave:(F,W)=>{var Z;return(Z=p==null?void 0:p.leave)===null||Z===void 0?void 0:Z.call(p,F,W,A)}})}b=!1,g.hasExtendedAttrs()&&g.extended.urlId?(v=R,x=g.extended.urlId):(v=-1,x=-1)}}u(c)}};function k(S,u){if(confirm(`Do you want to navigate to ${u}?
|
|
54
|
-
|
|
55
|
-
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=w=d([y(0,m.IBufferService),y(1,m.IOptionsService),y(2,m.IOscLinkService)],w)},6193:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(h,d){this._parentWindow=h,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(h,d,y){this._rowCount=y,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,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 h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},5596:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ScreenDprMonitor=void 0;const d=h(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=h(3614),y=h(3656),f=h(6465),m=h(9042),w=h(3730),k=h(1680),S=h(3107),u=h(5744),l=h(2950),o=h(1296),c=h(428),p=h(4269),g=h(5114),C=h(8934),x=h(3230),v=h(9312),b=h(4725),R=h(6731),P=h(8055),A=h(8969),O=h(8460),F=h(844),W=h(6114),Z=h(8437),V=h(2584),E=h(7399),T=h(5941),D=h(9074),M=h(2585),H=h(5435),q=h(4567),te=typeof window<"u"?window.document:null;class J 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=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new O.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new O.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new O.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new O.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new O.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new O.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new O.EventEmitter),this._onBlur=this.register(new O.EventEmitter),this._onA11yCharEmitter=this.register(new O.EventEmitter),this._onA11yTabEmitter=this.register(new O.EventEmitter),this._onWillOpen=this.register(new O.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(f.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((N,$)=>this.refresh(N,$))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(N=>this._reportWindowsOptions(N))),this.register(this._inputHandler.onColor(N=>this._handleColorEvent(N))),this.register((0,O.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,O.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(N=>this._afterResize(N.cols,N.rows))),this.register((0,F.toDisposable)(()=>{var N,$;this._customKeyEventHandler=void 0,($=(N=this.element)===null||N===void 0?void 0:N.parentNode)===null||$===void 0||$.removeChild(this.element)}))}_handleColorEvent(L){if(this._themeService)for(const N of L){let $,z="";switch(N.index){case 256:$="foreground",z="10";break;case 257:$="background",z="11";break;case 258:$="cursor",z="12";break;default:$="ansi",z="4;"+N.index}switch(N.type){case 0:const ne=P.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${z};${(0,T.toRgbString)(ne)}${V.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors(Q=>Q.ansi[N.index]=P.rgba.toColor(...N.color));else{const Q=$;this._themeService.modifyColors(ye=>ye[Q]=P.rgba.toColor(...N.color))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(L){L?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(L){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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(V.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,N=this.buffer.lines.get(L);if(!N)return;const $=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,ne=N.getWidth($),Q=this._renderService.dimensions.css.cell.width*ne,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Oe=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oe+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=Q+"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",N=>{this.hasSelection()&&(0,d.copyHandler)(N,this._selectionService)}));const L=N=>(0,d.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",L)),this.register((0,y.addDisposableDomListener)(this.element,"paste",L)),W.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",N=>{N.button===2&&(0,d.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",N=>{(0,d.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",N=>{N.button===1&&(0,d.moveTextAreaUnderMouseCursor)(N,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 N;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 $=te.createDocumentFragment();this._viewportElement=te.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=te.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=te.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=te.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=te.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),W.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,(N=this._document.defaultView)!==null&&N!==void 0?N: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=te.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($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.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(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",z=>this._handleScreenReaderModeOptionChange(z))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.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,N=this.element;function $(Q){const ye=L._mouseService.getMouseReportCoords(Q,L.screenElement);if(!ye)return!1;let Oe,We;switch(Q.overrideType||Q.type){case"mousemove":We=32,Q.buttons===void 0?(Oe=3,Q.button!==void 0&&(Oe=Q.button<3?Q.button:3)):Oe=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":We=0,Oe=Q.button<3?Q.button:3;break;case"mousedown":We=1,Oe=Q.button<3?Q.button:3;break;case"wheel":if(L.viewport.getLinesScrolled(Q)===0)return!1;We=Q.deltaY<0?0:1,Oe=4;break;default:return!1}return!(We===void 0||Oe===void 0||Oe>4)&&L.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Oe,action:We,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ne={mouseup:Q=>($(Q),Q.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(Q)),wheel:Q=>($(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&$(Q)},mousemove:Q=>{Q.buttons||$(Q)}};this.register(this.coreMouseService.onProtocolChange(Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),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&Q?z.mousemove||(N.addEventListener("mousemove",ne.mousemove),z.mousemove=ne.mousemove):(N.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&Q?z.wheel||(N.addEventListener("wheel",ne.wheel,{passive:!1}),z.wheel=ne.wheel):(N.removeEventListener("wheel",z.wheel),z.wheel=null),2&Q?z.mouseup||(N.addEventListener("mouseup",ne.mouseup),z.mouseup=ne.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),N.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&Q?z.mousedrag||(z.mousedrag=ne.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(N,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return $(Q),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(Q)})),this.register((0,y.addDisposableDomListener)(N,"wheel",Q=>{if(!z.wheel){if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(Q);if(ye===0)return;const Oe=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let We="";for(let K=0;K<Math.abs(ye);K++)We+=Oe;return this.coreService.triggerDataEvent(We,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,y.addDisposableDomListener)(N,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,y.addDisposableDomListener)(N,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(L,N){var $;($=this._renderService)===null||$===void 0||$.refreshRows(L,N)}updateCursorStyle(L){var N;!((N=this._selectionService)===null||N===void 0)&&N.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,N,$=0){var z;$===1?(super.scrollLines(L,N,$),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 N=this._characterJoinerService.register(L);return this.refresh(0,this.rows-1),N}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,N,$){this._selectionService.setSelection(L,N,$)}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,N){var $;($=this._selectionService)===null||$===void 0||$.selectLines(L,N)}_keyDown(L){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&L.altKey;if(!N&&!this._compositionHelper.keydown(L))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||L.key!=="Dead"&&L.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,E.evaluateKeyboardEvent)(L,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(L),$.type===3||$.type===2){const z=this.rows-1;return this.scrollLines($.type===2?-z:z),this.cancel(L,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,L)||($.cancel&&this.cancel(L,!0),!$.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):($.key!==V.C0.ETX&&$.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||L.altKey||L.ctrlKey?this.cancel(L,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(L,N){const $=L.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||L.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||L.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?$:$&&(!N.keyCode||N.keyCode>47)}_keyUp(L){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1||(function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18}(L)||this.focus(),this.updateCursorStyle(L),this._keyPressHandled=!1)}_keyPress(L){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;if(this.cancel(L),L.charCode)N=L.charCode;else if(L.which===null||L.which===void 0)N=L.keyCode;else{if(L.which===0||L.charCode===0)return!1;N=L.which}return!(!N||(L.altKey||L.ctrlKey||L.metaKey)&&!this._isThirdLevelShift(this.browser,L)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent(N,!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 N=L.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(L),!0}return!1}resize(L,N){L!==this.cols||N!==this.rows?super.resize(L,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(L,N){var $,z;($=this._charSizeService)===null||$===void 0||$.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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(Z.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,N;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)===null||L===void 0||L.reset(),this._decorationService.reset(),(N=this.viewport)===null||N===void 0||N.reset(),this._customKeyEventHandler=$,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(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(L){if(this._renderService)switch(L){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${$};${N}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),ne=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${ne};${z}t`)}}cancel(L,N){if(this.options.cancelEvents||N)return L.preventDefault(),L.stopPropagation(),!1}}n.Terminal=J},9924:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(h,d=1e3){this._renderCallback=h,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,d,y){this._rowCount=y,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,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,w=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d)}}},1680:function(_,n,h){var d=this&&this.__decorate||function(l,o,c,p){var g,C=arguments.length,x=C<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=(C<3?g(x):C>3?g(o,c,x):g(o,c))||x);return C>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=h(3656),m=h(4725),w=h(8460),k=h(844),S=h(2585);let u=n.Viewport=class extends k.Disposable{constructor(l,o,c,p,g,C,x,v){super(),this._viewportElement=l,this._scrollArea=o,this._bufferService=c,this._optionsService=p,this._charSizeService=g,this._renderService=C,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 w.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 C=[],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 P=(c=v.get(b+1))===null||c===void 0?void 0:c.isWrapped;if(g+=R.translateToString(!P),!P||b===v.length-1){const A=document.createElement("div");A.textContent=g,C.push(A),g.length>0&&(p=A),g=""}}return{bufferElements:C,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=u=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)],u)},3107:function(_,n,h){var d=this&&this.__decorate||function(u,l,o,c){var p,g=arguments.length,C=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,c);else for(var x=u.length-1;x>=0;x--)(p=u[x])&&(C=(g<3?p(C):g>3?p(l,o,C):p(l,o))||C);return g>3&&C&&Object.defineProperty(l,o,C),C},y=this&&this.__param||function(u,l){return function(o,c){l(o,c,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const f=h(3656),m=h(4725),w=h(844),k=h(2585);let S=n.BufferDecorationRenderer=class extends w.Disposable{constructor(u,l,o,c){super(),this._screenElement=u,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,w.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 u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var l,o;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((l=u==null?void 0:u.options)===null||l===void 0?void 0:l.layer)==="top"),c.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(u.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=u.options.x)!==null&&o!==void 0?o:0;return p&&p>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(u,c),c}_refreshStyle(u){const l=u.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let o=this._decorationElements.get(u);o||(o=this._createElement(u),u.element=o,this._decorationElements.set(u,o),this._container.appendChild(o),u.onDispose(()=>{this._decorationElements.delete(u),o.remove()})),o.style.top=l*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(o)}}_refreshXPosition(u,l=u.element){var o;if(!l)return;const c=(o=u.options.x)!==null&&o!==void 0?o:0;(u.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(u){var l;(l=this._decorationElements.get(u))===null||l===void 0||l.remove(),this._decorationElements.delete(u),u.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(h){if(h.options.overviewRulerOptions){for(const d of this._zones)if(d.color===h.options.overviewRulerOptions.color&&d.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,h.marker.line))return;if(this._lineAdjacentToZone(d,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(d,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,d){return d>=h.startBufferLine&&d<=h.endBufferLine}_lineAdjacentToZone(h,d,y){return d>=h.startBufferLine-this._linePadding[y||"full"]&&d<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,d){h.startBufferLine=Math.min(h.startBufferLine,d),h.endBufferLine=Math.max(h.endBufferLine,d)}}},5744:function(_,n,h){var d=this&&this.__decorate||function(p,g,C,x){var v,b=arguments.length,R=b<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,g,C,x);else for(var P=p.length-1;P>=0;P--)(v=p[P])&&(R=(b<3?v(R):b>3?v(g,C,R):v(g,C))||R);return b>3&&R&&Object.defineProperty(g,C,R),R},y=this&&this.__param||function(p,g){return function(C,x){g(C,x,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const f=h(5871),m=h(3656),w=h(4725),k=h(844),S=h(2585),u={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,C,x,v,b,R){var P;super(),this._viewportElement=p,this._screenElement=g,this._bufferService=C,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(),(P=this._viewportElement.parentElement)===null||P===void 0||P.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 O;(O=this._canvas)===null||O===void 0||O.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(){u.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);u.left=g,u.center=g,u.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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)-u[p.position||"full"]/2),l[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[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,w.IRenderService),y(5,S.IOptionsService),y(6,w.ICoreBrowserService)],c)},2950:function(_,n,h){var d=this&&this.__decorate||function(S,u,l,o){var c,p=arguments.length,g=p<3?u:o===null?o=Object.getOwnPropertyDescriptor(u,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,u,l,o);else for(var C=S.length-1;C>=0;C--)(c=S[C])&&(g=(p<3?c(g):p>3?c(u,l,g):c(u,l))||g);return p>3&&g&&Object.defineProperty(u,l,g),g},y=this&&this.__param||function(S,u){return function(l,o){u(l,o,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const f=h(4725),m=h(2585),w=h(2584);let k=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,u,l,o,c,p){this._textarea=S,this._compositionView=u,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 u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(S,"");this._dataAlreadySent=l,u.length>S.length?this._coreService.triggerDataEvent(l,!0):u.length<S.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):u.length===S.length&&u!==S&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=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=u*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 h(d,y,f){const m=f.getBoundingClientRect(),w=d.getComputedStyle(f),k=parseInt(w.getPropertyValue("padding-left")),S=parseInt(w.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=h,n.getCoords=function(d,y,f,m,w,k,S,u,l){if(!k)return;const o=h(d,y,f);return o?(o[0]=Math.ceil((o[0]+(l?S/2:0))/S),o[1]=Math.ceil(o[1]/u),o[0]=Math.min(Math.max(o[0],1),m+(l?1:0)),o[1]=Math.min(Math.max(o[1],1),w),o):void 0}},9504:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=h(2584);function y(u,l,o,c){const p=u-f(u,o),g=l-f(l,o),C=Math.abs(p-g)-function(x,v,b){let R=0;const P=x-f(x,b),A=v-f(v,b);for(let O=0;O<Math.abs(P-A);O++){const F=m(x,v)==="A"?-1:1,W=b.buffer.lines.get(P+F*O);W!=null&&W.isWrapped&&R++}return R}(u,l,o);return S(C,k(m(u,l),c))}function f(u,l){let o=0,c=l.buffer.lines.get(u),p=c==null?void 0:c.isWrapped;for(;p&&u>=0&&u<l.rows;)o++,c=l.buffer.lines.get(--u),p=c==null?void 0:c.isWrapped;return o}function m(u,l){return u>l?"A":"B"}function w(u,l,o,c,p,g){let C=u,x=l,v="";for(;C!==o||x!==c;)C+=p?1:-1,p&&C>g.cols-1?(v+=g.buffer.translateBufferLineToString(x,!1,u,C),C=0,u=0,x++):!p&&C<0&&(v+=g.buffer.translateBufferLineToString(x,!1,0,u+1),C=g.cols-1,u=C,x--);return v+g.buffer.translateBufferLineToString(x,!1,u,C)}function k(u,l){const o=l?"O":"[";return d.C0.ESC+o+u}function S(u,l){u=Math.floor(u);let o="";for(let c=0;c<u;c++)o+=l;return o}n.moveToCellSequence=function(u,l,o,c){const p=o.buffer.x,g=o.buffer.y;if(!o.buffer.hasScrollback)return function(v,b,R,P,A,O){return y(b,P,A,O).length===0?"":S(w(v,b,v,b-f(b,A),!1,A).length,k("D",O))}(p,g,0,l,o,c)+y(g,l,o,c)+function(v,b,R,P,A,O){let F;F=y(b,P,A,O).length>0?P-f(P,A):b;const W=P,Z=function(V,E,T,D,M,H){let q;return q=y(T,D,M,H).length>0?D-f(D,M):E,V<T&&q<=D||V>=T&&q<D?"C":"D"}(v,b,R,P,A,O);return S(w(v,F,R,W,Z==="C",A).length,k(Z,O))}(p,g,u,l,o,c);let C;if(g===l)return C=p>u?"D":"C",S(Math.abs(p-u),k(C,c));C=g>l?"D":"C";const x=Math.abs(g-l);return S(function(v,b){return b.cols-v}(g>l?u:p,o)+(x-1)*o.cols+1+((g>l?p:u)-1),k(C,c))}},1296:function(_,n,h){var d=this&&this.__decorate||function(A,O,F,W){var Z,V=arguments.length,E=V<3?O:W===null?W=Object.getOwnPropertyDescriptor(O,F):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,O,F,W);else for(var T=A.length-1;T>=0;T--)(Z=A[T])&&(E=(V<3?Z(E):V>3?Z(O,F,E):Z(O,F))||E);return V>3&&E&&Object.defineProperty(O,F,E),E},y=this&&this.__param||function(A,O){return function(F,W){O(F,W,A)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const f=h(3787),m=h(2550),w=h(2223),k=h(6171),S=h(4725),u=h(8055),l=h(8460),o=h(844),c=h(2585),p="xterm-dom-renderer-owner-",g="xterm-rows",C="xterm-fg-",x="xterm-bg-",v="xterm-focus",b="xterm-selection";let R=1,P=n.DomRenderer=class extends o.Disposable{constructor(A,O,F,W,Z,V,E,T,D,M){super(),this._element=A,this._screenElement=O,this._viewportElement=F,this._linkifier2=W,this._charSizeService=V,this._optionsService=E,this._bufferService=T,this._coreBrowserService=D,this._themeService=M,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(H=>this._injectCss(H))),this._injectCss(this._themeService.colors),this._rowFactory=Z.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(H=>this._handleLinkHover(H))),this.register(this._linkifier2.onHideLinkUnderline(H=>this._handleLinkLeave(H))),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 O=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let O=`${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}`;O+=`${this._terminalSelector} .${g} .xterm-dim { color: ${u.color.multiplyOpacity(A.foreground,.5).css};}`,O+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,O+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",O+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,O+=`${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);}`,O+=`${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,W]of A.ansi.entries())O+=`${this._terminalSelector} .${C}${F} { color: ${W.css}; }${this._terminalSelector} .${C}${F}.xterm-dim { color: ${u.color.multiplyOpacity(W,.5).css}; }${this._terminalSelector} .${x}${F} { background-color: ${W.css}; }`;O+=`${this._terminalSelector} .${C}${w.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(A.background).css}; }${this._terminalSelector} .${C}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${x}${w.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=O}_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,O){for(let F=this._rowElements.length;F<=O;F++){const W=document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,O){this._refreshRowElements(A,O),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,O,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,O,F),this.renderRows(0,this._bufferService.rows-1),!A||!O)return;const W=A[1]-this._bufferService.buffer.ydisp,Z=O[1]-this._bufferService.buffer.ydisp,V=Math.max(W,0),E=Math.min(Z,this._bufferService.rows-1);if(V>=this._bufferService.rows||E<0)return;const T=document.createDocumentFragment();if(F){const D=A[0]>O[0];T.appendChild(this._createSelectionElement(V,D?O[0]:A[0],D?A[0]:O[0],E-V+1))}else{const D=W===V?A[0]:0,M=V===Z?O[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(V,D,M));const H=E-V-1;if(T.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,H)),V!==E){const q=Z===E?O[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(E,0,q))}}this._selectionContainer.appendChild(T)}_createSelectionElement(A,O,F,W=1){const Z=document.createElement("div");return Z.style.height=W*this.dimensions.css.cell.height+"px",Z.style.top=A*this.dimensions.css.cell.height+"px",Z.style.left=O*this.dimensions.css.cell.width+"px",Z.style.width=this.dimensions.css.cell.width*(F-O)+"px",Z}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,O){const F=this._bufferService.buffer,W=F.ybase+F.y,Z=Math.min(F.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=A;D<=O;D++){const M=D+F.ydisp,H=this._rowElements[D],q=F.lines.get(M);if(!H||!q)break;H.replaceChildren(...this._rowFactory.createRow(q,M,M===W,E,T,Z,V,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,O,F,W,Z,V){F<0&&(A=0),W<0&&(O=0);const E=this._bufferService.rows-1;F=Math.max(Math.min(F,E),0),W=Math.max(Math.min(W,E),0),Z=Math.min(Z,this._bufferService.cols);const T=this._bufferService.buffer,D=T.ybase+T.y,M=Math.min(T.x,Z-1),H=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,te=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=F;J<=W;++J){const fe=J+T.ydisp,L=this._rowElements[J],N=T.lines.get(fe);if(!L||!N)break;L.replaceChildren(...this._rowFactory.createRow(N,fe,fe===D,q,te,M,H,this.dimensions.css.cell.width,this._widthCache,V?J===F?A:0:-1,V?(J===W?O:Z)-1:-1))}}};n.DomRenderer=P=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)],P)},3787:function(_,n,h){var d=this&&this.__decorate||function(C,x,v,b){var R,P=arguments.length,A=P<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,x,v,b);else for(var O=C.length-1;O>=0;O--)(R=C[O])&&(A=(P<3?R(A):P>3?R(x,v,A):R(x,v))||A);return P>3&&A&&Object.defineProperty(x,v,A),A},y=this&&this.__param||function(C,x){return function(v,b){x(v,b,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const f=h(2223),m=h(643),w=h(511),k=h(2585),S=h(8055),u=h(4725),l=h(4269),o=h(6171),c=h(3734);let p=n.DomRendererRowFactory=class{constructor(C,x,v,b,R,P,A){this._document=C,this._characterJoinerService=x,this._optionsService=v,this._coreBrowserService=b,this._coreService=R,this._decorationService=P,this._themeService=A,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,x,v){this._selectionStart=C,this._selectionEnd=x,this._columnSelectMode=v}createRow(C,x,v,b,R,P,A,O,F,W,Z){const V=[],E=this._characterJoinerService.getJoinedCharacters(x),T=this._themeService.colors;let D,M=C.getNoBgTrimmedLength();v&&M<P+1&&(M=P+1);let H=0,q="",te=0,J=0,fe=0,L=!1,N=0,$=!1,z=0;const ne=[],Q=W!==-1&&Z!==-1;for(let ye=0;ye<M;ye++){C.loadCell(ye,this._workCell);let Oe=this._workCell.getWidth();if(Oe===0)continue;let We=!1,K=ye,G=this._workCell;if(E.length>0&&ye===E[0][0]){We=!0;const xe=E.shift();G=new l.JoinedCellData(this._workCell,C.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),K=xe[1]-1,Oe=G.getWidth()}const ge=this._isCellInSelection(ye,x),$e=v&&ye===P,Be=Q&&ye>=W&&ye<=Z;let pe=!1;this._decorationService.forEachDecorationAtCell(ye,x,void 0,xe=>{pe=!0});let Ei=G.getChars()||m.WHITESPACE_CELL_CHAR;if(Ei===" "&&(G.isUnderline()||G.isOverline())&&(Ei=" "),z=Oe*O-F.get(Ei,G.isBold(),G.isItalic()),D){if(H&&(ge&&$||!ge&&!$&&G.bg===te)&&(ge&&$&&T.selectionForeground||G.fg===J)&&G.extended.ext===fe&&Be===L&&z===N&&!$e&&!We&&!pe){q+=Ei,H++;continue}H&&(D.textContent=q),D=this._document.createElement("span"),H=0,q=""}else D=this._document.createElement("span");if(te=G.bg,J=G.fg,fe=G.extended.ext,L=Be,N=z,$=ge,We&&P>=ye&&P<=K&&(P=ye),!this._coreService.isCursorHidden&&$e){if(ne.push("xterm-cursor"),this._coreBrowserService.isFocused)A&&ne.push("xterm-cursor-blink"),ne.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":ne.push("xterm-cursor-outline");break;case"block":ne.push("xterm-cursor-block");break;case"bar":ne.push("xterm-cursor-bar");break;case"underline":ne.push("xterm-cursor-underline")}}if(G.isBold()&&ne.push("xterm-bold"),G.isItalic()&&ne.push("xterm-italic"),G.isDim()&&ne.push("xterm-dim"),q=G.isInvisible()?m.WHITESPACE_CELL_CHAR:G.getChars()||m.WHITESPACE_CELL_CHAR,G.isUnderline()&&(ne.push(`xterm-underline-${G.extended.underlineStyle}`),q===" "&&(q=" "),!G.isUnderlineColorDefault()))if(G.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(G.getUnderlineColor()).join(",")})`;else{let xe=G.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&G.isBold()&&xe<8&&(xe+=8),D.style.textDecorationColor=T.ansi[xe].css}G.isOverline()&&(ne.push("xterm-overline"),q===" "&&(q=" ")),G.isStrikethrough()&&ne.push("xterm-strikethrough"),Be&&(D.style.textDecoration="underline");let _t=G.getFgColor(),ri=G.getFgColorMode(),bt=G.getBgColor(),ii=G.getBgColorMode();const Li=!!G.isInverse();if(Li){const xe=_t;_t=bt,bt=xe;const cn=ri;ri=ii,ii=cn}let pt,Ri,vt,br=!1;switch(this._decorationService.forEachDecorationAtCell(ye,x,void 0,xe=>{xe.options.layer!=="top"&&br||(xe.backgroundColorRGB&&(ii=50331648,bt=xe.backgroundColorRGB.rgba>>8&16777215,pt=xe.backgroundColorRGB),xe.foregroundColorRGB&&(ri=50331648,_t=xe.foregroundColorRGB.rgba>>8&16777215,Ri=xe.foregroundColorRGB),br=xe.options.layer==="top")}),!br&&ge&&(pt=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,bt=pt.rgba>>8&16777215,ii=50331648,br=!0,T.selectionForeground&&(ri=50331648,_t=T.selectionForeground.rgba>>8&16777215,Ri=T.selectionForeground)),br&&ne.push("xterm-decoration-top"),ii){case 16777216:case 33554432:vt=T.ansi[bt],ne.push(`xterm-bg-${bt}`);break;case 50331648:vt=S.rgba.toColor(bt>>16,bt>>8&255,255&bt),this._addStyle(D,`background-color:#${g((bt>>>0).toString(16),"0",6)}`);break;default:Li?(vt=T.foreground,ne.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):vt=T.background}switch(pt||G.isDim()&&(pt=S.color.multiplyOpacity(vt,.5)),ri){case 16777216:case 33554432:G.isBold()&&_t<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_t+=8),this._applyMinimumContrast(D,vt,T.ansi[_t],G,pt,void 0)||ne.push(`xterm-fg-${_t}`);break;case 50331648:const xe=S.rgba.toColor(_t>>16&255,_t>>8&255,255&_t);this._applyMinimumContrast(D,vt,xe,G,pt,Ri)||this._addStyle(D,`color:#${g(_t.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,vt,T.foreground,G,pt,void 0)||Li&&ne.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ne.length&&(D.className=ne.join(" "),ne.length=0),$e||We||pe?D.textContent=q:H++,z!==this.defaultSpacing&&(D.style.letterSpacing=`${z}px`),V.push(D),ye=K}return D&&H&&(D.textContent=q),V}_applyMinimumContrast(C,x,v,b,R,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(b.getCode()))return!1;const A=this._getContrastCache(b);let O;if(R||P||(O=A.getColor(x.rgba,v.rgba)),O===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);O=S.color.ensureContrastRatio(R||x,P||v,F),A.setColor((R||x).rgba,(P||v).rgba,O??null)}return!!O&&(this._addStyle(C,`color:${O.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,x){C.setAttribute("style",`${C.getAttribute("style")||""}${x};`)}_isCellInSelection(C,x){const v=this._selectionStart,b=this._selectionEnd;return!(!v||!b)&&(this._columnSelectMode?v[0]<=b[0]?C>=v[0]&&x>=v[1]&&C<b[0]&&x<=b[1]:C<v[0]&&x>=v[1]&&C>=b[0]&&x<=b[1]:x>v[1]&&x<b[1]||v[1]===b[1]&&x===v[1]&&C>=v[0]&&C<b[0]||v[1]<b[1]&&x===b[1]&&C<b[0]||v[1]<b[1]&&x===v[1]&&C>=v[0])}};function g(C,x,v){for(;C.length<v;)C=x+C;return C}n.DomRendererRowFactory=p=d([y(1,u.ICharacterJoinerService),y(2,k.IOptionsService),y(3,u.ICoreBrowserService),y(4,k.ICoreService),y(5,k.IDecorationService),y(6,u.IThemeService)],p)},2550:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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=h.createElement("span"),y=h.createElement("span");y.style.fontWeight="bold";const f=h.createElement("span");f.style.fontStyle="italic";const m=h.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),h.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(h,d,y,f){h===this._font&&d===this._fontSize&&y===this._weight&&f===this._weightBold||(this._font=h,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(h,d,y){let f=0;if(!d&&!y&&h.length===1&&(f=h.charCodeAt(0))<256)return this._flat[f]!==-9999?this._flat[f]:this._flat[f]=this._measure(h,0);let m=h;d&&(m+="B"),y&&(m+="I");let w=this._holey.get(m);if(w===void 0){let k=0;d&&(k|=1),y&&(k|=2),w=this._measure(h,k),this._holey.set(m,w)}return w}_measure(h,d){const y=this._measureElements[d];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=h(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,n)=>{function h(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=h,n.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},n.excludeFromContrastRatioDemands=function(d){return h(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(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,d=this.selectionEnd;return!(!h||!d)&&(h[1]>d[1]||h[1]===d[1]&&h[0]>d[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,n,h){var d=this&&this.__decorate||function(u,l,o,c){var p,g=arguments.length,C=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,c);else for(var x=u.length-1;x>=0;x--)(p=u[x])&&(C=(g<3?p(C):g>3?p(l,o,C):p(l,o))||C);return g>3&&C&&Object.defineProperty(l,o,C),C},y=this&&this.__param||function(u,l){return function(o,c){l(o,c,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const f=h(2585),m=h(8460),w=h(844);let k=n.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,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(u,l,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const u=this._measureStrategy.measure();u.width===this.width&&u.height===this.height||(this.width=u.width,this.height=u.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,h){var d=this&&this.__decorate||function(l,o,c,p){var g,C=arguments.length,x=C<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=(C<3?g(x):C>3?g(o,c,x):g(o,c))||x);return C>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=h(3734),m=h(643),w=h(511),k=h(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 u=n.CharacterJoinerService=class Of{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.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 C=0,x=0,v=0,b=c.getFg(0),R=c.getBg(0);for(let P=0;P<c.getTrimmedLength();P++)if(c.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==R){if(P-C>1){const A=this._getJoinedRanges(g,v,x,c,C);for(let O=0;O<A.length;O++)p.push(A[O])}C=P,v=x,b=this._workCell.fg,R=this._workCell.bg}x+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const P=this._getJoinedRanges(g,v,x,c,C);for(let A=0;A<P.length;A++)p.push(P[A])}return p}_getJoinedRanges(o,c,p,g,C){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 P=0;P<R.length;P++)Of._mergeRanges(v,R[P])}catch(R){console.error(R)}return this._stringRangesToCellRanges(v,g,C),v}_stringRangesToCellRanges(o,c,p){let g=0,C=!1,x=0,v=o[g];if(v){for(let b=p;b<this._bufferService.cols;b++){const R=c.getWidth(b),P=c.getString(b).length||m.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!C&&v[0]<=x&&(v[0]=b,C=!0),v[1]<=x){if(v[1]=b,v=o[++g],!v)break;v[0]<=x?(v[0]=b,C=!0):C=!1}x+=P}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(o,c){let p=!1;for(let g=0;g<o.length;g++){const C=o[g];if(p){if(c[1]<=C[0])return o[g-1][1]=c[1],o;if(c[1]<=C[1])return o[g-1][1]=Math.max(c[1],C[1]),o.splice(g,1),o;o.splice(g,1),g--}else{if(c[1]<=C[0])return o.splice(g,0,c),o;if(c[1]<=C[1])return C[0]=Math.min(c[0],C[0]),o;c[0]<C[1]&&(C[0]=Math.min(c[0],C[0]),p=!0)}}return p?o[o.length-1][1]=c[1]:o.push(c),o}};n.CharacterJoinerService=u=d([y(0,k.IBufferService)],u)},5114:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0,n.CoreBrowserService=class{constructor(h,d){this._textarea=h,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,h){var d=this&&this.__decorate||function(k,S,u,l){var o,c=arguments.length,p=c<3?S:l===null?l=Object.getOwnPropertyDescriptor(S,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(k,S,u,l);else for(var g=k.length-1;g>=0;g--)(o=k[g])&&(p=(c<3?o(p):c>3?o(S,u,p):o(S,u))||p);return c>3&&p&&Object.defineProperty(S,u,p),p},y=this&&this.__param||function(k,S){return function(u,l){S(u,l,k)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const f=h(4725),m=h(9806);let w=n.MouseService=class{constructor(k,S){this._renderService=k,this._charSizeService=S}getCoords(k,S,u,l,o){return(0,m.getCoords)(window,k,S,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(k,S){const u=(0,m.getCoordsRelativeToElement)(window,k,S);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};n.MouseService=w=d([y(0,f.IRenderService),y(1,f.ICharSizeService)],w)},3230:function(_,n,h){var d=this&&this.__decorate||function(p,g,C,x){var v,b=arguments.length,R=b<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,g,C,x);else for(var P=p.length-1;P>=0;P--)(v=p[P])&&(R=(b<3?v(R):b>3?v(g,C,R):v(g,C))||R);return b>3&&R&&Object.defineProperty(g,C,R),R},y=this&&this.__param||function(p,g){return function(C,x){g(C,x,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const f=h(3656),m=h(6193),w=h(5596),k=h(4725),S=h(8460),u=h(844),l=h(7226),o=h(2585);let c=n.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,g,C,x,v,b,R,P){if(super(),this._rowCount=p,this._charSizeService=x,this._renderer=this.register(new u.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,O)=>this._renderRows(A,O)),this.register(this._renderDebouncer),this._screenDprMonitor=new w.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(C.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(v.onDecorationRegistered(()=>this._fullRefresh())),this.register(v.onDecorationRemoved(()=>this._fullRefresh())),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register((0,f.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(P.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const A=new R.window.IntersectionObserver(O=>this._handleIntersectionChange(O[O.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,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(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,C){var x;this._selectionState.start=p,this._selectionState.end=g,this._selectionState.columnSelectMode=C,(x=this._renderer.value)===null||x===void 0||x.handleSelectionChanged(p,g,C)}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,h){var d=this&&this.__decorate||function(v,b,R,P){var A,O=arguments.length,F=O<3?b:P===null?P=Object.getOwnPropertyDescriptor(b,R):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(v,b,R,P);else for(var W=v.length-1;W>=0;W--)(A=v[W])&&(F=(O<3?A(F):O>3?A(b,R,F):A(b,R))||F);return O>3&&F&&Object.defineProperty(b,R,F),F},y=this&&this.__param||function(v,b){return function(R,P){b(R,P,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const f=h(9806),m=h(9504),w=h(456),k=h(4725),S=h(8460),u=h(844),l=h(6114),o=h(4841),c=h(511),p=h(2585),g=" ",C=new RegExp(g,"g");let x=n.SelectionService=class extends u.Disposable{constructor(v,b,R,P,A,O,F,W,Z){super(),this._element=v,this._screenElement=b,this._linkifier=R,this._bufferService=P,this._coreService=A,this._mouseService=O,this._optionsService=F,this._renderService=W,this._coreBrowserService=Z,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=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(V=>this._handleTrim(V)),this.register(this._bufferService.buffers.onBufferActivate(V=>this._handleBufferActivate(V))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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,P=[];if(this._activeSelectionMode===3){if(v[0]===b[0])return"";const A=v[0]<b[0]?v[0]:b[0],O=v[0]<b[0]?b[0]:v[0];for(let F=v[1];F<=b[1];F++){const W=R.translateBufferLineToString(F,!0,A,O);P.push(W)}}else{const A=v[1]===b[1]?b[0]:void 0;P.push(R.translateBufferLineToString(v[1],!0,v[0],A));for(let O=v[1]+1;O<=b[1]-1;O++){const F=R.lines.get(O),W=R.translateBufferLineToString(O,!0);F!=null&&F.isWrapped?P[P.length-1]+=W:P.push(W)}if(v[1]!==b[1]){const O=R.lines.get(b[1]),F=R.translateBufferLineToString(b[1],!0,0,b[0]);O&&O.isWrapped?P[P.length-1]+=F:P.push(F)}}return P.map(A=>A.replace(C," ")).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,P=this._model.finalSelectionEnd;return!!(R&&P&&b)&&this._areCoordsInSelection(b,R,P)}isCellInSelection(v,b){const R=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!R||!P)&&this._areCoordsInSelection([v,b],R,P)}_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,P;const A=(P=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||P===void 0?void 0:P.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 O=this._getMouseBufferCoords(v);return!!O&&(this._selectWordAt(O,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 P=R.lines.get(this._model.selectionEnd[1]);P&&P.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 P=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!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 P=0;b>=P;P++){const A=v.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:A>1&&b!==P&&(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,P=!0){if(v[0]>=this._bufferService.cols)return;const A=this._bufferService.buffer,O=A.lines.get(v[1]);if(!O)return;const F=A.translateBufferLineToString(v[1],!1);let W=this._convertViewportColToCharacterIndex(O,v[0]),Z=W;const V=v[0]-W;let E=0,T=0,D=0,M=0;if(F.charAt(W)===" "){for(;W>0&&F.charAt(W-1)===" ";)W--;for(;Z<F.length&&F.charAt(Z+1)===" ";)Z++}else{let te=v[0],J=v[0];O.getWidth(te)===0&&(E++,te--),O.getWidth(J)===2&&(T++,J++);const fe=O.getString(J).length;for(fe>1&&(M+=fe-1,Z+=fe-1);te>0&&W>0&&!this._isCharWordSeparator(O.loadCell(te-1,this._workCell));){O.loadCell(te-1,this._workCell);const L=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,te--):L>1&&(D+=L-1,W-=L-1),W--,te--}for(;J<O.length&&Z+1<F.length&&!this._isCharWordSeparator(O.loadCell(J+1,this._workCell));){O.loadCell(J+1,this._workCell);const L=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,J++):L>1&&(M+=L-1,Z+=L-1),Z++,J++}}Z++;let H=W+V-E+D,q=Math.min(this._bufferService.cols,Z-W+E+T-D-M);if(b||F.slice(W,Z).trim()!==""){if(R&&H===0&&O.getCodePoint(0)!==32){const te=A.lines.get(v[1]-1);if(te&&O.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(J){const fe=this._bufferService.cols-J.start;H-=fe,q+=fe}}}if(P&&H+q===this._bufferService.cols&&O.getCodePoint(this._bufferService.cols-1)!==32){const te=A.lines.get(v[1]+1);if(te!=null&&te.isWrapped&&te.getCodePoint(0)!==32){const J=this._getWordAt([0,v[1]+1],!1,!1,!0);J&&(q+=J.length)}}return{start:H,length:q}}}_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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=h(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,h){var d=this&&this.__decorate||function(x,v,b,R){var P,A=arguments.length,O=A<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,v,b,R);else for(var F=x.length-1;F>=0;F--)(P=x[F])&&(O=(A<3?P(O):A>3?P(v,b,O):P(v,b))||O);return A>3&&O&&Object.defineProperty(v,b,O),O},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=h(7239),m=h(8055),w=h(8460),k=h(844),S=h(2585),u=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],P=v[b/6%6|0],A=v[b%6];x.push({css:m.channels.toCss(R,P,A),rgba:m.channels.toRgba(R,P,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 w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,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=C(x.foreground,u),v.background=C(x.background,l),v.cursor=C(x.cursor,o),v.cursorAccent=C(x.cursorAccent,c),v.selectionBackgroundTransparent=C(x.selectionBackground,p),v.selectionBackgroundOpaque=m.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=C(x.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=m.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=x.selectionForeground?C(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]=C(x.black,n.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=C(x.red,n.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=C(x.green,n.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=C(x.yellow,n.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=C(x.blue,n.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=C(x.magenta,n.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=C(x.cyan,n.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=C(x.white,n.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=C(x.brightBlack,n.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=C(x.brightRed,n.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=C(x.brightGreen,n.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=C(x.brightYellow,n.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=C(x.brightBlue,n.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=C(x.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=C(x.brightCyan,n.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=C(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]=C(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 C(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=h(8460),y=h(844);class f extends y.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const k=new Array(w);for(let S=0;S<Math.min(w,this.length);S++)k[S]=this._array[this._getCyclicIndex(S)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,k,...S){if(k){for(let u=w;u<this._length-k;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let u=this._length-1;u>=w;u--)this._array[this._getCyclicIndex(u+S.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<S.length;u++)this._array[this._getCyclicIndex(w+u)]=S[u];if(S.length&&this.onInsertEmitter.fire({index:w,amount:S.length}),this._length+S.length>this._maxLength){const u=this._length+S.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=S.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,S){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+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(w+l+S,this.get(w+l));const u=w+k+S-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<k;u++)this.set(w+u+S,this.get(w+u))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}n.CircularList=f},1439:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function h(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]&&h(d[m],y-1);return f}},8055:(_,n,h)=>{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=h(6114);let y=0,f=0,m=0,w=0;var k,S,u,l,o;function c(g){const C=g.toString(16);return C.length<2?"0"+C:C}function p(g,C){return g<C?(C+.05)/(g+.05):(g+.05)/(C+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(C,x,v,b){return b!==void 0?`#${c(C)}${c(x)}${c(v)}${c(b)}`:`#${c(C)}${c(x)}${c(v)}`},g.toRgba=function(C,x,v,b=255){return(C<<24|x<<16|v<<8|b)>>>0}}(k||(n.channels=k={})),function(g){function C(x,v){return w=Math.round(255*v),[y,f,m]=o.toChannels(x.rgba),{css:k.toCss(y,f,m,w),rgba:k.toRgba(y,f,m,w)}}g.blend=function(x,v){if(w=(255&v.rgba)/255,w===1)return{css:v.css,rgba:v.rgba};const b=v.rgba>>24&255,R=v.rgba>>16&255,P=v.rgba>>8&255,A=x.rgba>>24&255,O=x.rgba>>16&255,F=x.rgba>>8&255;return y=A+Math.round((b-A)*w),f=O+Math.round((R-O)*w),m=F+Math.round((P-F)*w),{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=C,g.multiplyOpacity=function(x,v){return w=255&x.rgba,C(x,w*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 C,x;if(!d.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const b=v.getContext("2d",{willReadFrequently:!0});b&&(C=b,C.globalCompositeOperation="copy",x=C.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),w=parseInt(v.slice(4,5).repeat(2),16),o.toColor(y,f,m,w);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]),w=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),o.toColor(y,f,m,w);if(!C||!x)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=x,C.fillStyle=v,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[y,f,m,w]=C.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:k.toRgba(y,f,m,w),css:v}}}(u||(n.css=u={})),function(g){function C(x,v,b){const R=x/255,P=v/255,A=b/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}g.relativeLuminance=function(x){return C(x>>16&255,x>>8&255,255&x)},g.relativeLuminance2=C}(l||(n.rgb=l={})),function(g){function C(v,b,R){const P=v>>24&255,A=v>>16&255,O=v>>8&255;let F=b>>24&255,W=b>>16&255,Z=b>>8&255,V=p(l.relativeLuminance2(F,W,Z),l.relativeLuminance2(P,A,O));for(;V<R&&(F>0||W>0||Z>0);)F-=Math.max(0,Math.ceil(.1*F)),W-=Math.max(0,Math.ceil(.1*W)),Z-=Math.max(0,Math.ceil(.1*Z)),V=p(l.relativeLuminance2(F,W,Z),l.relativeLuminance2(P,A,O));return(F<<24|W<<16|Z<<8|255)>>>0}function x(v,b,R){const P=v>>24&255,A=v>>16&255,O=v>>8&255;let F=b>>24&255,W=b>>16&255,Z=b>>8&255,V=p(l.relativeLuminance2(F,W,Z),l.relativeLuminance2(P,A,O));for(;V<R&&(F<255||W<255||Z<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),V=p(l.relativeLuminance2(F,W,Z),l.relativeLuminance2(P,A,O));return(F<<24|W<<16|Z<<8|255)>>>0}g.ensureContrastRatio=function(v,b,R){const P=l.relativeLuminance(v>>8),A=l.relativeLuminance(b>>8);if(p(P,A)<R){if(A<P){const W=C(v,b,R),Z=p(P,l.relativeLuminance(W>>8));if(Z<R){const V=x(v,b,R);return Z>p(P,l.relativeLuminance(V>>8))?W:V}return W}const O=x(v,b,R),F=p(P,l.relativeLuminance(O>>8));if(F<R){const W=C(v,b,R);return F>p(P,l.relativeLuminance(W>>8))?O:W}return O}},g.reduceLuminance=C,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,P){return{css:k.toCss(v,b,R,P),rgba:k.toRgba(v,b,R,P)}}}(o||(n.rgba=o={})),n.toPaddedHex=c,n.contrastRatio=p},8969:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=h(844),y=h(2585),f=h(4348),m=h(7866),w=h(744),k=h(7302),S=h(6975),u=h(8460),l=h(1753),o=h(1480),c=h(7994),p=h(9282),g=h(5435),C=h(5981),x=h(2660);let v=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(P=>{var A;(A=this._onScrollApi)===null||A===void 0||A.fire(P.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(P){for(const A in P)this.optionsService.options[A]=P[A]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(P)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.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,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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 C.WriteBuffer((A,O)=>this._inputHandler.parse(A,O))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,A){this._writeBuffer.write(P,A)}writeSync(P,A){this._logService.logLevel<=y.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(P,A)}resize(P,A){isNaN(P)||isNaN(A)||(P=Math.max(P,w.MINIMUM_COLS),A=Math.max(A,w.MINIMUM_ROWS),this._bufferService.resize(P,A))}scroll(P,A=!1){this._bufferService.scroll(P,A)}scrollLines(P,A,O){this._bufferService.scrollLines(P,A,O)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const A=P-this._bufferService.buffer.ydisp;A!==0&&this.scrollLines(A)}registerEscHandler(P,A){return this._inputHandler.registerEscHandler(P,A)}registerDcsHandler(P,A){return this._inputHandler.registerDcsHandler(P,A)}registerCsiHandler(P,A){return this._inputHandler.registerCsiHandler(P,A)}registerOscHandler(P,A){return this._inputHandler.registerOscHandler(P,A)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const A=this.optionsService.rawOptions.windowsPty;A&&A.buildNumber!==void 0&&A.buildNumber!==void 0?P=A.backend==="conpty"&&A.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const A of P)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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,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,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(h,d){return h(y=>d.fire(y))}},5435:function(_,n,h){var d=this&&this.__decorate||function(V,E,T,D){var M,H=arguments.length,q=H<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(V,E,T,D);else for(var te=V.length-1;te>=0;te--)(M=V[te])&&(q=(H<3?M(q):H>3?M(E,T,q):M(E,T))||q);return H>3&&q&&Object.defineProperty(E,T,q),q},y=this&&this.__param||function(V,E){return function(T,D){E(T,D,V)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const f=h(2584),m=h(7116),w=h(2015),k=h(844),S=h(482),u=h(8437),l=h(8460),o=h(643),c=h(511),p=h(3734),g=h(2585),C=h(6242),x=h(6351),v=h(5941),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function P(V,E){if(V>24)return E.setWinLines||!1;switch(V){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(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(n.WindowsOptionsReportType=A={}));let O=0;class F extends k.Disposable{getAttrData(){return this._curAttrData}constructor(E,T,D,M,H,q,te,J,fe=new w.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=T,this._coreService=D,this._logService=M,this._optionsService=H,this._oscLinkService=q,this._coreMouseService=te,this._unicodeService=J,this._parser=fe,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,N)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:N.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,N,$)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:N,data:$})}),this._parser.setDcsHandlerFallback((L,N,$)=>{N==="HOOK"&&($=$.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:N,payload:$})}),this._parser.setPrintHandler((L,N,$)=>this.print(L,N,$)),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 C.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new C.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new C.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new C.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new C.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new C.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new C.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new C.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new C.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new C.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new C.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new C.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,N)=>this.requestStatusString(L,N)))}_preserveStack(E,T,D,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=D,this._parseStack.position=M}_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,M=this._activeBuffer.x,H=this._activeBuffer.y,q=0;const te=this._parseStack.paused;if(te){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(D),D;M=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>R&&(q=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,J=>String.fromCharCode(J)).join("")}"`),typeof E=="string"?E.split("").map(J=>J.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(E.length,R))),te||this._dirtyRowTracker.clearRange(),E.length>R)for(let J=q;J<E.length;J+=R){const fe=J+R<E.length?J+R:E.length,L=typeof E=="string"?this._stringDecoder.decode(E.substring(J,fe),this._parseBuffer):this._utf8Decoder.decode(E.subarray(J,fe),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,L))return this._preserveStack(M,H,L,J),this._logSlowResolvingAsync(D),D}else if(!te){const J=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,J))return this._preserveStack(M,H,J,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===M&&this._activeBuffer.y===H||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,T,D){let M,H;const q=this._charsetService.charset,te=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,fe=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,N=this._curAttrData;let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-T>0&&$.getWidth(this._activeBuffer.x-1)===2&&$.setCellFromCodePoint(this._activeBuffer.x-1,0,1,N.fg,N.bg,N.extended);for(let z=T;z<D;++z){if(M=E[z],H=this._unicodeService.wcwidth(M),M<127&&q){const ne=q[String.fromCharCode(M)];ne&&(M=ne.charCodeAt(0))}if(te&&this._onA11yChar.fire((0,S.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),H||!this._activeBuffer.x){if(this._activeBuffer.x+H-1>=J){if(fe){for(;this._activeBuffer.x<J;)$.setCellFromCodePoint(this._activeBuffer.x++,0,1,N.fg,N.bg,N.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),$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=J-1,H===2)continue}if(L&&($.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(N),N),$.getWidth(J-1)===2&&$.setCellFromCodePoint(J-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,N.fg,N.bg,N.extended)),$.setCellFromCodePoint(this._activeBuffer.x++,M,H,N.fg,N.bg,N.extended),H>0)for(;--H;)$.setCellFromCodePoint(this._activeBuffer.x++,0,0,N.fg,N.bg,N.extended)}else $.getWidth(this._activeBuffer.x-1)?$.addCodepointToCell(this._activeBuffer.x-1,M):$.addCodepointToCell(this._activeBuffer.x-2,M)}D-T>0&&($.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<J&&D-T>0&&$.getWidth(this._activeBuffer.x)===0&&!$.hasContent(this._activeBuffer.x)&&$.setCellFromCodePoint(this._activeBuffer.x,0,1,N.fg,N.bg,N.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=>!P(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 C.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,M=!1,H=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);q.replaceCells(T,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),H),M&&(q.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 M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,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,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;T--;)this._activeBuffer.lines.splice(H-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 M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;T--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(M,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(u.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 M=0;M<T;++M)D[M]=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:M,activeEncoding:H}=this._coreMouseService,q=this._coreService,{buffers:te,cols:J}=this._bufferService,{active:fe,alt:L}=te,N=this._optionsService.rawOptions,$=ye=>ye?1:2,z=E.params[0];return ne=z,Q=T?z===2?4:z===4?$(q.modes.insertMode):z===12?3:z===20?$(N.convertEol):0:z===1?$(D.applicationCursorKeys):z===3?N.windowOptions.setWinLines?J===80?2:J===132?1:0:0:z===6?$(D.origin):z===7?$(D.wraparound):z===8?3:z===9?$(M==="X10"):z===12?$(N.cursorBlink):z===25?$(!q.isCursorHidden):z===45?$(D.reverseWraparound):z===66?$(D.applicationKeypad):z===67?4:z===1e3?$(M==="VT200"):z===1002?$(M==="DRAG"):z===1003?$(M==="ANY"):z===1004?$(D.sendFocus):z===1005?4:z===1006?$(H==="SGR"):z===1015?4:z===1016?$(H==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?$(fe===L):z===2004?$(D.bracketedPasteMode):0,q.triggerDataEvent(`${f.C0.ESC}[${T?"":"?"}${ne};${Q}$y`),!0;var ne,Q}_updateAttrColor(E,T,D,M,H){return T===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([D,M,H])):T===5&&(E&=-50331904,E|=33554432|255&D),E}_extractColor(E,T,D){const M=[0,0,-1,0,0,0];let H=0,q=0;do{if(M[q+H]=E.params[T+q],E.hasSubParams(T+q)){const te=E.getSubParams(T+q);let J=0;do M[1]===5&&(H=1),M[q+J+1+H]=te[J];while(++J<te.length&&J+q+1+H<M.length);break}if(M[1]===5&&q+H>=2||M[1]===2&&q+H>=5)break;M[1]&&(H=1)}while(++q+T<E.length&&q+H<M.length);for(let te=2;te<M.length;++te)M[te]===-1&&(M[te]=0);switch(M[0]){case 38:D.fg=this._updateAttrColor(D.fg,M[1],M[3],M[4],M[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,M[1],M[3],M[4],M[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,M[1],M[3],M[4],M[5])}return q}_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=u.DEFAULT_ATTR_DATA.fg,E.bg=u.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 M=this._curAttrData;for(let H=0;H<T;H++)D=E.params[H],D>=30&&D<=37?(M.fg&=-50331904,M.fg|=16777216|D-30):D>=40&&D<=47?(M.bg&=-50331904,M.bg|=16777216|D-40):D>=90&&D<=97?(M.fg&=-50331904,M.fg|=16777224|D-90):D>=100&&D<=107?(M.bg&=-50331904,M.bg|=16777224|D-100):D===0?this._processSGR0(M):D===1?M.fg|=134217728:D===3?M.bg|=67108864:D===4?(M.fg|=268435456,this._processUnderline(E.hasSubParams(H)?E.getSubParams(H)[0]:1,M)):D===5?M.fg|=536870912:D===7?M.fg|=67108864:D===8?M.fg|=1073741824:D===9?M.fg|=2147483648:D===2?M.bg|=134217728:D===21?this._processUnderline(2,M):D===22?(M.fg&=-134217729,M.bg&=-134217729):D===23?M.bg&=-67108865:D===24?(M.fg&=-268435457,this._processUnderline(0,M)):D===25?M.fg&=-536870913:D===27?M.fg&=-67108865:D===28?M.fg&=-1073741825:D===29?M.fg&=2147483647:D===39?(M.fg&=-67108864,M.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):D===49?(M.bg&=-67108864,M.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?H+=this._extractColor(E,H,M):D===53?M.bg|=1073741824:D===55?M.bg&=-1073741825:D===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):D===100?(M.fg&=-67108864,M.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&u.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=u.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(!P(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 M=D.shift(),H=D.shift();if(/^\d+$/.exec(M)){const q=parseInt(M);if(Z(q))if(H==="?")T.push({type:0,index:q});else{const te=(0,v.parseColor)(H);te&&T.push({type:1,index:q,color:te})}}}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 M;const H=D.findIndex(q=>q.startsWith("id="));return H!==-1&&(M=D[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,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 M=0;M<D.length&&!(T>=this._specialColors.length);++M,++T)if(D[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const H=(0,v.parseColor)(D[M]);H&&this._onColor.fire([{type:1,index:this._specialColors[T],color:H}])}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 M=0;M<D.length;++M)if(/^\d+$/.exec(D[M])){const H=parseInt(D[M]);Z(H)&&T.push({type:2,index:H})}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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.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,M=this._activeBuffer.lines.get(D);M&&(M.fill(E),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,T){const D=this._bufferService.buffer,M=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${H}${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}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,T){this._dirtyRowTracker.markRangeDirty(E,T)}}n.InputHandler=F;let W=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,E){V>E&&(O=V,V=E,E=O),V<this.start&&(this.start=V),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(V){return 0<=V&&V<256}W=d([y(0,g.IBufferService)],W)},844:(_,n)=>{function h(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=h,n.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},1505:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class h{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=h,n.FourKeyMap=class{constructor(){this._data=new h}set(d,y,f,m,w){this._data.get(d,y)||this._data.set(d,y,new h),this._data.get(d,y).set(f,m,w)}get(d,y,f,m){var w;return(w=this._data.get(d,y))===null||w===void 0?void 0:w.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 h=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=h.includes("Firefox"),n.isLegacyEdge=h.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(h),n.getSafariVersion=function(){if(!n.isSafari)return 0;const y=h.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(h)},6106:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let h=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(h=this._search(this._getKey(d)),this._array.splice(h,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===d)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===d)}forEachByKey(d,y){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===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 w=this._getKey(this._array[m]);if(w>d)f=m-1;else{if(!(w<d)){for(;m>0&&this._getKey(this._array[m-1])===d;)m--;return m}y=m+1}}return y}}},7226:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=h(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let k=0,S=0,u=w.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=w.timeRemaining(),1.5*S>l)return u-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-k))}ms`),void this._start();u=l}this.clear()}}class f extends y{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=h(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),w=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);w&&m&&(w.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 h{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 h;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=h;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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=h(6349),y=h(7226),f=h(3734),m=h(8437),w=h(4634),k=h(511),S=h(643),u=h(4863),l=h(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 C=this._getCorrectBufferLength(c);if(C>this.lines.maxLength&&(this.lines.maxLength=C),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(C<this.lines.maxLength){const v=this.lines.length-C;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=C}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,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(p.length>0){const g=(0,w.reflowLargerCreateNewLayout)(this.lines,p);(0,w.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(o,c,g.countRemoved)}}_reflowLargerAdjustViewport(o,c,p){const g=this.getNullCell(m.DEFAULT_ATTR_DATA);let C=p;for(;C-- >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 C=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 P=b[b.length-1].getTrimmedLength(),A=(0,w.reflowSmallerGetNewLineLengths)(b,this._cols,o),O=A.length-b.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+O):Math.max(0,this.lines.length-this.lines.maxLength+O);const W=[];for(let M=0;M<O;M++){const H=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);W.push(H)}W.length>0&&(g.push({start:x+b.length+C,newLines:W}),C+=W.length),b.push(...W);let Z=A.length-1,V=A[Z];V===0&&(Z--,V=A[Z]);let E=b.length-O-1,T=P;for(;E>=0;){const M=Math.min(T,V);if(b[Z]===void 0)break;if(b[Z].copyCellsFrom(b[E],T-M,V-M,M,!0),V-=M,V===0&&(Z--,V=A[Z]),T-=M,T===0){E--;const H=Math.max(E,0);T=(0,w.getWrappedLineTrimmedLength)(b,H,this._cols)}}for(let M=0;M<b.length;M++)A[M]<o&&b[M].setCell(A[M],p);let D=O-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+C)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+O,this.ybase+c-1)}if(g.length>0){const x=[],v=[];for(let Z=0;Z<this.lines.length;Z++)v.push(this.lines.get(Z));const b=this.lines.length;let R=b-1,P=0,A=g[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let O=0;for(let Z=Math.min(this.lines.maxLength-1,b+C-1);Z>=0;Z--)if(A&&A.start>R+O){for(let V=A.newLines.length-1;V>=0;V--)this.lines.set(Z--,A.newLines[V]);Z++,x.push({index:R+1,amount:A.newLines.length}),O+=A.newLines.length,A=g[++P]}else this.lines.set(Z,v[R--]);let F=0;for(let Z=x.length-1;Z>=0;Z--)x[Z].index+=F,this.lines.onInsertEmitter.fire(x[Z]),F+=x[Z].amount;const W=Math.max(0,b+C-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(o,c,p=0,g){const C=this.lines.get(o);return C?C.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 u.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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=h(3734),y=h(511),f=h(643),m=h(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class k{constructor(u,l,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const c=l||y.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,c);this.length=u}get(u){const l=this._data[3*u+0],o=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:o?(0,m.stringFromCodePoint)(o):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):o]}set(u,l){this._data[3*u+1]=l[f.CHAR_DATA_ATTR_INDEX],l[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,m.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return w=3*u,l.content=this._data[w+0],l.fg=this._data[w+1],l.bg=this._data[w+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodePoint(u,l,o,c,p,g){268435456&p&&(this._extendedAttrs[u]=g),this._data[3*u+0]=l|o<<22,this._data[3*u+1]=c,this._data[3*u+2]=p}addCodepointToCell(u,l){let o=this._data[3*u+0];2097152&o?this._combined[u]+=(0,m.stringFromCodePoint)(l):(2097151&o?(this._combined[u]=(0,m.stringFromCodePoint)(2097151&o)+(0,m.stringFromCodePoint)(l),o&=-2097152,o|=2097152):o=l|4194304,this._data[3*u+0]=o)}insertCells(u,l,o,c){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-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-u){const p=new y.CellData;for(let g=this.length-u-l-1;g>=0;--g)this.setCell(u+l+g,this.loadCell(u+g,p));for(let g=0;g<l;++g)this.setCell(u+g,o)}else for(let p=u;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(u,l,o,c){if(u%=this.length,l<this.length-u){const p=new y.CellData;for(let g=0;g<this.length-u-l;++g)this.setCell(u+g,this.loadCell(u+l+g,p));for(let g=this.length-l;g<this.length;++g)this.setCell(g,o)}else for(let p=u;p<this.length;++p)this.setCell(p,o);u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-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(u)!==0||this.hasContent(u)||this.setCellFromCodePoint(u,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(u,l,o,c,p=!1){if(p)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodePoint(u-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);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,o),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-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);u<l&&u<this.length;)this.setCell(u++,o)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*u;if(u>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<u;++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 C=parseInt(c[g],10);C>=u&&delete this._combined[C]}const p=Object.keys(this._extendedAttrs);for(let g=0;g<p.length;g++){const C=parseInt(p[g],10);C>=u&&delete this._extendedAttrs[C]}}return this.length=u,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,u);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new k(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,o,c,p){const g=u._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]=u._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]=u._extendedAttrs[l+x])}const C=Object.keys(u._combined);for(let x=0;x<C.length;x++){const v=parseInt(C[x],10);v>=l&&(this._combined[v-l+o]=u._combined[v])}}translateToString(u=!1,l=0,o=this.length){u&&(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(h,d){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return d*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(_,n)=>{function h(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,w=d[y+1].getWidth(0)===2;return m&&w?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,w){const k=[];for(let S=0;S<d.length-1;S++){let u=S,l=d.get(++u);if(!l.isWrapped)continue;const o=[d.get(S)];for(;u<d.length&&l.isWrapped;)o.push(l),l=d.get(++u);if(m>=S&&m<u){S+=o.length-1;continue}let c=0,p=h(o,c,y),g=1,C=0;for(;g<o.length;){const v=h(o,g,y),b=v-C,R=f-p,P=Math.min(b,R);o[c].copyCellsFrom(o[g],C,p,P,!1),p+=P,p===f&&(c++,p=0),C+=P,C===v&&(g++,C=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,w))}o[c].replaceCells(p,f,w);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,w=y[m],k=0;for(let S=0;S<d.length;S++)if(w===S){const u=y[++m];d.onDeleteEmitter.fire({index:S-k,amount:u}),S+=u-1,k+=u,w=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=[],w=d.map((l,o)=>h(d,o,y)).reduce((l,o)=>l+o);let k=0,S=0,u=0;for(;u<w;){if(w-u<f){m.push(w-u);break}k+=f;const l=h(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),u+=c}return m},n.getWrappedLineTrimmedLength=h},5295:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=h(8460),y=h(844),f=h(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=h(482),y=h(643),f=h(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 u=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=h(8460),y=h(844);class f{get id(){return this._id}constructor(w){this.line=w,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(w){return this._disposables.push(w),w}}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 h,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=""}(h||(n.C0=h={})),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=`${h.ESC}\\`}(y||(n.C1_ESCAPED=y={}))},7399:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=h(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,w,k){const S={type:0,cancel:!1,key:void 0},u=(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;u?(S.key=d.C0.ESC+"[1;"+(u+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(w?"b":"[1;5D"))):S.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;u?(S.key=d.C0.ESC+"[1;"+(u+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(w?"f":"[1;5C"))):S.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;u?(S.key=d.C0.ESC+"[1;"+(u+1)+"A",w||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;u?(S.key=d.C0.ESC+"[1;"+(u+1)+"B",w||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=u?d.C0.ESC+"[3;"+(u+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=u?d.C0.ESC+"[1;"+(u+1)+"H":m?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=u?d.C0.ESC+"[1;"+(u+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;"+(u+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=d.C0.ESC+"[6;"+(u+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=u?d.C0.ESC+"[1;"+(u+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=u?d.C0.ESC+"[1;"+(u+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=u?d.C0.ESC+"[1;"+(u+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=u?d.C0.ESC+"[1;"+(u+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=u?d.C0.ESC+"[15;"+(u+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=u?d.C0.ESC+"[17;"+(u+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=u?d.C0.ESC+"[18;"+(u+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=u?d.C0.ESC+"[19;"+(u+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=u?d.C0.ESC+"[20;"+(u+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=u?d.C0.ESC+"[21;"+(u+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=u?d.C0.ESC+"[23;"+(u+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=u?d.C0.ESC+"[24;"+(u+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(w&&!k||!f.altKey||f.metaKey)!w||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(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},n.utf32ToString=function(h,d=0,y=h.length){let f="";for(let m=d;m<y;++m){let w=h[m];w>65535?(w-=65536,f+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):f+=String.fromCharCode(w)}return f},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const y=h.length;if(!y)return 0;let f=0,m=0;if(this._interim){const w=h.charCodeAt(m++);56320<=w&&w<=57343?d[f++]=1024*(this._interim-55296)+w-56320+65536:(d[f++]=this._interim,d[f++]=w),this._interim=0}for(let w=m;w<y;++w){const k=h.charCodeAt(w);if(55296<=k&&k<=56319){if(++w>=y)return this._interim=k,f;const S=h.charCodeAt(w);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(h,d){const y=h.length;if(!y)return 0;let f,m,w,k,S=0,u=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 C,x=0;for(;(C=63&this.interim[++x])&&x<4;)g<<=6,g|=C;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(C=h[l++],(192&C)!=128){l--,p=!0;break}this.interim[x++]=C,g<<=6,g|=63&C}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=h[c])||128&(m=h[c+1])||128&(w=h[c+2])||128&(k=h[c+3]));)d[S++]=f,d[S++]=m,d[S++]=w,d[S++]=k,c+=4;if(f=h[c++],f<128)d[S++]=f;else if((224&f)==192){if(c>=y)return this.interim[0]=f,S;if(m=h[c++],(192&m)!=128){c--;continue}if(u=(31&f)<<6|63&m,u<128){c--;continue}d[S++]=u}else if((240&f)==224){if(c>=y)return this.interim[0]=f,S;if(m=h[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,S;if(w=h[c++],(192&w)!=128){c--;continue}if(u=(15&f)<<12|(63&m)<<6|63&w,u<2048||u>=55296&&u<=57343||u===65279)continue;d[S++]=u}else if((248&f)==240){if(c>=y)return this.interim[0]=f,S;if(m=h[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,S;if(w=h[c++],(192&w)!=128){c--;continue}if(c>=y)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=w,S;if(k=h[c++],(192&k)!=128){c--;continue}if(u=(7&f)<<18|(63&m)<<12|(63&w)<<6|63&k,u<65536||u>1114111)continue;d[S++]=u}}return S}}},225:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const h=[[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<h.length;++f)y.fill(0,h[f][0],h[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?y[f]:function(m,w){let k,S=0,u=w.length-1;if(m<w[0][0]||m>w[u][1])return!1;for(;u>=S;)if(k=S+u>>1,m>w[k][1])S=k+1;else{if(!(m<w[k][0]))return!0;u=k-1}return!1}(f,d)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}}},5981:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=h(8460),y=h(844);class f extends y.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,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+=w.length,this._writeBuffer.push(w),this._callbacks.push(k),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k)}_innerWrite(w=0,k=!0){const S=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,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-=u.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 h=/^([\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 w=f.toString(16),k=w.length<2?"0"+w:w;switch(m){case 4:return w[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 w=h.exec(m);if(w){const k=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/k*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/k*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/k*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),d.exec(m)&&[3,6,9,12].includes(m.length))){const w=m.length/3,k=[0,0,0];for(let S=0;S<3;++S){const u=parseInt(m.slice(w*S,w*S+w),16);k[S]=w===1?u<<4:w===2?u:w===3?u>>4:u>>8}return k}},n.toRgbString=function(f,m=16){const[w,k,S]=f;return`rgb:${y(w,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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=h(482),y=h(8742),f=h(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 u=this._handlers[k];return u.push(S),{dispose:()=>{const l=u.indexOf(S);l!==-1&&u.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 u=this._active.length-1;u>=0;u--)this._active[u].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(k,S,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(k,S,u);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,S,u))}unhook(k,S=!0){if(this._active.length){let u=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=S,o=this._stack.fallThrough,this._stack.paused=!1),!o&&u===!1){for(;l>=0&&(u=this._active[l].unhook(k),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",k);this._active=m,this._ident=0}};const w=new y.Params;w.addParam(0),n.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=w,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():w,this._data="",this._hitLimit=!1}put(k,S,u){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,S,u),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(u=>(this._params=w,this._data="",this._hitLimit=!1,u));return this._params=w,this._data="",this._hitLimit=!1,S}}},2015:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=h(844),y=h(8742),f=h(6242),m=h(6351);class w{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=w;const k=160;n.VT500_TRANSITION_TABLE=function(){const u=new w(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 C;for(C in u.setDefault(1,0),u.addMany(c,0,2,0),g)u.addMany([24,26,153,154],C,3,0),u.addMany(o(128,144),C,3,0),u.addMany(o(144,152),C,3,0),u.add(156,C,0,0),u.add(27,C,11,1),u.add(157,C,4,8),u.addMany([152,158,159],C,0,7),u.add(155,C,11,3),u.add(144,C,11,9);return u.addMany(p,0,3,0),u.addMany(p,1,3,1),u.add(127,1,0,1),u.addMany(p,8,0,8),u.addMany(p,3,3,3),u.add(127,3,0,3),u.addMany(p,4,3,4),u.add(127,4,0,4),u.addMany(p,6,3,6),u.addMany(p,5,3,5),u.add(127,5,0,5),u.addMany(p,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(c,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(o(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(c,7,0,7),u.addMany(p,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(o(64,127),3,7,0),u.addMany(o(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(o(48,60),4,8,4),u.addMany(o(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(o(32,64),6,0,6),u.add(127,6,0,6),u.addMany(o(64,127),6,0,0),u.addMany(o(32,48),3,9,5),u.addMany(o(32,48),5,9,5),u.addMany(o(48,64),5,0,6),u.addMany(o(64,127),5,7,0),u.addMany(o(32,48),4,9,5),u.addMany(o(32,48),1,9,2),u.addMany(o(32,48),2,9,2),u.addMany(o(48,127),2,10,0),u.addMany(o(48,80),1,10,0),u.addMany(o(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(o(96,127),1,10,0),u.add(80,1,11,9),u.addMany(p,9,0,9),u.add(127,9,0,9),u.addMany(o(28,32),9,0,9),u.addMany(o(32,48),9,9,12),u.addMany(o(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(p,11,0,11),u.addMany(o(32,128),11,0,11),u.addMany(o(28,32),11,0,11),u.addMany(p,10,0,10),u.add(127,10,0,10),u.addMany(o(28,32),10,0,10),u.addMany(o(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(o(32,48),10,9,12),u.addMany(p,12,0,12),u.add(127,12,0,12),u.addMany(o(28,32),12,0,12),u.addMany(o(32,48),12,9,12),u.addMany(o(48,64),12,0,11),u.addMany(o(64,127),12,12,13),u.addMany(o(64,127),10,12,13),u.addMany(o(64,127),9,12,13),u.addMany(p,13,13,13),u.addMany(c,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(k,0,2,0),u.add(k,8,5,8),u.add(k,6,0,6),u.add(k,11,0,11),u.add(k,13,13,13),u}();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 C=l.intermediates.charCodeAt(g);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=C}}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,C=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],C=this._transitions.table[this.currentState<<8|(g<160?g:k)],C>>4){case 2:for(let O=v+1;;++O){if(O>=o||(g=l[O])<32||g>126&&g<k){this._printHandler(l,v,O),v=O-1;break}if(++O>=o||(g=l[O])<32||g>126&&g<k){this._printHandler(l,v,O),v=O-1;break}if(++O>=o||(g=l[O])<32||g>126&&g<k){this._printHandler(l,v,O),v=O-1;break}if(++O>=o||(g=l[O])<32||g>126&&g<k){this._printHandler(l,v,O),v=O-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,C,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 P=this._escHandlers[this._collect<<8|g];let A=P?P.length-1:-1;for(;A>=0&&(p=P[A](),p!==!0);A--)if(p instanceof Promise)return this._preserveStack(4,P,A,C,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 O=v+1;;++O)if(O>=o||(g=l[O])===24||g===26||g===27||g>127&&g<k){this._dcsParser.put(l,v,O),v=O-1;break}break;case 14:if(p=this._dcsParser.unhook(g!==24&&g!==26),p)return this._preserveStack(6,[],0,C,v),p;g===27&&(C|=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 O=v+1;;O++)if(O>=o||(g=l[O])<32||g>127&&g<k){this._oscParser.put(l,v,O),v=O-1;break}break;case 6:if(p=this._oscParser.end(g!==24&&g!==26),p)return this._preserveStack(5,[],0,C,v),p;g===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}n.EscapeSequenceParser=S},6242:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=h(5770),y=h(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,w){this._handlers[m]===void 0&&(this._handlers[m]=[]);const k=this._handlers[m];return k.push(w),{dispose:()=>{const S=k.indexOf(w);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,w,k){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(m,w,k);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(m,w,k))}start(){this.reset(),this._state=1}put(m,w,k){if(this._state!==3){if(this._state===1)for(;w<k;){const S=m[w++];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-w>0&&this._put(m,w,k)}}end(m,w=!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,u=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,k=w,u=this._stack.fallThrough,this._stack.paused=!1),!u&&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,w,k){this._hitLimit||(this._data+=(0,y.utf32ToString)(m,w,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let w=!1;if(this._hitLimit)w=!1;else if(m&&(w=this._handler(this._data),w instanceof Promise))return w.then(k=>(this._data="",this._hitLimit=!1,k));return this._data="",this._hitLimit=!1,w}}},8742:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const h=2147483647;class d{static fromArray(f){const m=new d;if(!f.length)return m;for(let w=Array.isArray(f[0])?1:0;w<f.length;++w){const k=f[w];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 w=this._subParamsIdx[m]>>8,k=255&this._subParamsIdx[m];k-w>0&&f.push(Array.prototype.slice.call(this._subParams,w,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>h?h: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>h?h: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,w=255&this._subParamsIdx[f];return w-m>0?this._subParams.subarray(m,w):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const w=this._subParamsIdx[m]>>8,k=255&this._subParamsIdx[m];k-w>0&&(f[m]=this._subParams.slice(w,k))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,k=w[m-1];w[m-1]=~k?Math.min(10*k+f,h):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 h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(d,1)}}},8771:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=h(3785),y=h(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=h(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=h(8771),y=h(8460),f=h(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(h){this._core=h}registerCsiHandler(h,d){return this._core.registerCsiHandler(h,y=>d(y.toArray()))}addCsiHandler(h,d){return this.registerCsiHandler(h,d)}registerDcsHandler(h,d){return this._core.registerDcsHandler(h,(y,f)=>d(y,f.toArray()))}addDcsHandler(h,d){return this.registerDcsHandler(h,d)}registerEscHandler(h,d){return this._core.registerEscHandler(h,d)}addEscHandler(h,d){return this.registerEscHandler(h,d)}registerOscHandler(h,d){return this._core.registerOscHandler(h,d)}addOscHandler(h,d){return this.registerOscHandler(h,d)}}},7090:(_,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(_,n,h){var d=this&&this.__decorate||function(u,l,o,c){var p,g=arguments.length,C=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,c);else for(var x=u.length-1;x>=0;x--)(p=u[x])&&(C=(g<3?p(C):g>3?p(l,o,C):p(l,o))||C);return g>3&&C&&Object.defineProperty(l,o,C),C},y=this&&this.__param||function(u,l){return function(o,c){l(o,c,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const f=h(8460),m=h(844),w=h(5295),k=h(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let S=n.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(u){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(u.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const o=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===u.fg&&c.getBg(0)===u.bg||(c=o.getBlankLine(u,l),this._cachedBlankLine=c),c.isWrapped=l;const p=o.ybase+o.scrollTop,g=o.ybase+o.scrollBottom;if(o.scrollTop===0){const C=o.lines.isFull;g===o.lines.length-1?C?o.lines.recycle().copyFrom(c):o.lines.push(c.clone()):o.lines.splice(g+1,0,c.clone()),C?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const C=g-p+1;o.lines.shiftElements(p+1,C-1,-1),o.lines.set(g,c.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(u,l,o){const c=this.buffer;if(u<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else u+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+u,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(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,d){this._charsets[h]=d,this.glevel===h&&(this.charset=d)}}},1753:function(_,n,h){var d=this&&this.__decorate||function(c,p,g,C){var x,v=arguments.length,b=v<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,g):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(c,p,g,C);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,C){p(g,C,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const f=h(2585),m=h(8460),w=h(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 u=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${u(p[0])}${u(p[1])}${u(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 w.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,h){var d=this&&this.__decorate||function(o,c,p,g){var C,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--)(C=o[b])&&(v=(x<3?C(v):x>3?C(c,p,v):C(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=h(1439),m=h(8460),w=h(844),k=h(2585),S=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=n.CoreService=class extends w.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)(u)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(u)}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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=h(8055),y=h(8460),f=h(844),m=h(6106);let w=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 u(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,C,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+((C=R.options.width)!==null&&C!==void 0?C: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,C=>{var x,v,b;w=(x=C.options.x)!==null&&x!==void 0?x:0,k=w+((v=C.options.width)!==null&&v!==void 0?v:1),o>=w&&o<k&&(!p||((b=C.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&g(C)})}}n.DecorationService=S;class u 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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=h(2585),y=h(8343);class f{constructor(...w){this._entries=new Map;for(const[k,S]of w)this.set(k,S)}set(w,k){const S=this._entries.get(w);return this._entries.set(w,k),S}forEach(w){for(const[k,S]of this._entries.entries())w(k,S)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}n.ServiceCollection=f,n.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(m,w){this._services.set(m,w)}getService(m){return this._services.get(m)}createInstance(m,...w){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 u=k.length>0?k[0].index:w.length;if(w.length!==u)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${u+1} conflicts with ${w.length} static arguments`);return new m(...w,...S)}}},7866:function(_,n,h){var d=this&&this.__decorate||function(u,l,o,c){var p,g=arguments.length,C=g<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,l,o,c);else for(var x=u.length-1;x>=0;x--)(p=u[x])&&(C=(g<3?p(C):g>3?p(l,o,C):p(l,o))||C);return g>3&&C&&Object.defineProperty(l,o,C),C},y=this&&this.__param||function(u,l){return function(o,c){l(o,c,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const f=h(844),m=h(2585),w={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(u){super(),this._optionsService=u,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),k=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,o){this._evalLazyOptionalParams(o),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(u,...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,u,l)}debug(u,...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,u,l)}info(u,...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,u,l)}warn(u,...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,u,l)}error(u,...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,u,l)}};n.LogService=S=d([y(0,m.IOptionsService)],S),n.setTraceLogger=function(u){k=u},n.traceCall=function(u,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(C=>JSON.stringify(C)).join(", ")})`);const g=c.apply(this,p);return k.trace(`GlyphRenderer#${c.name} return`,g),g}}},7302:(_,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=h(8460),y=h(844),f=h(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 w extends y.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u=Object.assign({},n.DEFAULT_OPTIONS);for(const l in S)if(l in u)try{const o=S[l];u[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=u,this.options=Object.assign({},u),this._setupOptions()}onSpecificOptionChange(S,u){return this.onOptionChange(l=>{l===S&&u(this.rawOptions[S])})}onMultipleOptionChange(S,u){return this.onOptionChange(l=>{S.indexOf(l)!==-1&&u()})}_setupOptions(){const S=l=>{if(!(l in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(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:u.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(S,u){switch(S){case"cursorStyle":if(u||(u=n.DEFAULT_OPTIONS[S]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${S}`);break;case"wordSeparator":u||(u=n.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=m.includes(u)?u:n.DEFAULT_OPTIONS[S];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${S} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${S} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}n.OptionsService=w},2660:function(_,n,h){var d=this&&this.__decorate||function(w,k,S,u){var l,o=arguments.length,c=o<3?k:u===null?u=Object.getOwnPropertyDescriptor(k,S):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(w,k,S,u);else for(var p=w.length-1;p>=0;p--)(l=w[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(w,k){return function(S,u){k(S,u,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const f=h(2585);let m=n.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const k=this._bufferService.buffer;if(w.id===void 0){const p=k.addMarker(k.ybase+k.y),g={data:w,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(g,p)),this._dataByLinkId.set(g.id,g),g.id}const S=w,u=this._getEntryIdKey(S),l=this._entriesWithId.get(u);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(w,k){const S=this._dataByLinkId.get(w);if(S&&S.lines.every(u=>u.line!==k)){const u=this._bufferService.buffer.addMarker(k);S.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(S,u))}}getLinkData(w){var k;return(k=this._dataByLinkId.get(w))===null||k===void 0?void 0:k.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,k){const S=w.lines.indexOf(k);S!==-1&&(w.lines.splice(S,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.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 h="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,w,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,u,l){u[h]===u?u[d].push({id:S,index:l}):(u[d]=[{id:S,index:l}],u[h]=u)})(f,m,k)};return f.toString=()=>y,n.serviceRegistry.set(y,f),f}},2585:(_,n,h)=>{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=h(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,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=h(8460),y=h(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 w=f.length;for(let k=0;k<w;++k){let S=f.charCodeAt(k);if(55296<=S&&S<=56319){if(++k>=w)return m+this.wcwidth(S);const u=f.charCodeAt(k);56320<=u&&u<=57343?S=1024*(S-55296)+u-56320+65536:m+=this.wcwidth(u)}m+=this.wcwidth(S)}return m}}}},i={};function s(_){var n=i[_];if(n!==void 0)return n.exports;var h=i[_]={exports:{}};return r[_].call(h.exports,h,h.exports,s),h.exports}var a={};return(()=>{var _=a;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const n=s(9042),h=s(3236),d=s(844),y=s(5741),f=s(8285),m=s(7975),w=s(7090),k=["cols","rows"];class S extends d.Disposable{constructor(l){super(),this._core=this.register(new h.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 w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new 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})())})(Pf);var Dv=Pf.exports,Ce;(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})(Ce||(Ce={}));var Ju;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ju||(Ju={}));const ie=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=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}},Y=Ce.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 Cr 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,h=0;for(;h<_.path.length;){const d=_.path[h];h===_.path.length-1?(n[d]=n[d]||{_errors:[]},n[d]._errors.push(r(_))):n[d]=n[d]||{_errors:[]},n=n[d],h++}}};return s(this),i}static assert(t){if(!(t instanceof Cr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.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()}}Cr.create=e=>new Cr(e);const wl=(e,t)=>{let r;switch(e.code){case Y.invalid_type:e.received===ie.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case Y.invalid_union:r="Invalid input";break;case Y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case Y.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case Y.invalid_arguments:r="Invalid function arguments";break;case Y.invalid_return_type:r="Invalid function return type";break;case Y.invalid_date:r="Invalid date";break;case Y.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Y.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 Y.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 Y.custom:r="Invalid input";break;case Y.invalid_intersection_types:r="Intersection results could not be merged";break;case Y.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Y.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}};let Av=wl;function Mv(){return Av}const Pv=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 h=i.filter(d=>!!d).slice().reverse();for(const d of h)n=d(_,{data:t,defaultError:n}).message;return{...s,path:a,message:n}};function ee(e,t){const r=Mv(),i=Pv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wl?void 0:wl].filter(s=>!!s)});e.common.issues.push(i)}class Dt{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 he;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 Dt.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 he;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 he=Object.freeze({status:"aborted"}),Rs=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),eh=e=>e.status==="aborted",th=e=>e.status==="dirty",ls=e=>e.status==="valid",So=e=>typeof Promise<"u"&&e instanceof Promise;var ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ae||(ae={}));class Gr{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 rh=(e,t)=>{if(ls(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 Cr(e.common.issues);return this._error=r,this._error}}};function ve(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:h}=e;return _.code==="invalid_enum_value"?{message:h??n.defaultError}:typeof n.data>"u"?{message:h??i??n.defaultError}:_.code!=="invalid_type"?{message:n.defaultError}:{message:h??r??n.defaultError}},description:s}}class we{get description(){return this._def.description}_getType(t){return Pr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(So(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:Pr(t)},s=this._parseSync({data:t,path:i.path,parent:i});return rh(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:Pr(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return ls(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=>ls(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:Pr(t)},s=this._parse({data:t,path:i.path,parent:i}),a=await(So(s)?s:Promise.resolve(s));return rh(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:Y.custom,...i(s)});return typeof Promise<"u"&&_ instanceof Promise?_.then(h=>h?!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 Ci({schema:this,typeName:de.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 mr.create(this,this._def)}nullable(){return ki.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lr.create(this)}promise(){return xo.create(this,this._def)}or(t){return Co.create([this,t],this._def)}and(t){return ko.create(this,t,this._def)}transform(t){return new Ci({...ve(this._def),schema:this,typeName:de.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Eo({...ve(this._def),innerType:this,defaultValue:r,typeName:de.ZodDefault})}brand(){return new Hf({typeName:de.ZodBranded,type:this,...ve(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Lo({...ve(this._def),innerType:this,catchValue:r,typeName:de.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return kc.create(this,t)}readonly(){return Ro.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ov=/^c[^\s-]{8,}$/i,Bv=/^[0-9a-z]+$/,Iv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nv=/^[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,Hv=/^[a-z0-9_-]{21}$/i,jv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fv=/^[-+]?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)?)??$/,zv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Uv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let La;const Wv=/^(?:(?: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])$/,$v=/^(?:(?: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])$/,Vv=/^(([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]))$/,Kv=/^(([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])$/,Zv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Bf="((\\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])))",Xv=new RegExp(`^${Bf}$`);function If(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 Yv(e){return new RegExp(`^${If(e)}$`)}function Gv(e){let t=`${Bf}T${If(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 Qv(e,t){return!!((t==="v4"||!t)&&Wv.test(e)||(t==="v6"||!t)&&Vv.test(e))}function Jv(e,t){if(!jv.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 em(e,t){return!!((t==="v4"||!t)&&$v.test(e)||(t==="v6"||!t)&&Kv.test(e))}class jr extends we{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ie.string){const a=this._getOrReturnCtx(t);return ee(a,{code:Y.invalid_type,expected:ie.string,received:a.parsedType}),he}const i=new Dt;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.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),ee(s,{code:Y.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),_?ee(s,{code:Y.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):n&&ee(s,{code:Y.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")zv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"email",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")La||(La=new RegExp(Uv,"u")),La.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"emoji",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")Nv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"uuid",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="nanoid")Hv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"nanoid",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")Ov.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cuid",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")Bv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cuid2",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")Iv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"ulid",code:Y.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ee(s,{validation:"url",code:Y.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),ee(s,{validation:"regex",code:Y.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),ee(s,{code:Y.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),ee(s,{code:Y.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?Gv(a).test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="date"?Xv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.invalid_string,validation:"date",message:a.message}),i.dirty()):a.kind==="time"?Yv(a).test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.invalid_string,validation:"time",message:a.message}),i.dirty()):a.kind==="duration"?Fv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"duration",code:Y.invalid_string,message:a.message}),i.dirty()):a.kind==="ip"?Qv(t.data,a.version)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"ip",code:Y.invalid_string,message:a.message}),i.dirty()):a.kind==="jwt"?Jv(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"jwt",code:Y.invalid_string,message:a.message}),i.dirty()):a.kind==="cidr"?em(t.data,a.version)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cidr",code:Y.invalid_string,message:a.message}),i.dirty()):a.kind==="base64"?Zv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"base64",code:Y.invalid_string,message:a.message}),i.dirty()):a.kind==="base64url"?qv.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"base64url",code:Y.invalid_string,message:a.message}),i.dirty()):Ce.assertNever(a);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(s=>t.test(s),{validation:r,code:Y.invalid_string,...ae.errToObj(i)})}_addCheck(t){return new jr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ae.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ae.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,...ae.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,...ae.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...ae.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ae.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ae.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ae.errToObj(r)})}nonempty(t){return this.min(1,ae.errToObj(t))}trim(){return new jr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jr({...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}}jr.create=e=>new jr({checks:[],typeName:de.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ve(e)});function tm(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 cs extends we{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 ee(a,{code:Y.invalid_type,expected:ie.number,received:a.parsedType}),he}let i;const s=new Dt;for(const a of this._def.checks)a.kind==="int"?Ce.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),ee(i,{code:Y.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),ee(i,{code:Y.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),ee(i,{code:Y.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?tm(t.data,a.value)!==0&&(i=this._getOrReturnCtx(t,i),ee(i,{code:Y.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),ee(i,{code:Y.not_finite,message:a.message}),s.dirty()):Ce.assertNever(a);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,i,s){return new cs({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:ae.toString(s)}]})}_addCheck(t){return new cs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.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"&&Ce.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)}}cs.create=e=>new cs({checks:[],typeName:de.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ve(e)});class tn extends we{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 Dt;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),ee(i,{code:Y.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),ee(i,{code:Y.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),ee(i,{code:Y.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Ce.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ee(r,{code:Y.invalid_type,expected:ie.bigint,received:r.parsedType}),he}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,i,s){return new tn({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:ae.toString(s)}]})}_addCheck(t){return new tn({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.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}}tn.create=e=>new tn({checks:[],typeName:de.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ve(e)});class Cl extends we{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ie.boolean){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.boolean,received:i.parsedType}),he}return Ut(t.data)}}Cl.create=e=>new Cl({typeName:de.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ve(e)});class wo extends we{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ie.date){const a=this._getOrReturnCtx(t);return ee(a,{code:Y.invalid_type,expected:ie.date,received:a.parsedType}),he}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return ee(a,{code:Y.invalid_date}),he}const i=new Dt;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:Y.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),ee(s,{code:Y.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):Ce.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new wo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ae.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ae.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}}wo.create=e=>new wo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:de.ZodDate,...ve(e)});class ih extends we{_parse(t){if(this._getType(t)!==ie.symbol){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.symbol,received:i.parsedType}),he}return Ut(t.data)}}ih.create=e=>new ih({typeName:de.ZodSymbol,...ve(e)});class kl extends we{_parse(t){if(this._getType(t)!==ie.undefined){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.undefined,received:i.parsedType}),he}return Ut(t.data)}}kl.create=e=>new kl({typeName:de.ZodUndefined,...ve(e)});class bl extends we{_parse(t){if(this._getType(t)!==ie.null){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.null,received:i.parsedType}),he}return Ut(t.data)}}bl.create=e=>new bl({typeName:de.ZodNull,...ve(e)});class sh extends we{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}}sh.create=e=>new sh({typeName:de.ZodAny,...ve(e)});class nh extends we{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}}nh.create=e=>new nh({typeName:de.ZodUnknown,...ve(e)});class Qr extends we{_parse(t){const r=this._getOrReturnCtx(t);return ee(r,{code:Y.invalid_type,expected:ie.never,received:r.parsedType}),he}}Qr.create=e=>new Qr({typeName:de.ZodNever,...ve(e)});class oh extends we{_parse(t){if(this._getType(t)!==ie.undefined){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.void,received:i.parsedType}),he}return Ut(t.data)}}oh.create=e=>new oh({typeName:de.ZodVoid,...ve(e)});class lr extends we{_parse(t){const{ctx:r,status:i}=this._processInputParams(t),s=this._def;if(r.parsedType!==ie.array)return ee(r,{code:Y.invalid_type,expected:ie.array,received:r.parsedType}),he;if(s.exactLength!==null){const _=r.data.length>s.exactLength.value,n=r.data.length<s.exactLength.value;(_||n)&&(ee(r,{code:_?Y.too_big:Y.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&&(ee(r,{code:Y.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&&(ee(r,{code:Y.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 Gr(r,_,r.path,n)))).then(_=>Dt.mergeArray(i,_));const a=[...r.data].map((_,n)=>s.type._parseSync(new Gr(r,_,r.path,n)));return Dt.mergeArray(i,a)}get element(){return this._def.type}min(t,r){return new lr({...this._def,minLength:{value:t,message:ae.toString(r)}})}max(t,r){return new lr({...this._def,maxLength:{value:t,message:ae.toString(r)}})}length(t,r){return new lr({...this._def,exactLength:{value:t,message:ae.toString(r)}})}nonempty(t){return this.min(1,t)}}lr.create=(e,t)=>new lr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:de.ZodArray,...ve(t)});function Ii(e){if(e instanceof Ke){const t={};for(const r in e.shape){const i=e.shape[r];t[r]=mr.create(Ii(i))}return new Ke({...e._def,shape:()=>t})}else return e instanceof lr?new lr({...e._def,type:Ii(e.element)}):e instanceof mr?mr.create(Ii(e.unwrap())):e instanceof ki?ki.create(Ii(e.unwrap())):e instanceof Si?Si.create(e.items.map(t=>Ii(t))):e}class Ke extends we{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=Ce.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 ee(d,{code:Y.invalid_type,expected:ie.object,received:d.parsedType}),he}const{status:i,ctx:s}=this._processInputParams(t),{shape:a,keys:_}=this._getCached(),n=[];if(!(this._def.catchall instanceof Qr&&this._def.unknownKeys==="strip"))for(const d in s.data)_.includes(d)||n.push(d);const h=[];for(const d of _){const y=a[d],f=s.data[d];h.push({key:{status:"valid",value:d},value:y._parse(new Gr(s,f,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Qr){const d=this._def.unknownKeys;if(d==="passthrough")for(const y of n)h.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(d==="strict")n.length>0&&(ee(s,{code:Y.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];h.push({key:{status:"valid",value:y},value:d._parse(new Gr(s,f,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const y of h){const f=await y.key,m=await y.value;d.push({key:f,value:m,alwaysSet:y.alwaysSet})}return d}).then(d=>Dt.mergeObjectSync(i,d)):Dt.mergeObjectSync(i,h)}get shape(){return this._def.shape()}strict(t){return ae.errToObj,new Ke({...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:ae.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ke({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ke({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:de.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ke({...this._def,catchall:t})}pick(t){const r={};for(const i of Ce.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new Ke({...this._def,shape:()=>r})}omit(t){const r={};for(const i of Ce.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new Ke({...this._def,shape:()=>r})}deepPartial(){return Ii(this)}partial(t){const r={};for(const i of Ce.objectKeys(this.shape)){const s=this.shape[i];t&&!t[i]?r[i]=s:r[i]=s.optional()}return new Ke({...this._def,shape:()=>r})}required(t){const r={};for(const i of Ce.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let a=this.shape[i];for(;a instanceof mr;)a=a._def.innerType;r[i]=a}return new Ke({...this._def,shape:()=>r})}keyof(){return Nf(Ce.objectKeys(this.shape))}}Ke.create=(e,t)=>new Ke({shape:()=>e,unknownKeys:"strip",catchall:Qr.create(),typeName:de.ZodObject,...ve(t)});Ke.strictCreate=(e,t)=>new Ke({shape:()=>e,unknownKeys:"strict",catchall:Qr.create(),typeName:de.ZodObject,...ve(t)});Ke.lazycreate=(e,t)=>new Ke({shape:e,unknownKeys:"strip",catchall:Qr.create(),typeName:de.ZodObject,...ve(t)});class Co extends we{_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 Cr(n.ctx.common.issues));return ee(r,{code:Y.invalid_union,unionErrors:_}),he}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 h of i){const d={...r,common:{...r.common,issues:[]},parent:null},y=h._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(h=>new Cr(h));return ee(r,{code:Y.invalid_union,unionErrors:n}),he}}get options(){return this._def.options}}Co.create=(e,t)=>new Co({options:e,typeName:de.ZodUnion,...ve(t)});const hr=e=>e instanceof El?hr(e.schema):e instanceof Ci?hr(e.innerType()):e instanceof bo?[e.value]:e instanceof wi?e.options:e instanceof Ll?Ce.objectValues(e.enum):e instanceof Eo?hr(e._def.innerType):e instanceof kl?[void 0]:e instanceof bl?[null]:e instanceof mr?[void 0,...hr(e.unwrap())]:e instanceof ki?[null,...hr(e.unwrap())]:e instanceof Hf||e instanceof Ro?hr(e.unwrap()):e instanceof Lo?hr(e._def.innerType):[];class Cc extends we{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ie.object)return ee(r,{code:Y.invalid_type,expected:ie.object,received:r.parsedType}),he;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}):(ee(r,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),he)}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 _=hr(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 Cc({typeName:de.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ve(i)})}}function xl(e,t){const r=Pr(e),i=Pr(t);if(e===t)return{valid:!0,data:e};if(r===ie.object&&i===ie.object){const s=Ce.objectKeys(t),a=Ce.objectKeys(e).filter(n=>s.indexOf(n)!==-1),_={...e,...t};for(const n of a){const h=xl(e[n],t[n]);if(!h.valid)return{valid:!1};_[n]=h.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],h=xl(_,n);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return r===ie.date&&i===ie.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ko extends we{_parse(t){const{status:r,ctx:i}=this._processInputParams(t),s=(a,_)=>{if(eh(a)||eh(_))return he;const n=xl(a.value,_.value);return n.valid?((th(a)||th(_))&&r.dirty(),{status:r.value,value:n.data}):(ee(i,{code:Y.invalid_intersection_types}),he)};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}))}}ko.create=(e,t,r)=>new ko({left:e,right:t,typeName:de.ZodIntersection,...ve(r)});class Si extends we{_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ie.array)return ee(i,{code:Y.invalid_type,expected:ie.array,received:i.parsedType}),he;if(i.data.length<this._def.items.length)return ee(i,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),he;!this._def.rest&&i.data.length>this._def.items.length&&(ee(i,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...i.data].map((_,n)=>{const h=this._def.items[n]||this._def.rest;return h?h._parse(new Gr(i,_,i.path,n)):null}).filter(_=>!!_);return i.common.async?Promise.all(a).then(_=>Dt.mergeArray(r,_)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Si({...this._def,rest:t})}}Si.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Si({items:e,typeName:de.ZodTuple,rest:null,...ve(t)})};class ah extends we{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 ee(i,{code:Y.invalid_type,expected:ie.map,received:i.parsedType}),he;const s=this._def.keyType,a=this._def.valueType,_=[...i.data.entries()].map(([n,h],d)=>({key:s._parse(new Gr(i,n,i.path,[d,"key"])),value:a._parse(new Gr(i,h,i.path,[d,"value"]))}));if(i.common.async){const n=new Map;return Promise.resolve().then(async()=>{for(const h of _){const d=await h.key,y=await h.value;if(d.status==="aborted"||y.status==="aborted")return he;(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 h of _){const d=h.key,y=h.value;if(d.status==="aborted"||y.status==="aborted")return he;(d.status==="dirty"||y.status==="dirty")&&r.dirty(),n.set(d.value,y.value)}return{status:r.value,value:n}}}}ah.create=(e,t,r)=>new ah({valueType:t,keyType:e,typeName:de.ZodMap,...ve(r)});class rn extends we{_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==ie.set)return ee(i,{code:Y.invalid_type,expected:ie.set,received:i.parsedType}),he;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ee(i,{code:Y.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&&(ee(i,{code:Y.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function _(h){const d=new Set;for(const y of h){if(y.status==="aborted")return he;y.status==="dirty"&&r.dirty(),d.add(y.value)}return{status:r.value,value:d}}const n=[...i.data.values()].map((h,d)=>a._parse(new Gr(i,h,i.path,d)));return i.common.async?Promise.all(n).then(h=>_(h)):_(n)}min(t,r){return new rn({...this._def,minSize:{value:t,message:ae.toString(r)}})}max(t,r){return new rn({...this._def,maxSize:{value:t,message:ae.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}rn.create=(e,t)=>new rn({valueType:e,minSize:null,maxSize:null,typeName:de.ZodSet,...ve(t)});class El extends we{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})}}El.create=(e,t)=>new El({getter:e,typeName:de.ZodLazy,...ve(t)});class bo extends we{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:Y.invalid_literal,expected:this._def.value}),he}return{status:"valid",value:t.data}}get value(){return this._def.value}}bo.create=(e,t)=>new bo({value:e,typeName:de.ZodLiteral,...ve(t)});function Nf(e,t){return new wi({values:e,typeName:de.ZodEnum,...ve(t)})}class wi extends we{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),i=this._def.values;return ee(r,{expected:Ce.joinValues(i),received:r.parsedType,code:Y.invalid_type}),he}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 ee(r,{received:r.data,code:Y.invalid_enum_value,options:i}),he}return Ut(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 wi.create(t,{...this._def,...r})}exclude(t,r=this._def){return wi.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}wi.create=Nf;class Ll extends we{_parse(t){const r=Ce.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Ce.objectValues(r);return ee(i,{expected:Ce.joinValues(s),received:i.parsedType,code:Y.invalid_type}),he}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ce.objectValues(r);return ee(i,{received:i.data,code:Y.invalid_enum_value,options:s}),he}return Ut(t.data)}get enum(){return this._def.values}}Ll.create=(e,t)=>new Ll({values:e,typeName:de.ZodNativeEnum,...ve(t)});class xo extends we{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ie.promise&&r.common.async===!1)return ee(r,{code:Y.invalid_type,expected:ie.promise,received:r.parsedType}),he;const i=r.parsedType===ie.promise?r.data:Promise.resolve(r.data);return Ut(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}xo.create=(e,t)=>new xo({type:e,typeName:de.ZodPromise,...ve(t)});class Ci extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===de.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:_=>{ee(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 he;const h=await this._def.schema._parseAsync({data:n,path:i.path,parent:i});return h.status==="aborted"?he:h.status==="dirty"||r.value==="dirty"?Rs(h.value):h});{if(r.value==="aborted")return he;const n=this._def.schema._parseSync({data:_,path:i.path,parent:i});return n.status==="aborted"?he:n.status==="dirty"||r.value==="dirty"?Rs(n.value):n}}if(s.type==="refinement"){const _=n=>{const h=s.refinement(n,a);if(i.common.async)return Promise.resolve(h);if(h 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"?he:(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"?he:(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(!ls(_))return he;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(_=>ls(_)?Promise.resolve(s.transform(_.value,a)).then(n=>({status:r.value,value:n})):he);Ce.assertNever(s)}}Ci.create=(e,t,r)=>new Ci({schema:e,typeName:de.ZodEffects,effect:t,...ve(r)});Ci.createWithPreprocess=(e,t,r)=>new Ci({schema:t,effect:{type:"preprocess",transform:e},typeName:de.ZodEffects,...ve(r)});class mr extends we{_parse(t){return this._getType(t)===ie.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}mr.create=(e,t)=>new mr({innerType:e,typeName:de.ZodOptional,...ve(t)});class ki extends we{_parse(t){return this._getType(t)===ie.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ki.create=(e,t)=>new ki({innerType:e,typeName:de.ZodNullable,...ve(t)});class Eo extends we{_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}}Eo.create=(e,t)=>new Eo({innerType:e,typeName:de.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ve(t)});class Lo extends we{_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 So(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Cr(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Cr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Lo.create=(e,t)=>new Lo({innerType:e,typeName:de.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ve(t)});class lh extends we{_parse(t){if(this._getType(t)!==ie.nan){const i=this._getOrReturnCtx(t);return ee(i,{code:Y.invalid_type,expected:ie.nan,received:i.parsedType}),he}return{status:"valid",value:t.data}}}lh.create=e=>new lh({typeName:de.ZodNaN,...ve(e)});class Hf extends we{_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 kc extends we{_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"?he: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"?he: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 kc({in:t,out:r,typeName:de.ZodPipeline})}}class Ro extends we{_parse(t){const r=this._def.innerType._parse(t),i=s=>(ls(s)&&(s.value=Object.freeze(s.value)),s);return So(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}}Ro.create=(e,t)=>new Ro({innerType:e,typeName:de.ZodReadonly,...ve(t)});var de;(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"})(de||(de={}));const qe=jr.create,Fr=cs.create,Ir=Cl.create;Qr.create;const rm=lr.create,ze=Ke.create;Co.create;const jf=Cc.create;ko.create;Si.create;const Ve=bo.create;wi.create;xo.create;mr.create;ki.create;jf("type",[ze({type:Ve("input"),data:qe().min(1)}),ze({type:Ve("resize"),cols:Fr().int().min(2),rows:Fr().int().min(2)}),ze({type:Ve("typing"),active:Ir()}),ze({type:Ve("toggle_collab"),enabled:Ir()}),ze({type:Ve("take_control")}),ze({type:Ve("release_control")}),ze({type:Ve("ping"),t:Fr()}),ze({type:Ve("kill_session")})]);var im=ze({id:qe(),name:qe(),color:qe(),typing:Ir(),lastActive:Fr()}),sm=jf("type",[ze({type:Ve("hello"),clientId:qe(),roomId:qe(),color:qe(),collabMode:Ir(),controllerId:qe().nullable(),created:Ir().optional()}),ze({type:Ve("presence"),clients:rm(im)}),ze({type:Ve("output"),data:qe()}),ze({type:Ve("snapshot"),data:qe(),alternateScreen:Ir().optional(),cursorHidden:Ir().optional()}),ze({type:Ve("collab"),enabled:Ir(),controllerId:qe().nullable()}),ze({type:Ve("input_rejected"),reason:qe()}),ze({type:Ve("error"),message:qe()}),ze({type:Ve("session_ended"),exitCode:Fr().int().nullable(),signal:qe().nullable(),message:qe(),by:qe().optional()}),ze({type:Ve("session_renamed"),displayName:qe()}),ze({type:Ve("cwd_changed"),cwd:qe()}),ze({type:Ve("pong"),t:Fr()}),ze({type:Ve("active_size"),clientId:qe(),cols:Fr().int(),rows:Fr().int()})]),nm=e=>{try{const t=JSON.parse(e),r=sm.safeParse(t);return r.success?r.data:null}catch{return null}};const om=(e,t)=>[...e].sort((r,i)=>t&&r.id===t?-1:t&&i.id===t?1:r.name.localeCompare(i.name)),am=e=>e.typing?"typing":(Date.now()-e.lastActive)/1e3<15?"active":"idle",lm=800,cm=e=>{const t=e.charCodeAt(0);return t>=32&&t<=126},um=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}cm(i)&&(t+=i),r+=1}return t},hm=(e={})=>{const t=e.maxPendingMs??lm,r=e.now??(()=>Date.now());let i="",s=0,a=0;return{onInput:(y,f)=>{if(!f)return"";const m=um(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}},ch=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgent||"";return/iPad|iPhone|iPod/.test(e)},dm={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"]]},fm=[{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"}],_m=({filled:e})=>I.jsx("svg",{viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",fill:e?"currentColor":"none",children:I.jsx("path",{d:"M12 4L4 16h16L12 4z"})}),pm=()=>I.jsxs("svg",{viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[I.jsx("path",{d:"M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"}),I.jsx("line",{x1:"18",y1:"9",x2:"12",y2:"15"}),I.jsx("line",{x1:"12",y1:"9",x2:"18",y2:"15"})]}),vm=()=>I.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[I.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"}),I.jsx("line",{x1:"6",y1:"10",x2:"6.01",y2:"10"}),I.jsx("line",{x1:"10",y1:"10",x2:"10.01",y2:"10"}),I.jsx("line",{x1:"14",y1:"10",x2:"14.01",y2:"10"}),I.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),I.jsx("line",{x1:"8",y1:"14",x2:"16",y2:"14"})]}),mm=()=>I.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[I.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"}),I.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]}),gm=({onInput:e,visible:t,onToggle:r,onHeightChange:i,hapticsEnabled:s=!0,onPasteFailed:a})=>{const[_,n]=U.useState("abc"),[h,d]=U.useState(!1),[y,f]=U.useState(!1),[m,w]=U.useState(!1),[k,S]=U.useState(!1),[u,l]=U.useState(!1),[o,c]=U.useState(!1),[p,g]=U.useState(!1),[C,x]=U.useState(""),v=U.useRef(0),b=U.useRef(null),R=U.useRef(null),P=U.useRef(null),A=U.useRef(null),O=U.useRef(null),F=U.useRef(e),W=U.useRef(h),Z=U.useRef(y),V=U.useRef(m),E=U.useRef(k),T=U.useRef(a);F.current=e,W.current=h,Z.current=y,V.current=m,E.current=k,T.current=a,U.useEffect(()=>{if(!ch())return;const K=document.createElement("input");K.type="checkbox",K.id="hay-haptic-switch",K.setAttribute("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);const G=document.createElement("label");return G.htmlFor="hay-haptic-switch",G.style.position="fixed",G.style.left="-9999px",G.style.top="-9999px",G.style.opacity="0",G.style.pointerEvents="none",document.body.appendChild(G),A.current=G,()=>{document.body.removeChild(K),document.body.removeChild(G),A.current=null}},[]);const D=K=>{K.currentTarget.classList.add("kb-pressed")},M=K=>{K.currentTarget.classList.remove("kb-pressed")},H=U.useCallback(()=>{var K;if(s)try{ch()?(K=A.current)==null||K.click():navigator.vibrate&&navigator.vibrate(5)}catch{}},[s]),q=U.useCallback(K=>{let G=K;if(V.current){if(K.length===1){const ge=K.toUpperCase().charCodeAt(0);ge>=65&&ge<=90&&(G=String.fromCharCode(ge-64))}w(!1)}E.current&&(G.length===1&&(G="\x1B"+G),S(!1)),F.current(G),W.current&&!Z.current&&G.length===1&&(v.current=0)},[]),te=U.useCallback(async()=>{var K,G;try{if(navigator.clipboard&&navigator.clipboard.readText){const ge=await navigator.clipboard.readText();ge&&q(ge)}else(K=T.current)==null||K.call(T)}catch{(G=T.current)==null||G.call(T)}},[q]),J=U.useCallback(()=>{const K=P.current;if(!K)return;K.style.height="auto";const G=Math.min(window.innerHeight*.4,240);K.style.height=`${Math.min(K.scrollHeight,G)}px`},[]),fe=U.useCallback(()=>{var K;(K=P.current)==null||K.blur(),l(!1)},[]),L=U.useCallback(()=>{const K=P.current;if(!K)return;try{K.focus({preventScroll:!0})}catch{K.focus()}const G=K.value.length;typeof K.setSelectionRange=="function"&&K.setSelectionRange(G,G),J()},[J]),N=U.useCallback(()=>{Af.flushSync(()=>{l(!0)}),L()},[L]),$=U.useCallback(()=>{u?fe():N()},[u,fe,N]),z=U.useCallback(()=>{const K=C;K&&(q(K+"\r"),x("")),P.current&&(P.current.style.height=""),fe()},[q,fe,C]);U.useEffect(()=>{if(!u||!P.current)return;const G=()=>{L()},ge=requestAnimationFrame(G),$e=requestAnimationFrame(G);return()=>{cancelAnimationFrame(ge),cancelAnimationFrame($e)}},[u,J]),U.useEffect(()=>{u&&J()},[C,u,J]),U.useEffect(()=>{if(!t){i==null||i(0);return}const K=O.current;if(!K)return;const G=()=>{i==null||i(Math.ceil(K.getBoundingClientRect().height))};if(G(),window.addEventListener("resize",G),typeof ResizeObserver>"u")return()=>{window.removeEventListener("resize",G)};const ge=new ResizeObserver(G);return ge.observe(K),()=>{ge.disconnect(),window.removeEventListener("resize",G)}},[t,i]);const ne=U.useCallback(()=>{const K=Date.now(),G=v.current&&K-v.current<300;y?(f(!1),d(!1),v.current=0):h?G?(f(!0),d(!1),v.current=0):(d(!1),v.current=K):(d(!0),v.current=K)},[y,h]),Q=U.useCallback(()=>{q(""),b.current=window.setTimeout(()=>{R.current=window.setInterval(()=>{q("")},50)},500)},[q]),ye=U.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=null),R.current&&(clearInterval(R.current),R.current=null)},[]);U.useEffect(()=>{if(t&&!o)try{localStorage.getItem("hay-syskb-seen")?c(!0):(c(!0),setTimeout(()=>{g(!0),setTimeout(()=>{g(!1),localStorage.setItem("hay-syskb-seen","1")},4e3)},1e3))}catch{c(!0)}},[t,o]);const Oe=U.useCallback(K=>{const G=W.current||Z.current?K.toUpperCase():K;q(G),W.current&&!Z.current&&d(!1)},[q]),We=(K,G,ge)=>{const $e=h||y;if(K==="SHIFT")return I.jsx("button",{type:"button",className:`kb-key kb-act${$e?" kb-on":""}`,style:{flexGrow:1.25},onTouchStart:pe=>{pe.preventDefault(),D(pe),ne()},onTouchEnd:M,onTouchCancel:M,onClick:H,children:I.jsx(_m,{filled:$e})},K);if(K==="BKSP")return I.jsx("button",{type:"button",className:"kb-key kb-act",style:{flexGrow:1.25},onTouchStart:pe=>{pe.preventDefault(),D(pe),Q()},onTouchEnd:pe=>{M(pe),ye()},onTouchCancel:pe=>{M(pe),ye()},onClick:H,children:I.jsx(pm,{})},K);if(K==="PASTE")return I.jsx("button",{type:"button",className:"kb-key kb-act",style:{flexGrow:1.25},onTouchStart:D,onTouchEnd:pe=>{M(pe),te()},onTouchCancel:M,onClick:H,children:I.jsx(mm,{})},K);if(K==="RET")return I.jsx("button",{type:"button",className:"kb-key kb-pri kb-bottom",style:{flexGrow:2.5},onTouchStart:pe=>{pe.preventDefault(),D(pe),q("\r")},onTouchEnd:M,onTouchCancel:M,onClick:H,children:"return"},K);if(K==="SPACE")return I.jsx("button",{type:"button",className:"kb-key kb-bottom",style:{flexGrow:5},onTouchStart:pe=>{pe.preventDefault(),D(pe),q(" ")},onTouchEnd:M,onTouchCancel:M,onClick:H,children:"space"},K);if(K==="123")return I.jsx("button",{type:"button",className:"kb-key kb-act kb-bottom",style:{flexGrow:1.25},onTouchStart:pe=>{pe.preventDefault(),D(pe),n("num")},onTouchEnd:M,onTouchCancel:M,onClick:H,children:"123"},K);if(K==="ABC")return I.jsx("button",{type:"button",className:"kb-key kb-act kb-bottom",style:{flexGrow:1.25},onTouchStart:pe=>{pe.preventDefault(),D(pe),n("abc")},onTouchEnd:M,onTouchCancel:M,onClick:H,children:"ABC"},K);const Be=h||y?K.toUpperCase():K;return I.jsx("button",{type:"button",className:"kb-key",onTouchStart:pe=>{pe.preventDefault(),D(pe),Oe(K)},onTouchEnd:M,onTouchCancel:M,onClick:H,children:Be},`${K}-${G}`)};return t?I.jsxs(I.Fragment,{children:[p&&I.jsx("div",{className:"kb-hint-overlay",children:I.jsxs("div",{className:"kb-hint",children:["Tap the pulsing ",I.jsx("strong",{children:"KB"})," button for smooth typing with native keyboard, spellcheck, autocomplete and dictation"]})}),u&&I.jsx("div",{className:"kb-sys-overlay",onClick:$,children:I.jsx("div",{className:"kb-sys-dialog",onClick:K=>K.stopPropagation(),children:I.jsx("textarea",{ref:P,className:"kb-sys-input",placeholder:"Type here — return runs it...",autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",rows:1,value:C,onKeyDown:K=>{K.key==="Enter"&&(K.preventDefault(),z())},onChange:K=>{x(K.currentTarget.value)},onInput:J})})}),I.jsxs("div",{ref:O,className:"mobile-keyboard",children:[I.jsx("div",{className:"kb-acc-row",children:fm.map((K,G)=>{if(K.mod){const ge=K.mod==="ctrl"?m:k;return I.jsx("button",{type:"button",className:`kb-key kb-act kb-acc${ge?" kb-on":""}`,onTouchStart:$e=>{$e.preventDefault(),D($e),K.mod==="ctrl"?w(Be=>!Be):S(Be=>!Be)},onTouchEnd:M,onTouchCancel:M,onClick:H,children:K.label},K.label)}return K.fn==="sysKb"?I.jsx("button",{type:"button",className:`kb-key kb-act kb-acc kb-syskb${p?" kb-pulse":""}`,onTouchStart:ge=>{ge.preventDefault(),D(ge);try{localStorage.setItem("hay-syskb-seen","1")}catch{}$()},onTouchEnd:M,onTouchCancel:M,onClick:H,children:I.jsx(vm,{})},K.label):I.jsx("button",{type:"button",className:"kb-key kb-act kb-acc",onTouchStart:ge=>{ge.preventDefault(),D(ge),K.key&&q(K.key)},onTouchEnd:M,onTouchCancel:M,onClick:H,children:K.label},K.label)})}),I.jsx("div",{className:"kb-keys",children:dm[_].map((K,G)=>{const ge=G===2;return I.jsx("div",{className:`kb-row${G===1?" kb-r2":""}${ge?" kb-r3":""}`,children:K.map(($e,Be)=>{const pe=[];return $e==="SHIFT"&&ge?(pe.push(We($e,Be)),pe.push(I.jsx("div",{className:"kb-gap"},"gap-after-shift")),pe):$e==="BKSP"&&ge?(pe.push(I.jsx("div",{className:"kb-gap"},"gap-before-bksp")),pe.push(We($e,Be)),pe):We($e,Be)})},G)})})]})]}):null},ym=()=>`room-${Math.random().toString(36).slice(2,7)}`,Sm=e=>{const t=e.match(/^\/s\/([^/]+)\/?$/);if(!t)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}},uh=()=>{const e=Sm(window.location.pathname);return e||new URLSearchParams(window.location.search).get("room")},wm=e=>`/s/${encodeURIComponent(e)}/`,Cm=()=>{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`},Ra=e=>{const t=am(e);return t==="typing"?"typing":t==="active"?"active":"idle"},hh=e=>{const t=new URL(window.location.href);return t.searchParams.set("room",e),t.searchParams.delete("name"),t.toString()},dh={background:"#0d1117",foreground:"#e6edf3",cursor:"#60a5fa",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#e6edf3",black:"#0d1117",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#e5e7eb",brightBlack:"#6b7280",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde68a",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f9fafb"},fh={background:"#ffffff",foreground:"#000000",cursor:"#000000",cursorAccent:"#ffffff",selectionBackground:"#b5d5ff",selectionForeground:"#000000",selectionInactiveBackground:"#d0d0d0",black:"#000000",red:"#c91b00",green:"#00a600",yellow:"#c7c400",blue:"#0225c7",magenta:"#c930c7",cyan:"#00a6b2",white:"#c7c7c7",brightBlack:"#676767",brightRed:"#ff6d67",brightGreen:"#5ff967",brightYellow:"#fefb67",brightBlue:"#6871ff",brightMagenta:"#ff76ff",brightCyan:"#5ffdff",brightWhite:"#feffff"},_h=e=>e==="dark"?dh:e==="light"?fh:typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?dh:fh,ph=()=>{if(typeof window>"u")return!1;const e=navigator.userAgent||"";return/iPhone|iPad|iPod|Android/i.test(e)||window.innerWidth<768},vh=e=>{if(!e)return"";let t=e;const r=e.match(/^(\/(?:Users|home)\/[^/]+)(\/.*)?$/);return r?t="~"+(r[2]||""):e==="/root"?t="~":e.startsWith("/root/")&&(t="~"+e.slice(5)),t},km="instant",bm=5e3,Ff=()=>window.__HOP_SESSION__,xm=()=>{var e;return!!((e=Ff())!=null&&e.room)},Em=()=>{const e=new URLSearchParams(window.location.search),t=Ff(),r=(t==null?void 0:t.room)??uh()??ym(),[i,s]=U.useState(()=>e.get("name")??localStorage.getItem("hay_name")??"User"),[a,_]=U.useState(()=>r),[n,h]=U.useState(()=>t!=null&&t.room?{name:e.get("name")??localStorage.getItem("hay_name")??"User",room:r}:null),[d,y]=U.useState(()=>r),[f,m]=U.useState(null),[w,k]=U.useState("idle"),[S,u]=U.useState([]),[l,o]=U.useState(!0),[c,p]=U.useState(null),[g,C]=U.useState(null),[x,v]=U.useState(null),[b,R]=U.useState(null),P=U.useRef(null),[A,O]=U.useState(!1),[F,W]=U.useState(0),[Z,V]=U.useState(!1),[E,T]=U.useState(!1),[D,M]=U.useState(""),[H,q]=U.useState({index:0,total:0}),te=U.useRef([]),J=U.useRef(-1),fe=U.useRef(null),L=U.useRef(null),[N,$]=U.useState({x:20,y:window.innerHeight-80}),z=U.useRef(null),[ne]=U.useState(()=>ph()),[Q,ye]=U.useState(()=>ph()),[Oe,We]=U.useState(0),[K,G]=U.useState(()=>localStorage.getItem("hay_selection_mode")==="true"),[ge,$e]=U.useState(()=>localStorage.getItem("hay_haptics_enabled")!=="false"),[Be,pe]=U.useState(()=>localStorage.getItem("hay_theme")||"system"),[Ei,_t]=U.useState([]),[ri,bt]=U.useState(!1),[ii,Li]=U.useState(!1),[pt,Ri]=U.useState(()=>localStorage.getItem("hay_session_switch_mode")==="page"?"page":km);U.useEffect(()=>{n!=null&&n.room&&y(n.room)},[n==null?void 0:n.room]);const[vt,br]=U.useState(()=>{const B=localStorage.getItem("hay_font_size");return B?parseInt(B,10):14}),[xe,cn]=U.useState(()=>localStorage.getItem("hay_view_mode")==="fit"?"fit":"full"),xr=U.useRef(null),_e=U.useRef(null),bc=U.useRef(null),mt=U.useRef(null),Er=U.useRef(hm()),xc=U.useRef(!1),Vo=U.useRef(null),Pt=U.useRef(null);U.useEffect(()=>{localStorage.setItem("hay_selection_mode",K?"true":"false")},[K]),U.useEffect(()=>{localStorage.setItem("hay_haptics_enabled",ge?"true":"false")},[ge]),U.useEffect(()=>{var j;localStorage.setItem("hay_theme",Be);const B=document.documentElement;if(Be==="system"?B.removeAttribute("data-theme"):B.setAttribute("data-theme",Be),_e.current){const se=_e.current,oe=_h(Be);se.options.theme=oe;const ce=(j=mt.current)==null?void 0:j.querySelector(".xterm-viewport");ce&&(ce.style.backgroundColor=oe.background??""),typeof se.clearTextureAtlas=="function"&&se.clearTextureAtlas(),se.refresh(0,se.rows-1)}},[Be]),U.useEffect(()=>{localStorage.setItem("hay_session_switch_mode",pt)},[pt]);const Ko=U.useRef(!1),Zo=U.useRef(null),Lr=U.useRef(xe),un=U.useRef(0),Jt=U.useRef(null),Rr=U.useRef(!0),hn=U.useRef(0),dn=U.useRef(!1),Ec=U.useRef(0),fn=U.useRef(null),qo=U.useRef(!1),Lc=U.useRef(0),er=B=>{v(B),Zo.current&&window.clearTimeout(Zo.current),Zo.current=window.setTimeout(()=>{v(null)},3e3)},_n=(B,j=2e3)=>{R(B),P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>{R(null)},j)},zf=()=>{var ue;const B=_e.current;if(!B)return"";const j=B.buffer.active,se=j.viewportY,oe=Math.min(se+B.rows,j.length),ce=[];for(let le=se;le<oe;le++)ce.push(((ue=j.getLine(le))==null?void 0:ue.translateToString(!0))??"");return ce.join(`
|
|
60
|
-
`).trimEnd()},Rc=(B=0)=>{var le;const j=_e.current;if(!j)return"";const se=j.buffer.active,oe=se.length,ce=B>0?Math.max(0,oe-B):0,ue=[];for(let Ee=ce;Ee<oe;Ee++)ue.push(((le=se.getLine(Ee))==null?void 0:le.translateToString(!0))??"");return ue.join(`
|
|
61
|
-
`).trimEnd()},Xo=(B,j)=>{var ct;const se=_e.current,oe=te.current;if(!se||oe.length===0)return;const ce=(B%oe.length+oe.length)%oe.length;J.current=ce;const ue=oe[ce];fe.current={row:ue.row,col:ue.col},se.select(ue.col,ue.row,j);const le=Math.max(0,ue.row-Math.floor(se.rows/2)),Ee=se;(ct=Ee.scrollToLine)==null||ct.call(Ee,le),dn.current=!0,q({index:ce+1,total:oe.length})},Tc=B=>{var le;const j=_e.current;if(!j||!B)return[];const se=j.buffer.active,oe=B.toLowerCase(),ce=[],ue=2e3;for(let Ee=0;Ee<se.length&&ce.length<ue;Ee++){const ct=(((le=se.getLine(Ee))==null?void 0:le.translateToString(!0))??"").toLowerCase();let Je=0;for(;ce.length<ue;){const Ot=ct.indexOf(oe,Je);if(Ot===-1)break;ce.push({row:Ee,col:Ot}),Je=Ot+oe.length}}return ce},Uf=B=>{const j=_e.current;J.current=-1,fe.current=null;const se=Tc(B);if(te.current=se,!j||!B){q({index:0,total:0}),j==null||j.clearSelection();return}se.length>0?Xo(se.length-1,B.length):(q({index:0,total:0}),j.clearSelection())},Yo=B=>{const j=_e.current,se=D;if(!j||!se)return;const oe=Tc(se);if(te.current=oe,oe.length===0){J.current=-1,fe.current=null,q({index:0,total:0}),j.clearSelection();return}const ce=fe.current;if(!ce){Xo(oe.length-1,se.length);return}let ue=oe.findIndex(le=>le.row===ce.row&&le.col===ce.col);ue===-1&&(ue=oe.findIndex(le=>le.row>ce.row||le.row===ce.row&&le.col>=ce.col),ue===-1&&(ue=oe.length-1)),Xo(ue+B,se.length)},Go=()=>{T(!0),setTimeout(()=>{var B;return(B=L.current)==null?void 0:B.focus()},0)},Dc=()=>{var B,j;T(!1),M(""),te.current=[],J.current=-1,fe.current=null,q({index:0,total:0}),(B=_e.current)==null||B.clearSelection(),ne||(j=_e.current)==null||j.focus()},Qo=async(B,j)=>{try{await navigator.clipboard.writeText(B),er(`${j} copied (${B.split(`
|
|
62
|
-
`).length} lines)`)}catch{er("Copy failed")}};U.useEffect(()=>{fn.current=(n==null?void 0:n.room)??null},[n==null?void 0:n.room]);const Wf=U.useMemo(()=>hh(n?d||n.room:a),[n,a,d]),pn=U.useMemo(()=>om(S,g),[S,g]),Ac=U.useMemo(()=>{var B;return c?((B=S.find(j=>j.id===c))==null?void 0:B.name)??"Someone":""},[S,c]),vn=w==="connected"&&!l&&c===g;U.useEffect(()=>{xc.current&&!vn&&Er.current.reset(),xc.current=vn},[vn]),U.useEffect(()=>{Lr.current=xe,localStorage.setItem("hay_view_mode",xe),xe==="fit"&&_e.current&&setTimeout(()=>{cr(),tr()},0)},[xe]);const Ti=B=>{var j;((j=xr.current)==null?void 0:j.readyState)===WebSocket.OPEN&&xr.current.send(JSON.stringify(B))},Mc=B=>{Ti({type:"typing",active:B})},Pc=B=>{var oe;const j=B.replace(/\x1b\[I/g,"").replace(/\x1b\[O/g,"");if(!j)return;if(((oe=xr.current)==null?void 0:oe.readyState)!==WebSocket.OPEN){const ce=Date.now();ce-Ec.current>2e3&&(Ec.current=ce,_n("Disconnected — input not sent"));return}const se=Er.current.onInput(j,vn);se&&Jo(se),Ti({type:"input",data:j}),Lr.current==="fit"&&(cr(),tr()),Ko.current||(Ko.current=!0,Mc(!0)),Vo.current&&window.clearTimeout(Vo.current),Vo.current=window.setTimeout(()=>{Ko.current=!1,Mc(!1)},1200)},tr=()=>{_e.current&&Ti({type:"resize",cols:_e.current.cols,rows:_e.current.rows})},cr=()=>{var Di,mn,_s;if(!_e.current||!mt.current)return;const B=_e.current,j=B._core;if(!((_s=(mn=(Di=j==null?void 0:j._renderService)==null?void 0:Di.dimensions)==null?void 0:mn.css)!=null&&_s.cell))return;const se=j._renderService.dimensions.css.cell.width,oe=j._renderService.dimensions.css.cell.height;if(!se||!oe)return;const ce=mt.current.closest(".terminal-scroll");if(!ce)return;const ue=ce.getBoundingClientRect(),le=window.getComputedStyle(ce),Ee=parseFloat(le.paddingLeft)||0,ct=parseFloat(le.paddingRight)||0,Je=parseFloat(le.paddingTop)||0,Ot=parseFloat(le.paddingBottom)||0,si=ue.width-Ee-ct,be=ue.height-Je-Ot,gt=Math.max(2,Math.floor(si/se)),ur=Math.max(1,Math.floor(be/oe));(B.cols!==gt||B.rows!==ur)&&B.resize(gt,ur)},Jo=B=>{if(!_e.current)return;const j=B.replace(/\x1b\[I/g,"").replace(/\x1b\[O/g,"");_e.current.write(j,()=>{var se;dn.current||(se=_e.current)==null||se.scrollToBottom()})},$f=B=>{if(!Rr.current)return;const j=Math.min(1e3*Math.pow(2,un.current),3e4);un.current+=1,er(`Reconnecting in ${Math.round(j/1e3)}s...`),Jt.current=window.setTimeout(()=>{Jt.current=null,Rr.current&&Oc(B)},j)},Oc=B=>{var ct,Je,Ot;const j=B.room;Jt.current&&(window.clearTimeout(Jt.current),Jt.current=null);const se=++hn.current,oe=Cm(),ce=((ct=_e.current)==null?void 0:ct.cols)??80,ue=((Je=_e.current)==null?void 0:Je.rows)??24,le=`${oe}?room=${encodeURIComponent(B.room)}&name=${encodeURIComponent(B.name)}&cols=${ce}&rows=${ue}`;(Ot=xr.current)==null||Ot.close(),k("connecting"),Rr.current=!0;const Ee=new WebSocket(le);xr.current=Ee,Ee.addEventListener("open",()=>{if(se!==hn.current||fn.current!==j){Ee.close();return}k("connected"),un.current=0,tr()}),Ee.addEventListener("message",si=>{const be=nm(si.data);if(be)switch(be.type){case"hello":C(be.clientId),o(be.collabMode),p(be.controllerId);break;case"presence":u(be.clients);break;case"output":{const gt=Er.current.reconcileOutput(be.data);gt&&Jo(gt)}break;case"snapshot":Er.current.reset(),dn.current=!1,_e.current&&_e.current.reset(),Jo(be.data),_e.current&&(typeof be.cursorHidden=="boolean"?_e.current.write(be.cursorHidden?"\x1B[?25l":"\x1B[?25h"):be.alternateScreen&&_e.current.write("\x1B[?25l")),Lr.current==="fit"&&setTimeout(()=>{var gt;cr(),tr(),(gt=_e.current)==null||gt.scrollToBottom()},0);break;case"collab":o(be.enabled),p(be.controllerId),er(be.enabled?"Collaborative typing enabled":"Control locked to a single editor");break;case"input_rejected":er(be.reason);break;case"active_size":if(_e.current){const gt=_e.current.cols,ur=_e.current.rows;(be.cols!==gt||be.rows!==ur)&&_e.current.resize(be.cols,be.rows)}break;case"session_ended":Rr.current=!1,er(be.by?`${be.message} (by ${be.by})`:be.message),Ee.close(),k("ended");break;case"session_renamed":y(be.displayName),er(`Session renamed to ${be.displayName}`);break;case"cwd_changed":m(be.cwd);break}}),Ee.addEventListener("close",()=>{se===hn.current&&fn.current===j&&Rr.current&&(Er.current.reset(),k("disconnected"),$f(B))}),Ee.addEventListener("error",()=>{se===hn.current&&(fn.current!==j||!Rr.current||(Er.current.reset(),k("disconnected")))})};U.useEffect(()=>{!n||!A||Oc(n)},[n,A,F]),U.useEffect(()=>{if(!n||!mt.current||_e.current)return;const B=new Dv.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:vt,lineHeight:1.3,cursorBlink:!0,scrollback:5e3,theme:_h(Be)}),j=new Tv;B.loadAddon(j),B.open(mt.current),j.fit(),_e.current=B,bc.current=j,Lr.current==="fit"&&setTimeout(()=>{cr(),tr()},0);const se=[4,10,11,12,52,104,110,111,112];for(const le of se)B.parser.registerOscHandler(le,()=>!0);if(B.parser.registerCsiHandler({final:"I"},()=>!0),B.parser.registerCsiHandler({final:"O"},()=>!0),O(!0),ne){const le=mt.current.querySelector("textarea");le&&(le.setAttribute("readonly","true"),le.setAttribute("tabindex","-1"),le.style.opacity="0",le.style.pointerEvents="none")}else B.onData(Pc);B.attachCustomKeyEventHandler(le=>(le.metaKey||le.ctrlKey)&&!le.altKey&&!le.shiftKey&&le.key.toLowerCase()==="f"?(le.type==="keydown"&&(le.preventDefault(),Go()),!1):le.ctrlKey&&le.shiftKey&&(le.key==="c"||le.key==="v")?!1:(le.ctrlKey&&!le.altKey&&!le.metaKey,!0));const oe=new ResizeObserver(()=>{Lr.current==="fit"&&(cr(),B.refresh(0,B.rows-1),tr())});B.__resizeObserver=oe;const ce=mt.current.closest(".terminal-scroll");ce&&oe.observe(ce);const ue=mt.current.querySelector(".xterm-viewport");ue&&ue.addEventListener("scroll",()=>{const le=ue,Ee=le.scrollTop>=le.scrollHeight-le.clientHeight-5;dn.current=!Ee})},[n]),U.useEffect(()=>{var Wc;if(!ne||!A)return;const B=_e.current,j=(Wc=mt.current)==null?void 0:Wc.closest(".terminal-scroll");if(!B||!j)return;if(B.__touchCleanup&&(B.__touchCleanup(),B.__touchCleanup=null),K){const Se=()=>{var $t,Vt,rr,ni,Tr,oi,ai,Oi;const Le=B._core,Re=(ni=(rr=(Vt=($t=Le==null?void 0:Le._renderService)==null?void 0:$t.dimensions)==null?void 0:Vt.css)==null?void 0:rr.cell)==null?void 0:ni.width,tt=(Oi=(ai=(oi=(Tr=Le==null?void 0:Le._renderService)==null?void 0:Tr.dimensions)==null?void 0:oi.css)==null?void 0:ai.cell)==null?void 0:Oi.height;return{w:Re&&Re>0?Re:9,h:tt&&tt>0?tt:18}},et=()=>{var Re;const Le=(Re=mt.current)==null?void 0:Re.querySelector(".xterm-screen");return Le?Le.getBoundingClientRect():null},xt=Le=>{const Re=et();if(!Re)return null;const tt=Se(),$t=Math.floor((Le.clientX-Re.left)/tt.w),Vt=Math.floor((Le.clientY-Re.top)/tt.h);return{col:Math.max(0,$t),row:Math.max(0,Vt)}};let Ie=null,Bt=null,Wt=!1;const Ai=()=>{Bt!==null&&(clearInterval(Bt),Bt=null)},Mi=(Le,Re,tt,$t)=>{const Vt=B.buffer.active,rr=Vt.viewportY+Le,ni=Vt.viewportY+tt;let Tr,oi,ai,Oi;if(rr<ni||rr===ni&&Re<=$t?(Tr=rr,oi=Re,ai=ni,Oi=$t):(Tr=ni,oi=$t,ai=rr,Oi=Re),Tr===ai){const Jf=Math.max(1,Oi-oi+1);B.select(oi,Tr,Jf)}else B.selectLines(Tr,ai)},ps=Le=>{if(Le.touches.length!==1)return;Le.cancelable&&Le.preventDefault();const Re=xt(Le.touches[0]);Re&&(B.clearSelection(),Ie=Re,Le.touches[0].clientY,Wt=!1)},yn=Le=>{if(Le.touches.length!==1||!Ie)return;Le.cancelable&&Le.preventDefault(),Wt=!0;const Re=Le.touches[0];Re.clientY;const tt=xt(Re);if(!tt)return;const $t=tt.col;Mi(Ie.row,Ie.col,tt.row,tt.col);const Vt=et();if(!Vt)return;const rr=Se().h*2;Ai(),Re.clientY<Vt.top+rr?Bt=window.setInterval(()=>{B.scrollLines(-1),Ie&&(Ie.row+=1,Mi(Ie.row,Ie.col,0,$t))},60):Re.clientY>Vt.bottom-rr&&(Bt=window.setInterval(()=>{B.scrollLines(1),Ie&&(Ie.row-=1,Mi(Ie.row,Ie.col,B.rows-1,$t))},60))},Pi=Le=>{if(Ai(),Wt&&B.hasSelection()){const Re=B.getSelection();Re&&navigator.clipboard.writeText(Re).then(()=>_n(`Copied ${Re.split(`
|
|
63
|
-
`).length} line(s)`),()=>_n("Copy failed"))}else B.clearSelection();Ie=null,Wt=!1};return j.addEventListener("touchstart",ps,{passive:!1,capture:!0}),j.addEventListener("touchmove",yn,{passive:!1,capture:!0}),j.addEventListener("touchend",Pi,{passive:!0,capture:!0}),j.addEventListener("touchcancel",Pi,{passive:!0,capture:!0}),B.__touchCleanup=()=>{Ai(),j.removeEventListener("touchstart",ps,{capture:!0}),j.removeEventListener("touchmove",yn,{capture:!0}),j.removeEventListener("touchend",Pi,{capture:!0}),j.removeEventListener("touchcancel",Pi,{capture:!0})},()=>{B.__touchCleanup&&(B.__touchCleanup(),B.__touchCleanup=null)}}let se=0,oe=0,ce=[],ue=0,le=0,Ee=null,ct=!1,Je=!1,Ot=0,si=0,be=0,gt=0;const ur=()=>{var xt,Ie,Bt,Wt;const Se=B._core,et=(Wt=(Bt=(Ie=(xt=Se==null?void 0:Se._renderService)==null?void 0:xt.dimensions)==null?void 0:Ie.css)==null?void 0:Bt.cell)==null?void 0:Wt.height;return et&&et>0?et:18},Di=Se=>{const et=(Se[0].clientX+Se[1].clientX)/2,xt=(Se[0].clientY+Se[1].clientY)/2;return{x:et,y:xt}},mn=.94,_s=.25,jc=()=>{Ee!==null&&(cancelAnimationFrame(Ee),Ee=null),le=0},Fc=()=>{if(Math.abs(le)<_s){Ee=null;return}oe+=le;const Se=Math.trunc(oe/ur());Se!==0&&(B.scrollLines(Se),oe-=Se*ur()),le*=mn,Ee=requestAnimationFrame(Fc)},zc=Se=>{var et;if(jc(),Se.cancelable&&Se.preventDefault(),Se.touches.length===2){Je=!0;const xt=Di(Se.touches);be=xt.x,gt=xt.y;const Ie=(et=mt.current)==null?void 0:et.closest(".terminal-scroll");Ie&&(Ot=Ie.scrollLeft,si=Ie.scrollTop);return}if(Se.touches.length!==1){Je=!1,ct=!1;return}Je=!1,se=Se.touches[0].clientY,ue=Date.now(),oe=0,ce=[],ct=!0},Uc=Se=>{var Ai,Mi;if(Se.touches.length===2){if(!Je){Je=!0;const Re=Di(Se.touches);be=Re.x,gt=Re.y;const tt=(Ai=mt.current)==null?void 0:Ai.closest(".terminal-scroll");tt&&(Ot=tt.scrollLeft,si=tt.scrollTop)}const ps=Di(Se.touches),yn=be-ps.x,Pi=gt-ps.y,Le=(Mi=mt.current)==null?void 0:Mi.closest(".terminal-scroll");Le&&(Le.scrollLeft=Ot+yn,Le.scrollTop=si+Pi),Se.preventDefault();return}if(Se.touches.length!==1)return;Je&&(Je=!1,ct=!0);const et=Se.touches[0].clientY,xt=Date.now(),Ie=se-et,Bt=Math.max(1,xt-ue);Bt>0&&Bt<100&&(ce.push(Ie/Bt),ce.length>5&&ce.shift()),Se.preventDefault(),oe+=Ie;const Wt=Math.trunc(oe/ur());Wt!==0&&(B.scrollLines(Wt),oe-=Wt*ur()),se=et,ue=xt},gn=()=>{if(Je){Je=!1;return}if(ct&&ce.length>0){let Se=0;for(const et of ce)Math.abs(et)>Math.abs(Se)&&(Se=et);le=Se*16,Math.abs(le)>=_s&&(Ee=requestAnimationFrame(Fc))}ct=!1};return j.addEventListener("touchstart",zc,{passive:!1,capture:!0}),j.addEventListener("touchmove",Uc,{passive:!1,capture:!0}),j.addEventListener("touchend",gn,{passive:!0,capture:!0}),j.addEventListener("touchcancel",gn,{passive:!0,capture:!0}),B.__touchCleanup=()=>{jc(),j.removeEventListener("touchstart",zc,{capture:!0}),j.removeEventListener("touchmove",Uc,{capture:!0}),j.removeEventListener("touchend",gn,{capture:!0}),j.removeEventListener("touchcancel",gn,{capture:!0})},()=>{B.__touchCleanup&&(B.__touchCleanup(),B.__touchCleanup=null)}},[ne,K,A]),U.useEffect(()=>{var se;if(!A||!ne)return;const B=_e.current;if(!B)return;const j=(se=B._core)==null?void 0:se.viewport;if(j)return Pt.current||(Pt.current={start:typeof j.handleTouchStart=="function"?j.handleTouchStart.bind(j):void 0,move:typeof j.handleTouchMove=="function"?j.handleTouchMove.bind(j):void 0}),K?(j.handleTouchStart=()=>{},j.handleTouchMove=()=>!0):Pt.current&&(Pt.current.start&&(j.handleTouchStart=Pt.current.start),Pt.current.move&&(j.handleTouchMove=Pt.current.move)),()=>{Pt.current&&(Pt.current.start&&(j.handleTouchStart=Pt.current.start),Pt.current.move&&(j.handleTouchMove=Pt.current.move))}},[A,ne,K]),U.useEffect(()=>{var B;n||(Rr.current=!1,Jt.current&&(window.clearTimeout(Jt.current),Jt.current=null),(B=xr.current)==null||B.close(),xr.current=null,Er.current.reset(),un.current=0)},[n]),U.useEffect(()=>()=>{var se;const B=_e.current,j=B==null?void 0:B.__resizeObserver;j&&j.disconnect(),B&&(B.__touchCleanup&&(B.__touchCleanup(),B.__touchCleanup=null),B.dispose(),_e.current=null,bc.current=null),Rr.current=!1,Jt.current&&window.clearTimeout(Jt.current),(se=xr.current)==null||se.close()},[]),U.useEffect(()=>{const B=()=>{const j=uh(),se=new URLSearchParams(window.location.search).get("name")??localStorage.getItem("hay_name")??i;if(!j){xm()||h(null);return}_(j),h(oe=>{const ce=(oe==null?void 0:oe.name)??se??"User";return(oe==null?void 0:oe.room)===j&&oe.name===ce?oe:{name:ce,room:j}})};return window.addEventListener("popstate",B),()=>{window.removeEventListener("popstate",B)}},[i]);const[,Vf]=U.useState(0);U.useEffect(()=>{if(S.length===0)return;const B=window.setInterval(()=>Vf(j=>j+1),2e4);return()=>window.clearInterval(B)},[S.length]),U.useEffect(()=>{const B=()=>{$(j=>({x:Math.max(0,Math.min(window.innerWidth-56,j.x)),y:Math.max(0,Math.min(window.innerHeight-56,j.y))}))};return window.addEventListener("resize",B),window.addEventListener("orientationchange",B),()=>{window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B)}},[]);const fs=U.useCallback(async(B={})=>{const{showLoading:j=!0}=B;j&&bt(!0);try{const oe=await(await fetch("/api/sessions")).json(),ce=new Map;for(const ue of oe.sessions||[])ce.set(ue.name,{name:ue.name,displayName:ue.displayName||ue.name,active:(oe.active||[]).includes(ue.name),starting:(oe.starting||[]).includes(ue.name),type:ue.type,port:ue.port,cwd:ue.cwd});for(const ue of oe.active||[])ce.has(ue)||ce.set(ue,{name:ue,displayName:ue,active:!0,starting:!1});_t(Array.from(ce.values())),Li(!1),qo.current=!0,Lc.current=Date.now()}catch(se){console.error("Failed to fetch sessions:",se),Li(!0)}finally{j&&bt(!1)}},[]);U.useEffect(()=>{if(Z){const B=Date.now()-Lc.current<=bm;(!qo.current||!B)&&fs({showLoading:!qo.current})}},[Z,fs]),U.useEffect(()=>{fs()},[fs]),U.useEffect(()=>{_e.current&&(_e.current.options.fontSize=vt,Lr.current==="fit"?(cr(),tr()):_e.current.refresh(0,_e.current.rows-1)),localStorage.setItem("hay_font_size",String(vt))},[vt]),U.useEffect(()=>{if(!ne||!A||!Q||Oe<=0)return;const B=window.requestAnimationFrame(()=>{Lr.current==="fit"&&(cr(),tr())});return()=>{window.cancelAnimationFrame(B)}},[ne,A,Q,Oe]);const Kf=B=>{const j=wm(B.name),se=(n==null?void 0:n.room)??d;if(!(pt==="instant"&&B.type!=="port")){window.location.href=j;return}if(se===B.name){V(!1);return}Er.current.reset(),u([]),p(null),C(null),m(null),k("connecting"),_(B.name),y(B.displayName||B.name),h(ce=>({name:(ce==null?void 0:ce.name)??i.trim()??"User",room:B.name})),window.history.pushState({},"",j),V(!1)},Zf=B=>{if(B.preventDefault(),!i.trim()||!a.trim()){er("Enter a name and room to start.");return}localStorage.setItem("hay_name",i.trim()),h({name:i.trim(),room:a.trim()})},qf=async()=>{try{await navigator.clipboard.writeText(Wf),er("Share link copied.")}catch{er("Copy failed. Select the link manually.")}},Bc=()=>{Ti({type:"toggle_collab",enabled:!l})},Xf=()=>{Ti({type:"take_control"})},Yf=()=>{Ti({type:"release_control"})},Ic=(B,j)=>{z.current={dragging:!1,startX:B,startY:j,startPosX:N.x,startPosY:N.y}},Nc=(B,j)=>{if(!z.current)return;const se=B-z.current.startX,oe=j-z.current.startY;(Math.abs(se)>5||Math.abs(oe)>5)&&(z.current.dragging=!0),z.current.dragging&&$({x:Math.max(0,Math.min(window.innerWidth-56,z.current.startPosX+se)),y:Math.max(0,Math.min(window.innerHeight-56,z.current.startPosY+oe))})},ea=()=>{z.current&&!z.current.dragging&&V(!0),z.current=null},Hc=U.useCallback(()=>{ye(B=>!B),setTimeout(()=>{Lr.current==="fit"&&(cr(),tr())},100)},[]),Gf=U.useCallback(B=>{Pc(B)},[]),Qf=ne?{"--mobile-keyboard-height":`${Q?Oe:0}px`}:void 0;return I.jsxs("div",{className:"app",children:[I.jsxs("header",{className:"topbar",children:[I.jsxs("div",{className:"brand",children:[I.jsx("span",{className:"brand-mark",children:"◎"}),I.jsxs("div",{children:[I.jsx("p",{className:"brand-title",children:"Hay"}),I.jsx("p",{className:"brand-subtitle",children:"Collaborative terminal sharing for Hop."})]})]}),I.jsxs("div",{className:"presence-strip",children:[pn.map(B=>I.jsxs("div",{className:`presence-chip ${B.id===g?"self":""}`,title:`${B.name} · ${Ra(B)}`,children:[I.jsx("span",{className:"presence-dot",style:{backgroundColor:B.color}}),I.jsx("span",{className:"presence-name",children:B.name}),!l&&c===B.id&&I.jsx("span",{className:"presence-control",title:"Has control",children:"control"}),I.jsx("span",{className:`presence-status ${Ra(B)}`,children:Ra(B)})]},B.id)),pn.length===0&&I.jsx("span",{className:"presence-empty",children:"No viewers yet"})]})]}),n?I.jsxs("main",{className:`session${ne&&Q?" has-keyboard":""}${K?" selection-mode":""}`,style:Qf,children:[ne&&w!=="connected"&&w!=="idle"&&I.jsxs("div",{className:`connection-banner${w==="ended"?" ended":""}`,role:"status","aria-live":"polite",children:[I.jsx("span",{children:w==="connecting"?"Connecting…":w==="ended"?"Session ended":"Disconnected — reconnecting…"}),(w==="disconnected"||w==="ended")&&I.jsx("button",{type:"button",onClick:()=>W(B=>B+1),children:"Reconnect now"})]}),I.jsx("button",{type:"button","aria-label":"Open menu",className:"drawer-toggle",style:{left:N.x,top:N.y,bottom:"auto"},onMouseDown:B=>Ic(B.clientX,B.clientY),onMouseMove:B=>Nc(B.clientX,B.clientY),onMouseUp:ea,onMouseLeave:ea,onTouchStart:B=>Ic(B.touches[0].clientX,B.touches[0].clientY),onTouchMove:B=>Nc(B.touches[0].clientX,B.touches[0].clientY),onTouchEnd:ea,children:I.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[I.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),I.jsx("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor"}),I.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),I.jsx("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor"}),I.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),I.jsx("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor"})]})}),Z&&I.jsx("div",{className:"drawer-overlay",onClick:()=>V(!1)}),I.jsxs("section",{className:`controls ${Z?"open":""}`,children:[I.jsx("button",{type:"button","aria-label":"Close menu",className:"drawer-close",onClick:()=>V(!1),children:"✕"}),I.jsxs("div",{className:"room-info",children:[I.jsx("p",{className:"room-label",children:"Session"}),I.jsx("h2",{children:d||n.room}),f&&I.jsx("p",{className:"room-cwd",title:f,children:vh(f)}),I.jsx("p",{className:"room-meta",children:w==="connected"?"Live":w==="connecting"?"Connecting":w==="ended"?"Ended":"Offline"})]}),I.jsxs("div",{className:"quick-actions",children:[ne&&I.jsxs("button",{type:"button",className:"quick-btn",onClick:()=>{Hc(),V(!1)},title:Q?"Hide keyboard":"Show keyboard",children:[I.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[I.jsx("rect",{x:"2",y:"4",width:"20",height:"14",rx:"2"}),I.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"})]}),""]}),I.jsx("button",{type:"button",className:"quick-btn",onClick:qf,title:"Copy share link","aria-label":"Copy share link",children:I.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[I.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),I.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),ne&&I.jsx("button",{type:"button",className:"quick-btn","aria-label":"Find in terminal",onClick:()=>{V(!1),Go()},children:"Find"}),I.jsx("button",{type:"button",className:"quick-btn",onClick:()=>{cr(),tr()},children:"Fit"}),I.jsx("button",{type:"button",className:"quick-btn",onClick:()=>{window.open("/sessions.html","_blank")},children:"Manage"}),(w==="disconnected"||w==="ended")&&I.jsx("button",{type:"button",className:"quick-btn primary",onClick:()=>W(B=>B+1),children:"Reconnect"})]}),I.jsxs("div",{className:"drawer-group",children:[I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Control"}),I.jsx("span",{className:"control-state",children:l?"Everyone can type":c===g?"You have control":Ac?`Locked by ${Ac}`:"Locked"})]}),I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Typing"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:l?"active":"",onClick:()=>{l||Bc()},children:"Everyone"}),I.jsx("button",{type:"button",className:l?"":"active",onClick:()=>{l&&Bc()},children:"One user"})]})]}),!l&&I.jsx("div",{className:"drawer-row",children:c===g?I.jsx("button",{type:"button",className:"quick-btn",onClick:Yf,children:"Release control"}):I.jsx("button",{type:"button",className:"quick-btn",onClick:Xf,children:"Take control"})})]}),I.jsxs("div",{className:"drawer-group",children:[I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Theme"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:Be==="system"?"active":"",onClick:()=>pe("system"),children:"Auto"}),I.jsx("button",{type:"button",className:Be==="light"?"active":"",onClick:()=>pe("light"),children:"Light"}),I.jsx("button",{type:"button",className:Be==="dark"?"active":"",onClick:()=>pe("dark"),children:"Dark"})]})]}),I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Font"}),I.jsxs("div",{className:"font-size-buttons",children:[I.jsx("button",{type:"button",onClick:()=>br(B=>Math.max(8,B-1)),children:"−"}),I.jsxs("span",{children:[vt,"px"]}),I.jsx("button",{type:"button",onClick:()=>br(B=>Math.min(24,B+1)),children:"+"})]})]}),ne&&I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Touch"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:K?"":"active",onClick:()=>G(!1),children:"Scroll"}),I.jsx("button",{type:"button",className:K?"active":"",onClick:()=>G(!0),children:"Select"})]})]})]}),I.jsx("div",{className:"copy-actions",children:I.jsxs("div",{className:"copy-buttons",children:[I.jsx("button",{type:"button",onClick:()=>Qo(zf(),"Visible text"),children:"Copy visible"}),I.jsx("button",{type:"button",onClick:()=>Qo(Rc(200),"Last 200 lines"),children:"Last 200"}),I.jsx("button",{type:"button",onClick:()=>Qo(Rc(),"Full buffer"),children:"Copy all"})]})}),I.jsxs("details",{className:"drawer-details",children:[I.jsx("summary",{children:"More settings"}),I.jsxs("div",{className:"drawer-group",children:[I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"View"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:xe==="fit"?"active":"",onClick:()=>cn("fit"),children:"Auto-fit"}),I.jsx("button",{type:"button",className:xe==="full"?"active":"",onClick:()=>cn("full"),children:"Manual"})]})]}),I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Switch"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:pt==="page"?"active":"",onClick:()=>Ri("page"),children:"Page"}),I.jsx("button",{type:"button",className:pt==="instant"?"active":"",onClick:()=>Ri("instant"),children:"Instant"})]})]}),ne&&I.jsxs("div",{className:"drawer-row",children:[I.jsx("label",{children:"Haptics"}),I.jsxs("div",{className:"view-mode-buttons",children:[I.jsx("button",{type:"button",className:ge?"active":"",onClick:()=>$e(!0),children:"On"}),I.jsx("button",{type:"button",className:ge?"":"active",onClick:()=>$e(!1),children:"Off"})]})]})]})]}),x&&I.jsx("p",{className:"notice",role:"status","aria-live":"polite",children:x}),(()=>{const B=Ei.filter(j=>j.name!==n.room);return I.jsxs("div",{className:"session-switcher",children:[I.jsx("p",{className:"session-switcher-label",children:"Switch session"}),ri?I.jsx("div",{className:"session-list-loading",children:"Loading..."}):ii?I.jsxs("div",{className:"session-list-error",children:[I.jsx("span",{children:"Couldn't load sessions"}),I.jsx("button",{type:"button",onClick:()=>fs(),children:"Retry"})]}):B.length===0?I.jsx("div",{className:"session-list-empty",children:"No other sessions"}):I.jsx("div",{className:"session-list",children:B.map(j=>I.jsxs("button",{type:"button",className:`session-list-item${j.active?" active":""}${j.starting?" starting":""}`,onClick:()=>Kf(j),children:[I.jsxs("span",{className:"session-list-name-group",children:[I.jsx("span",{className:"session-list-name",children:j.displayName}),j.cwd&&I.jsx("span",{className:"session-list-cwd",children:vh(j.cwd)})]}),j.active&&I.jsx("span",{className:"session-badge live",children:"LIVE"}),j.starting&&!j.active&&I.jsx("span",{className:"session-badge starting",children:"STARTING"}),j.type==="port"&&I.jsxs("span",{className:"session-badge port",children:["PORT ",j.port]})]},j.name))})]})})()]}),I.jsxs("section",{className:"terminal",children:[I.jsxs("div",{className:"terminal-frame",onClick:()=>{var B;ne||(B=_e.current)==null||B.focus()},children:[I.jsx("div",{className:"terminal-scroll",children:I.jsx("div",{className:"terminal-inner",ref:mt})}),E&&I.jsxs("div",{className:"terminal-find",onClick:B=>B.stopPropagation(),children:[I.jsx("input",{ref:L,className:"terminal-find-input",placeholder:"Find in scrollback…",value:D,onChange:B=>{M(B.target.value),Uf(B.target.value)},onKeyDown:B=>{B.key==="Enter"?(B.preventDefault(),Yo(B.shiftKey?-1:1)):B.key==="Escape"&&(B.preventDefault(),Dc())}}),I.jsx("span",{className:"terminal-find-count",children:H.total>0?`${H.index}/${H.total}`:D?"0/0":""}),I.jsx("button",{type:"button",className:"terminal-find-btn",onClick:()=>Yo(-1),"aria-label":"Previous match",children:"↑"}),I.jsx("button",{type:"button",className:"terminal-find-btn",onClick:()=>Yo(1),"aria-label":"Next match",children:"↓"}),I.jsx("button",{type:"button",className:"terminal-find-btn",onClick:Dc,"aria-label":"Close search",children:"✕"})]})]}),I.jsx("div",{className:"terminal-footer",children:w==="connected"?I.jsxs(I.Fragment,{children:[I.jsx("span",{children:"Live"}),I.jsx("button",{type:"button",className:"footer-find-toggle","aria-label":"Find in terminal",onClick:Go,children:"🔍 Find"}),I.jsxs("span",{children:[pn.length," viewer",pn.length===1?"":"s"]})]}):w==="idle"?I.jsx("span",{children:"Awaiting connection"}):w==="ended"?I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"ended-label",children:"Session ended"}),I.jsx("button",{type:"button",className:"footer-reconnect",onClick:()=>W(B=>B+1),children:"Reconnect"})]}):I.jsxs(I.Fragment,{children:[I.jsxs("span",{className:"reconnecting",children:["⟳ ",w==="connecting"?"Connecting…":"Reconnecting…"]}),I.jsx("button",{type:"button",className:"footer-reconnect",onClick:()=>W(B=>B+1),children:"Reconnect now"})]})})]}),ne&&I.jsx(gm,{onInput:Gf,visible:Q,onToggle:Hc,onHeightChange:We,hapticsEnabled:ge,onPasteFailed:()=>_n("Clipboard access denied — long-press the terminal to paste instead.",3500)}),b&&I.jsx("div",{className:"terminal-toast",role:"status","aria-live":"polite",children:b})]}):I.jsx("main",{className:"join",children:I.jsxs("div",{className:"join-card",children:[I.jsx("h1",{children:"Terminal session"}),I.jsx("p",{children:"Connect to an existing session or start a new one."}),I.jsxs("form",{onSubmit:Zf,className:"join-form",children:[I.jsxs("label",{children:["Display name",I.jsx("input",{value:i,onChange:B=>s(B.target.value),placeholder:"Casey"})]}),I.jsxs("label",{children:["Session",I.jsx("input",{value:a,onChange:B=>_(B.target.value),placeholder:"my-session"})]}),I.jsx("button",{type:"submit",className:"primary",children:"Connect"})]})]})})]})},mh=document.getElementById("root");mh&&Mf(mh).render(I.jsx(v_.StrictMode,{children:I.jsx(Em,{})}));
|
|
64
|
-
//# sourceMappingURL=index-BzJB9r_I.js.map
|