@caoruhua/open-claude-remote 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +449 -0
- package/dist/api/auth-routes.d.ts +4 -0
- package/dist/api/auth-routes.d.ts.map +1 -0
- package/dist/api/auth-routes.js +7 -0
- package/dist/api/auth-routes.js.map +1 -0
- package/dist/api/config-routes.d.ts +4 -0
- package/dist/api/config-routes.d.ts.map +1 -0
- package/dist/api/config-routes.js +180 -0
- package/dist/api/config-routes.js.map +1 -0
- package/dist/api/health-routes.d.ts +3 -0
- package/dist/api/health-routes.d.ts.map +1 -0
- package/dist/api/health-routes.js +9 -0
- package/dist/api/health-routes.js.map +1 -0
- package/dist/api/hook-routes.d.ts +4 -0
- package/dist/api/hook-routes.d.ts.map +1 -0
- package/dist/api/hook-routes.js +32 -0
- package/dist/api/hook-routes.js.map +1 -0
- package/dist/api/instance-routes.d.ts +20 -0
- package/dist/api/instance-routes.d.ts.map +1 -0
- package/dist/api/instance-routes.js +128 -0
- package/dist/api/instance-routes.js.map +1 -0
- package/dist/api/push-routes.d.ts +5 -0
- package/dist/api/push-routes.d.ts.map +1 -0
- package/dist/api/push-routes.js +45 -0
- package/dist/api/push-routes.js.map +1 -0
- package/dist/api/router.d.ts +19 -0
- package/dist/api/router.d.ts.map +1 -0
- package/dist/api/router.js +37 -0
- package/dist/api/router.js.map +1 -0
- package/dist/api/status-routes.d.ts +5 -0
- package/dist/api/status-routes.d.ts.map +1 -0
- package/dist/api/status-routes.js +17 -0
- package/dist/api/status-routes.js.map +1 -0
- package/dist/attach.d.ts +9 -0
- package/dist/attach.d.ts.map +1 -0
- package/dist/attach.js +155 -0
- package/dist/attach.js.map +1 -0
- package/dist/auth/auth-middleware.d.ts +52 -0
- package/dist/auth/auth-middleware.d.ts.map +1 -0
- package/dist/auth/auth-middleware.js +124 -0
- package/dist/auth/auth-middleware.js.map +1 -0
- package/dist/auth/rate-limiter.d.ts +37 -0
- package/dist/auth/rate-limiter.d.ts.map +1 -0
- package/dist/auth/rate-limiter.js +81 -0
- package/dist/auth/rate-limiter.js.map +1 -0
- package/dist/auth/token-generator.d.ts +9 -0
- package/dist/auth/token-generator.d.ts.map +1 -0
- package/dist/auth/token-generator.js +15 -0
- package/dist/auth/token-generator.js.map +1 -0
- package/dist/cli-utils.d.ts +19 -0
- package/dist/cli-utils.d.ts.map +1 -0
- package/dist/cli-utils.js +132 -0
- package/dist/cli-utils.js.map +1 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +58 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +146 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +329 -0
- package/dist/config.js.map +1 -0
- package/dist/hooks/hook-receiver.d.ts +39 -0
- package/dist/hooks/hook-receiver.d.ts.map +1 -0
- package/dist/hooks/hook-receiver.js +46 -0
- package/dist/hooks/hook-receiver.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +353 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/logger.d.ts +8 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/logger/logger.js +90 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/notification/dingtalk-service.d.ts +24 -0
- package/dist/notification/dingtalk-service.d.ts.map +1 -0
- package/dist/notification/dingtalk-service.js +94 -0
- package/dist/notification/dingtalk-service.js.map +1 -0
- package/dist/pty/output-buffer.d.ts +25 -0
- package/dist/pty/output-buffer.d.ts.map +1 -0
- package/dist/pty/output-buffer.js +58 -0
- package/dist/pty/output-buffer.js.map +1 -0
- package/dist/pty/pty-manager.d.ts +45 -0
- package/dist/pty/pty-manager.d.ts.map +1 -0
- package/dist/pty/pty-manager.js +108 -0
- package/dist/pty/pty-manager.js.map +1 -0
- package/dist/pty/types.d.ts +11 -0
- package/dist/pty/types.d.ts.map +1 -0
- package/dist/pty/types.js +2 -0
- package/dist/pty/types.js.map +1 -0
- package/dist/pty/virtual-pty.d.ts +37 -0
- package/dist/pty/virtual-pty.d.ts.map +1 -0
- package/dist/pty/virtual-pty.js +161 -0
- package/dist/pty/virtual-pty.js.map +1 -0
- package/dist/push/push-service.d.ts +87 -0
- package/dist/push/push-service.d.ts.map +1 -0
- package/dist/push/push-service.js +301 -0
- package/dist/push/push-service.js.map +1 -0
- package/dist/registry/instance-registry.d.ts +32 -0
- package/dist/registry/instance-registry.d.ts.map +1 -0
- package/dist/registry/instance-registry.js +115 -0
- package/dist/registry/instance-registry.js.map +1 -0
- package/dist/registry/instance-spawner.d.ts +33 -0
- package/dist/registry/instance-spawner.d.ts.map +1 -0
- package/dist/registry/instance-spawner.js +91 -0
- package/dist/registry/instance-spawner.js.map +1 -0
- package/dist/registry/port-finder.d.ts +8 -0
- package/dist/registry/port-finder.d.ts.map +1 -0
- package/dist/registry/port-finder.js +35 -0
- package/dist/registry/port-finder.js.map +1 -0
- package/dist/registry/shared-token.d.ts +11 -0
- package/dist/registry/shared-token.d.ts.map +1 -0
- package/dist/registry/shared-token.js +82 -0
- package/dist/registry/shared-token.js.map +1 -0
- package/dist/registry/stop-instances.d.ts +27 -0
- package/dist/registry/stop-instances.d.ts.map +1 -0
- package/dist/registry/stop-instances.js +212 -0
- package/dist/registry/stop-instances.js.map +1 -0
- package/dist/session/session-controller.d.ts +58 -0
- package/dist/session/session-controller.d.ts.map +1 -0
- package/dist/session/session-controller.js +273 -0
- package/dist/session/session-controller.js.map +1 -0
- package/dist/terminal/terminal-relay.d.ts +29 -0
- package/dist/terminal/terminal-relay.d.ts.map +1 -0
- package/dist/terminal/terminal-relay.js +106 -0
- package/dist/terminal/terminal-relay.js.map +1 -0
- package/dist/utils/ansi-filter.d.ts +41 -0
- package/dist/utils/ansi-filter.d.ts.map +1 -0
- package/dist/utils/ansi-filter.js +147 -0
- package/dist/utils/ansi-filter.js.map +1 -0
- package/dist/utils/file-lock.d.ts +23 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +125 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/ip-monitor.d.ts +39 -0
- package/dist/utils/ip-monitor.d.ts.map +1 -0
- package/dist/utils/ip-monitor.js +114 -0
- package/dist/utils/ip-monitor.js.map +1 -0
- package/dist/utils/network.d.ts +19 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/network.js +54 -0
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/pid-file.d.ts +10 -0
- package/dist/utils/pid-file.d.ts.map +1 -0
- package/dist/utils/pid-file.js +30 -0
- package/dist/utils/pid-file.js.map +1 -0
- package/dist/utils/qrcode-banner.d.ts +6 -0
- package/dist/utils/qrcode-banner.d.ts.map +1 -0
- package/dist/utils/qrcode-banner.js +16 -0
- package/dist/utils/qrcode-banner.js.map +1 -0
- package/dist/ws/ws-handler.d.ts +10 -0
- package/dist/ws/ws-handler.d.ts.map +1 -0
- package/dist/ws/ws-handler.js +36 -0
- package/dist/ws/ws-handler.js.map +1 -0
- package/dist/ws/ws-server.d.ts +78 -0
- package/dist/ws/ws-server.d.ts.map +1 -0
- package/dist/ws/ws-server.js +223 -0
- package/dist/ws/ws-server.js.map +1 -0
- package/frontend-dist/assets/index-BKudo1Dw.css +32 -0
- package/frontend-dist/assets/index-BqqB1hYe.js +141 -0
- package/frontend-dist/index.html +15 -0
- package/frontend-dist/sw.js +46 -0
- package/package.json +79 -0
- package/shared-dist/constants.d.ts +10 -0
- package/shared-dist/constants.d.ts.map +1 -0
- package/shared-dist/constants.js +10 -0
- package/shared-dist/constants.js.map +1 -0
- package/shared-dist/defaults.d.ts +30 -0
- package/shared-dist/defaults.d.ts.map +1 -0
- package/shared-dist/defaults.js +31 -0
- package/shared-dist/defaults.js.map +1 -0
- package/shared-dist/index.d.ts +5 -0
- package/shared-dist/index.d.ts.map +1 -0
- package/shared-dist/index.js +5 -0
- package/shared-dist/index.js.map +1 -0
- package/shared-dist/instance.d.ts +25 -0
- package/shared-dist/instance.d.ts.map +1 -0
- package/shared-dist/instance.js +7 -0
- package/shared-dist/instance.js.map +1 -0
- package/shared-dist/question-utils.d.ts +15 -0
- package/shared-dist/question-utils.d.ts.map +1 -0
- package/shared-dist/question-utils.js +24 -0
- package/shared-dist/question-utils.js.map +1 -0
- package/shared-dist/ws-protocol.d.ts +60 -0
- package/shared-dist/ws-protocol.d.ts.map +1 -0
- package/shared-dist/ws-protocol.js +5 -0
- package/shared-dist/ws-protocol.js.map +1 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
(function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const z of document.querySelectorAll('link[rel="modulepreload"]'))A(z);new MutationObserver(z=>{for(const P of z)if(P.type==="childList")for(const H of P.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&A(H)}).observe(document,{childList:!0,subtree:!0});function D(z){const P={};return z.integrity&&(P.integrity=z.integrity),z.referrerPolicy&&(P.referrerPolicy=z.referrerPolicy),z.crossOrigin==="use-credentials"?P.credentials="include":z.crossOrigin==="anonymous"?P.credentials="omit":P.credentials="same-origin",P}function A(z){if(z.ep)return;z.ep=!0;const P=D(z);fetch(z.href,P)}})();function E0(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var Sc={exports:{}},Cn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Pf;function R0(){if(Pf)return Cn;Pf=1;var _=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function D(A,z,P){var H=null;if(P!==void 0&&(H=""+P),z.key!==void 0&&(H=""+z.key),"key"in z){P={};for(var s in z)s!=="key"&&(P[s]=z[s])}else P=z;return z=P.ref,{$$typeof:_,type:A,key:H,ref:z!==void 0?z:null,props:P}}return Cn.Fragment=C,Cn.jsx=D,Cn.jsxs=D,Cn}var Ff;function A0(){return Ff||(Ff=1,Sc.exports=R0()),Sc.exports}var ee=A0(),bc={exports:{}},Re={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var qf;function D0(){if(qf)return Re;qf=1;var _=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),H=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function S(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,n={};function c(B,j,Q){this.props=B,this.context=j,this.refs=n,this.updater=Q||w}c.prototype.isReactComponent={},c.prototype.setState=function(B,j){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,j,"setState")},c.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function o(){}o.prototype=c.prototype;function h(B,j,Q){this.props=B,this.context=j,this.refs=n,this.updater=Q||w}var m=h.prototype=new o;m.constructor=h,f(m,c.prototype),m.isPureReactComponent=!0;var x=Array.isArray;function y(){}var E={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function R(B,j,Q){var J=Q.ref;return{$$typeof:_,type:B,key:j,ref:J!==void 0?J:null,props:Q}}function T(B,j){return R(B.type,j,B.props)}function I(B){return typeof B=="object"&&B!==null&&B.$$typeof===_}function M(B){var j={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(Q){return j[Q]})}var k=/\/+/g;function U(B,j){return typeof B=="object"&&B!==null&&B.key!=null?M(""+B.key):j.toString(36)}function K(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(y,y):(B.status="pending",B.then(function(j){B.status==="pending"&&(B.status="fulfilled",B.value=j)},function(j){B.status==="pending"&&(B.status="rejected",B.reason=j)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function W(B,j,Q,J,ue){var he=typeof B;(he==="undefined"||he==="boolean")&&(B=null);var X=!1;if(B===null)X=!0;else switch(he){case"bigint":case"string":case"number":X=!0;break;case"object":switch(B.$$typeof){case _:case C:X=!0;break;case v:return X=B._init,W(X(B._payload),j,Q,J,ue)}}if(X)return ue=ue(B),X=J===""?"."+U(B,0):J,x(ue)?(Q="",X!=null&&(Q=X.replace(k,"$&/")+"/"),W(ue,j,Q,"",function(ie){return ie})):ue!=null&&(I(ue)&&(ue=T(ue,Q+(ue.key==null||B&&B.key===ue.key?"":(""+ue.key).replace(k,"$&/")+"/")+X)),j.push(ue)),1;X=0;var F=J===""?".":J+":";if(x(B))for(var ae=0;ae<B.length;ae++)J=B[ae],he=F+U(J,ae),X+=W(J,j,Q,he,ue);else if(ae=S(B),typeof ae=="function")for(B=ae.call(B),ae=0;!(J=B.next()).done;)J=J.value,he=F+U(J,ae++),X+=W(J,j,Q,he,ue);else if(he==="object"){if(typeof B.then=="function")return W(K(B),j,Q,J,ue);throw j=String(B),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return X}function $(B,j,Q){if(B==null)return B;var J=[],ue=0;return W(B,J,"","",function(he){return j.call(Q,he,ue++)}),J}function V(B){if(B._status===-1){var j=B._result;j=j(),j.then(function(Q){(B._status===0||B._status===-1)&&(B._status=1,B._result=Q)},function(Q){(B._status===0||B._status===-1)&&(B._status=2,B._result=Q)}),B._status===-1&&(B._status=0,B._result=j)}if(B._status===1)return B._result.default;throw B._result}var O=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},q={map:$,forEach:function(B,j,Q){$(B,function(){j.apply(this,arguments)},Q)},count:function(B){var j=0;return $(B,function(){j++}),j},toArray:function(B){return $(B,function(j){return j})||[]},only:function(B){if(!I(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Re.Activity=a,Re.Children=q,Re.Component=c,Re.Fragment=D,Re.Profiler=z,Re.PureComponent=h,Re.StrictMode=A,Re.Suspense=u,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Re.__COMPILER_RUNTIME={__proto__:null,c:function(B){return E.H.useMemoCache(B)}},Re.cache=function(B){return function(){return B.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(B,j,Q){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var J=f({},B.props),ue=B.key;if(j!=null)for(he in j.key!==void 0&&(ue=""+j.key),j)!b.call(j,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&j.ref===void 0||(J[he]=j[he]);var he=arguments.length-2;if(he===1)J.children=Q;else if(1<he){for(var X=Array(he),F=0;F<he;F++)X[F]=arguments[F+2];J.children=X}return R(B.type,ue,J)},Re.createContext=function(B){return B={$$typeof:H,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:P,_context:B},B},Re.createElement=function(B,j,Q){var J,ue={},he=null;if(j!=null)for(J in j.key!==void 0&&(he=""+j.key),j)b.call(j,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ue[J]=j[J]);var X=arguments.length-2;if(X===1)ue.children=Q;else if(1<X){for(var F=Array(X),ae=0;ae<X;ae++)F[ae]=arguments[ae+2];ue.children=F}if(B&&B.defaultProps)for(J in X=B.defaultProps,X)ue[J]===void 0&&(ue[J]=X[J]);return R(B,he,ue)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(B){return{$$typeof:s,render:B}},Re.isValidElement=I,Re.lazy=function(B){return{$$typeof:v,_payload:{_status:-1,_result:B},_init:V}},Re.memo=function(B,j){return{$$typeof:d,type:B,compare:j===void 0?null:j}},Re.startTransition=function(B){var j=E.T,Q={};E.T=Q;try{var J=B(),ue=E.S;ue!==null&&ue(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(y,O)}catch(he){O(he)}finally{j!==null&&Q.types!==null&&(j.types=Q.types),E.T=j}},Re.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Re.use=function(B){return E.H.use(B)},Re.useActionState=function(B,j,Q){return E.H.useActionState(B,j,Q)},Re.useCallback=function(B,j){return E.H.useCallback(B,j)},Re.useContext=function(B){return E.H.useContext(B)},Re.useDebugValue=function(){},Re.useDeferredValue=function(B,j){return E.H.useDeferredValue(B,j)},Re.useEffect=function(B,j){return E.H.useEffect(B,j)},Re.useEffectEvent=function(B){return E.H.useEffectEvent(B)},Re.useId=function(){return E.H.useId()},Re.useImperativeHandle=function(B,j,Q){return E.H.useImperativeHandle(B,j,Q)},Re.useInsertionEffect=function(B,j){return E.H.useInsertionEffect(B,j)},Re.useLayoutEffect=function(B,j){return E.H.useLayoutEffect(B,j)},Re.useMemo=function(B,j){return E.H.useMemo(B,j)},Re.useOptimistic=function(B,j){return E.H.useOptimistic(B,j)},Re.useReducer=function(B,j,Q){return E.H.useReducer(B,j,Q)},Re.useRef=function(B){return E.H.useRef(B)},Re.useState=function(B){return E.H.useState(B)},Re.useSyncExternalStore=function(B,j,Q){return E.H.useSyncExternalStore(B,j,Q)},Re.useTransition=function(){return E.H.useTransition()},Re.version="19.2.4",Re}var Wf;function jc(){return Wf||(Wf=1,bc.exports=D0()),bc.exports}var G=jc();const Et=E0(G);var yc={exports:{}},wn={},Cc={exports:{}},wc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Gf;function L0(){return Gf||(Gf=1,(function(_){function C(W,$){var V=W.length;W.push($);e:for(;0<V;){var O=V-1>>>1,q=W[O];if(0<z(q,$))W[O]=$,W[V]=q,V=O;else break e}}function D(W){return W.length===0?null:W[0]}function A(W){if(W.length===0)return null;var $=W[0],V=W.pop();if(V!==$){W[0]=V;e:for(var O=0,q=W.length,B=q>>>1;O<B;){var j=2*(O+1)-1,Q=W[j],J=j+1,ue=W[J];if(0>z(Q,V))J<q&&0>z(ue,Q)?(W[O]=ue,W[J]=V,O=J):(W[O]=Q,W[j]=V,O=j);else if(J<q&&0>z(ue,V))W[O]=ue,W[J]=V,O=J;else break e}}return $}function z(W,$){var V=W.sortIndex-$.sortIndex;return V!==0?V:W.id-$.id}if(_.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var P=performance;_.unstable_now=function(){return P.now()}}else{var H=Date,s=H.now();_.unstable_now=function(){return H.now()-s}}var u=[],d=[],v=1,a=null,p=3,S=!1,w=!1,f=!1,n=!1,c=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function m(W){for(var $=D(d);$!==null;){if($.callback===null)A(d);else if($.startTime<=W)A(d),$.sortIndex=$.expirationTime,C(u,$);else break;$=D(d)}}function x(W){if(f=!1,m(W),!w)if(D(u)!==null)w=!0,y||(y=!0,M());else{var $=D(d);$!==null&&K(x,$.startTime-W)}}var y=!1,E=-1,b=5,R=-1;function T(){return n?!0:!(_.unstable_now()-R<b)}function I(){if(n=!1,y){var W=_.unstable_now();R=W;var $=!0;try{e:{w=!1,f&&(f=!1,o(E),E=-1),S=!0;var V=p;try{t:{for(m(W),a=D(u);a!==null&&!(a.expirationTime>W&&T());){var O=a.callback;if(typeof O=="function"){a.callback=null,p=a.priorityLevel;var q=O(a.expirationTime<=W);if(W=_.unstable_now(),typeof q=="function"){a.callback=q,m(W),$=!0;break t}a===D(u)&&A(u),m(W)}else A(u);a=D(u)}if(a!==null)$=!0;else{var B=D(d);B!==null&&K(x,B.startTime-W),$=!1}}break e}finally{a=null,p=V,S=!1}$=void 0}}finally{$?M():y=!1}}}var M;if(typeof h=="function")M=function(){h(I)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,U=k.port2;k.port1.onmessage=I,M=function(){U.postMessage(null)}}else M=function(){c(I,0)};function K(W,$){E=c(function(){W(_.unstable_now())},$)}_.unstable_IdlePriority=5,_.unstable_ImmediatePriority=1,_.unstable_LowPriority=4,_.unstable_NormalPriority=3,_.unstable_Profiling=null,_.unstable_UserBlockingPriority=2,_.unstable_cancelCallback=function(W){W.callback=null},_.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<W?Math.floor(1e3/W):5},_.unstable_getCurrentPriorityLevel=function(){return p},_.unstable_next=function(W){switch(p){case 1:case 2:case 3:var $=3;break;default:$=p}var V=p;p=$;try{return W()}finally{p=V}},_.unstable_requestPaint=function(){n=!0},_.unstable_runWithPriority=function(W,$){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var V=p;p=W;try{return $()}finally{p=V}},_.unstable_scheduleCallback=function(W,$,V){var O=_.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?O+V:O):V=O,W){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=V+q,W={id:v++,callback:$,priorityLevel:W,startTime:V,expirationTime:q,sortIndex:-1},V>O?(W.sortIndex=V,C(d,W),D(u)===null&&W===D(d)&&(f?(o(E),E=-1):f=!0,K(x,V-O))):(W.sortIndex=q,C(u,W),w||S||(w=!0,y||(y=!0,M()))),W},_.unstable_shouldYield=T,_.unstable_wrapCallback=function(W){var $=p;return function(){var V=p;p=$;try{return W.apply(this,arguments)}finally{p=V}}}})(wc)),wc}var $f;function T0(){return $f||($f=1,Cc.exports=L0()),Cc.exports}var xc={exports:{}},kt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Vf;function M0(){if(Vf)return kt;Vf=1;var _=jc();function C(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)d+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function D(){}var A={d:{f:D,r:function(){throw Error(C(522))},D,C:D,L:D,m:D,X:D,S:D,M:D},p:0,findDOMNode:null},z=Symbol.for("react.portal");function P(u,d,v){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:z,key:a==null?null:""+a,children:u,containerInfo:d,implementation:v}}var H=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,kt.createPortal=function(u,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(C(299));return P(u,d,null,v)},kt.flushSync=function(u){var d=H.T,v=A.p;try{if(H.T=null,A.p=2,u)return u()}finally{H.T=d,A.p=v,A.d.f()}},kt.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,A.d.C(u,d))},kt.prefetchDNS=function(u){typeof u=="string"&&A.d.D(u)},kt.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var v=d.as,a=s(v,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;v==="style"?A.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:S}):v==="script"&&A.d.X(u,{crossOrigin:a,integrity:p,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},kt.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var v=s(d.as,d.crossOrigin);A.d.M(u,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&A.d.M(u)},kt.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var v=d.as,a=s(v,d.crossOrigin);A.d.L(u,v,{crossOrigin:a,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},kt.preloadModule=function(u,d){if(typeof u=="string")if(d){var v=s(d.as,d.crossOrigin);A.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else A.d.m(u)},kt.requestFormReset=function(u){A.d.r(u)},kt.unstable_batchedUpdates=function(u,d){return u(d)},kt.useFormState=function(u,d,v){return H.H.useFormState(u,d,v)},kt.useFormStatus=function(){return H.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var Xf;function R_(){if(Xf)return xc.exports;Xf=1;function _(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(C){console.error(C)}}return _(),xc.exports=M0(),xc.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Yf;function O0(){if(Yf)return wn;Yf=1;var _=T0(),C=jc(),D=R_();function A(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function z(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function P(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function H(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 s(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(P(e)!==e)throw Error(A(188))}function d(e){var t=e.alternate;if(!t){if(t=P(e),t===null)throw Error(A(188));return t!==e?null:e}for(var i=e,r=t;;){var l=i.return;if(l===null)break;var g=l.alternate;if(g===null){if(r=l.return,r!==null){i=r;continue}break}if(l.child===g.child){for(g=l.child;g;){if(g===i)return u(l),e;if(g===r)return u(l),t;g=g.sibling}throw Error(A(188))}if(i.return!==r.return)i=l,r=g;else{for(var L=!1,N=l.child;N;){if(N===i){L=!0,i=l,r=g;break}if(N===r){L=!0,r=l,i=g;break}N=N.sibling}if(!L){for(N=g.child;N;){if(N===i){L=!0,i=g,r=l;break}if(N===r){L=!0,r=g,i=l;break}N=N.sibling}if(!L)throw Error(A(189))}}if(i.alternate!==r)throw Error(A(190))}if(i.tag!==3)throw Error(A(188));return i.stateNode.current===i?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var a=Object.assign,p=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var k=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case c:return"Profiler";case n:return"StrictMode";case x:return"Suspense";case y:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case h:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case m:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case E:return t=e.displayName||null,t!==null?t:U(e.type)||"Memo";case b:t=e._payload,e=e._init;try{return U(e(t))}catch{}}return null}var K=Array.isArray,W=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},O=[],q=-1;function B(e){return{current:e}}function j(e){0>q||(e.current=O[q],O[q]=null,q--)}function Q(e,t){q++,O[q]=e.current,e.current=t}var J=B(null),ue=B(null),he=B(null),X=B(null);function F(e,t){switch(Q(he,t),Q(ue,e),Q(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uf(t),e=hf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(J),Q(J,e)}function ae(){j(J),j(ue),j(he)}function ie(e){e.memoizedState!==null&&Q(X,e);var t=J.current,i=hf(t,e.type);t!==i&&(Q(ue,e),Q(J,i))}function _e(e){ue.current===e&&(j(J),j(ue)),X.current===e&&(j(X),mn._currentValue=V)}var fe,ye;function ge(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",ye=-1<i.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+fe+e+ye}var Te=!1;function Pe(e,t){if(!e||Te)return"";Te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ne=oe}Reflect.construct(e,[],de)}else{try{de.call()}catch(oe){ne=oe}e.call(de.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=r.DetermineComponentFrameRoot(),L=g[0],N=g[1];if(L&&N){var Y=L.split(`
|
|
44
|
+
`),se=N.split(`
|
|
45
|
+
`);for(l=r=0;r<Y.length&&!Y[r].includes("DetermineComponentFrameRoot");)r++;for(;l<se.length&&!se[l].includes("DetermineComponentFrameRoot");)l++;if(r===Y.length||l===se.length)for(r=Y.length-1,l=se.length-1;1<=r&&0<=l&&Y[r]!==se[l];)l--;for(;1<=r&&0<=l;r--,l--)if(Y[r]!==se[l]){if(r!==1||l!==1)do if(r--,l--,0>l||Y[r]!==se[l]){var le=`
|
|
46
|
+
`+Y[r].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=r&&0<=l);break}}}finally{Te=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ge(i):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge("Lazy");case 13:return e.child!==t&&t!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ge("Activity");default:return""}}function Ot(e){try{var t="",i=null;do t+=Se(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}var zt=Object.prototype.hasOwnProperty,xe=_.unstable_scheduleCallback,Ee=_.unstable_cancelCallback,Ae=_.unstable_shouldYield,ve=_.unstable_requestPaint,we=_.unstable_now,Ke=_.unstable_getCurrentPriorityLevel,qe=_.unstable_ImmediatePriority,vt=_.unstable_UserBlockingPriority,Qe=_.unstable_NormalPriority,ct=_.unstable_LowPriority,Ze=_.unstable_IdlePriority,Oe=_.log,De=_.unstable_setDisableYieldValue,Yt=null,ut=null;function Rt(e){if(typeof Oe=="function"&&De(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(Yt,e)}catch{}}var gt=Math.clz32?Math.clz32:Ms,Qi=Math.log,Pr=Math.LN2;function Ms(e){return e>>>=0,e===0?32:31-(Qi(e)/Pr|0)|0}var xi=256,Ti=262144,tt=4194304;function rt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function yt(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var l=0,g=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var N=r&134217727;return N!==0?(r=N&~g,r!==0?l=rt(r):(L&=N,L!==0?l=rt(L):i||(i=N&~e,i!==0&&(l=rt(i))))):(N=r&~g,N!==0?l=rt(N):L!==0?l=rt(L):i||(i=r&~e,i!==0&&(l=rt(i)))),l===0?0:t!==0&&t!==l&&(t&g)===0&&(g=l&-l,i=t&-t,g>=i||g===32&&(i&4194048)!==0)?t:l}function It(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bt(){var e=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),e}function Nt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function si(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(e,t,i,r,l,g){var L=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var N=e.entanglements,Y=e.expirationTimes,se=e.hiddenUpdates;for(i=L&~i;0<i;){var le=31-gt(i),de=1<<le;N[le]=0,Y[le]=-1;var ne=se[le];if(ne!==null)for(se[le]=null,le=0;le<ne.length;le++){var oe=ne[le];oe!==null&&(oe.lane&=-536870913)}i&=~de}r!==0&&mi(e,r,0),g!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=g&~(L&~t))}function mi(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-gt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function Kt(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-gt(i),l=1<<r;l&t|e[r]&t&&(e[r]|=t),i&=~l}}function ni(e,t){var i=t&-t;return i=(i&42)!==0?1:Mi(i),(i&(e.suspendedLanes|t))!==0?0:i}function Mi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Si(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:kf(e.type))}function Zi(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var ai=Math.random().toString(36).slice(2),At="__reactFiber$"+ai,jt="__reactProps$"+ai,Fr="__reactContainer$"+ai,co="__reactEvents$"+ai,_v="__reactListeners$"+ai,vv="__reactHandles$"+ai,Kc="__reactResources$"+ai,Os="__reactMarker$"+ai;function uo(e){delete e[At],delete e[jt],delete e[co],delete e[_v],delete e[vv]}function qr(e){var t=e[At];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Fr]||i[At]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=mf(e);e!==null;){if(i=e[At])return i;e=mf(e)}return t}e=i,i=e.parentNode}return null}function Wr(e){if(e=e[At]||e[Fr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(A(33))}function Gr(e){var t=e[Kc];return t||(t=e[Kc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[Os]=!0}var Qc=new Set,Zc={};function xr(e,t){$r(e,t),$r(e+"Capture",t)}function $r(e,t){for(Zc[e]=t,e=0;e<t.length;e++)Qc.add(t[e])}var gv=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Jc={},eu={};function pv(e){return zt.call(eu,e)?!0:zt.call(Jc,e)?!1:gv.test(e)?eu[e]=!0:(Jc[e]=!0,!1)}function Hn(e,t,i){if(pv(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function zn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Bi(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}function oi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mv(e,t,i){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,g=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(L){i=""+L,g.call(this,L)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(L){i=""+L},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ho(e){if(!e._valueTracker){var t=tu(e)?"checked":"value";e._valueTracker=mv(e,t,""+e[t])}}function iu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=tu(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function In(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sv=/[\n"\\]/g;function li(e){return e.replace(Sv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function fo(e,t,i,r,l,g,L,N){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),t!=null?L==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+oi(t)):e.value!==""+oi(t)&&(e.value=""+oi(t)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),t!=null?_o(e,L,oi(t)):i!=null?_o(e,L,oi(i)):r!=null&&e.removeAttribute("value"),l==null&&g!=null&&(e.defaultChecked=!!g),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+oi(N):e.removeAttribute("name")}function ru(e,t,i,r,l,g,L,N){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||t!=null)){ho(e);return}i=i!=null?""+oi(i):"",t=t!=null?""+oi(t):i,N||t===e.value||(e.value=t),e.defaultValue=t}r=r??l,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=N?e.checked:!!r,e.defaultChecked=!!r,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),ho(e)}function _o(e,t,i){t==="number"&&In(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Vr(e,t,i,r){if(e=e.options,t){t={};for(var l=0;l<i.length;l++)t["$"+i[l]]=!0;for(i=0;i<e.length;i++)l=t.hasOwnProperty("$"+e[i].value),e[i].selected!==l&&(e[i].selected=l),l&&r&&(e[i].defaultSelected=!0)}else{for(i=""+oi(i),t=null,l=0;l<e.length;l++){if(e[l].value===i){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function su(e,t,i){if(t!=null&&(t=""+oi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+oi(i):""}function nu(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(A(92));if(K(r)){if(1<r.length)throw Error(A(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=oi(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r),ho(e)}function Xr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var bv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function au(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||bv.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ou(e,t,i){if(t!=null&&typeof t!="object")throw Error(A(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&i[l]!==r&&au(e,l,r)}else for(var g in t)t.hasOwnProperty(g)&&au(e,g,t[g])}function vo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Un(e){return Cv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ki(){}var go=null;function po(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yr=null,Kr=null;function lu(e){var t=Wr(e);if(t&&(e=t.stateNode)){var i=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(fo(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+li(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var l=r[jt]||null;if(!l)throw Error(A(90));fo(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&iu(r)}break e;case"textarea":su(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Vr(e,!!i.multiple,t,!1)}}}var mo=!1;function cu(e,t,i){if(mo)return e(t,i);mo=!0;try{var r=e(t);return r}finally{if(mo=!1,(Yr!==null||Kr!==null)&&(Ea(),Yr&&(t=Yr,e=Kr,Kr=Yr=null,lu(t),e)))for(t=0;t<e.length;t++)lu(e[t])}}function ks(e,t){var i=e.stateNode;if(i===null)return null;var r=i[jt]||null;if(r===null)return null;i=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(A(231,t,typeof i));return i}var Hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),So=!1;if(Hi)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){So=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{So=!1}var Ji=null,bo=null,Nn=null;function uu(){if(Nn)return Nn;var e,t=bo,i=t.length,r,l="value"in Ji?Ji.value:Ji.textContent,g=l.length;for(e=0;e<i&&t[e]===l[e];e++);var L=i-e;for(r=1;r<=L&&t[i-r]===l[g-r];r++);return Nn=l.slice(e,1<r?1-r:void 0)}function jn(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 Pn(){return!0}function hu(){return!1}function Pt(e){function t(i,r,l,g,L){this._reactName=i,this._targetInst=l,this.type=r,this.nativeEvent=g,this.target=L,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(g):g[N]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Pn:hu,this.isPropagationStopped=hu,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Pn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Pn)},persist:function(){},isPersistent:Pn}),t}var Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Pt(Er),zs=a({},Er,{view:0,detail:0}),wv=Pt(zs),yo,Co,Is,qn=a({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Is&&(Is&&e.type==="mousemove"?(yo=e.screenX-Is.screenX,Co=e.screenY-Is.screenY):Co=yo=0,Is=e),yo)},movementY:function(e){return"movementY"in e?e.movementY:Co}}),du=Pt(qn),xv=a({},qn,{dataTransfer:0}),Ev=Pt(xv),Rv=a({},zs,{relatedTarget:0}),wo=Pt(Rv),Av=a({},Er,{animationName:0,elapsedTime:0,pseudoElement:0}),Dv=Pt(Av),Lv=a({},Er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tv=Pt(Lv),Mv=a({},Er,{data:0}),fu=Pt(Mv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bv={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"},kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kv[e])?!!t[e]:!1}function xo(){return Hv}var zv=a({},zs,{key:function(e){if(e.key){var t=Ov[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xo,charCode:function(e){return e.type==="keypress"?jn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Iv=Pt(zv),Uv=a({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_u=Pt(Uv),Nv=a({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xo}),jv=Pt(Nv),Pv=a({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fv=Pt(Pv),qv=a({},qn,{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}),Wv=Pt(qv),Gv=a({},Er,{newState:0,oldState:0}),$v=Pt(Gv),Vv=[9,13,27,32],Eo=Hi&&"CompositionEvent"in window,Us=null;Hi&&"documentMode"in document&&(Us=document.documentMode);var Xv=Hi&&"TextEvent"in window&&!Us,vu=Hi&&(!Eo||Us&&8<Us&&11>=Us),gu=" ",pu=!1;function mu(e,t){switch(e){case"keyup":return Vv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qr=!1;function Yv(e,t){switch(e){case"compositionend":return Su(t);case"keypress":return t.which!==32?null:(pu=!0,gu);case"textInput":return e=t.data,e===gu&&pu?null:e;default:return null}}function Kv(e,t){if(Qr)return e==="compositionend"||!Eo&&mu(e,t)?(e=uu(),Nn=bo=Ji=null,Qr=!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 vu&&t.locale!=="ko"?null:t.data;default:return null}}var Qv={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 bu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qv[e.type]:t==="textarea"}function yu(e,t,i,r){Yr?Kr?Kr.push(r):Kr=[r]:Yr=r,t=Oa(t,"onChange"),0<t.length&&(i=new Fn("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var Ns=null,js=null;function Zv(e){sf(e,0)}function Wn(e){var t=Bs(e);if(iu(t))return e}function Cu(e,t){if(e==="change")return t}var wu=!1;if(Hi){var Ro;if(Hi){var Ao="oninput"in document;if(!Ao){var xu=document.createElement("div");xu.setAttribute("oninput","return;"),Ao=typeof xu.oninput=="function"}Ro=Ao}else Ro=!1;wu=Ro&&(!document.documentMode||9<document.documentMode)}function Eu(){Ns&&(Ns.detachEvent("onpropertychange",Ru),js=Ns=null)}function Ru(e){if(e.propertyName==="value"&&Wn(js)){var t=[];yu(t,js,e,po(e)),cu(Zv,t)}}function Jv(e,t,i){e==="focusin"?(Eu(),Ns=t,js=i,Ns.attachEvent("onpropertychange",Ru)):e==="focusout"&&Eu()}function eg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wn(js)}function tg(e,t){if(e==="click")return Wn(t)}function ig(e,t){if(e==="input"||e==="change")return Wn(t)}function rg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:rg;function Ps(e,t){if(Qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var l=i[r];if(!zt.call(t,l)||!Qt(e[l],t[l]))return!1}return!0}function Au(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Du(e,t){var i=Au(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Au(i)}}function Lu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=In(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=In(e.document)}return t}function Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var sg=Hi&&"documentMode"in document&&11>=document.documentMode,Zr=null,Lo=null,Fs=null,To=!1;function Mu(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;To||Zr==null||Zr!==In(r)||(r=Zr,"selectionStart"in r&&Do(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fs&&Ps(Fs,r)||(Fs=r,r=Oa(Lo,"onSelect"),0<r.length&&(t=new Fn("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=Zr)))}function Rr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Jr={animationend:Rr("Animation","AnimationEnd"),animationiteration:Rr("Animation","AnimationIteration"),animationstart:Rr("Animation","AnimationStart"),transitionrun:Rr("Transition","TransitionRun"),transitionstart:Rr("Transition","TransitionStart"),transitioncancel:Rr("Transition","TransitionCancel"),transitionend:Rr("Transition","TransitionEnd")},Mo={},Ou={};Hi&&(Ou=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function Ar(e){if(Mo[e])return Mo[e];if(!Jr[e])return e;var t=Jr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ou)return Mo[e]=t[i];return e}var Bu=Ar("animationend"),ku=Ar("animationiteration"),Hu=Ar("animationstart"),ng=Ar("transitionrun"),ag=Ar("transitionstart"),og=Ar("transitioncancel"),zu=Ar("transitionend"),Iu=new Map,Oo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Oo.push("scrollEnd");function bi(e,t){Iu.set(e,t),xr(t,[e])}var Gn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ci=[],es=0,Bo=0;function $n(){for(var e=es,t=Bo=es=0;t<e;){var i=ci[t];ci[t++]=null;var r=ci[t];ci[t++]=null;var l=ci[t];ci[t++]=null;var g=ci[t];if(ci[t++]=null,r!==null&&l!==null){var L=r.pending;L===null?l.next=l:(l.next=L.next,L.next=l),r.pending=l}g!==0&&Uu(i,l,g)}}function Vn(e,t,i,r){ci[es++]=e,ci[es++]=t,ci[es++]=i,ci[es++]=r,Bo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ko(e,t,i,r){return Vn(e,t,i,r),Xn(e)}function Dr(e,t){return Vn(e,null,null,t),Xn(e)}function Uu(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var l=!1,g=e.return;g!==null;)g.childLanes|=i,r=g.alternate,r!==null&&(r.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(l=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,l&&t!==null&&(l=31-gt(i),e=g.hiddenUpdates,r=e[l],r===null?e[l]=[t]:r.push(t),t.lane=i|536870912),g):null}function Xn(e){if(50<hn)throw hn=0,ql=null,Error(A(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ts={};function lg(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,i,r){return new lg(e,t,i,r)}function Ho(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zi(e,t){var i=e.alternate;return i===null?(i=Zt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Nu(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yn(e,t,i,r,l,g){var L=0;if(r=e,typeof e=="function")Ho(e)&&(L=1);else if(typeof e=="string")L=f0(e,i,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Zt(31,i,t,l),e.elementType=R,e.lanes=g,e;case f:return Lr(i.children,l,g,t);case n:L=8,l|=24;break;case c:return e=Zt(12,i,t,l|2),e.elementType=c,e.lanes=g,e;case x:return e=Zt(13,i,t,l),e.elementType=x,e.lanes=g,e;case y:return e=Zt(19,i,t,l),e.elementType=y,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:L=10;break e;case o:L=9;break e;case m:L=11;break e;case E:L=14;break e;case b:L=16,r=null;break e}L=29,i=Error(A(130,e===null?"null":typeof e,"")),r=null}return t=Zt(L,i,t,l),t.elementType=e,t.type=r,t.lanes=g,t}function Lr(e,t,i,r){return e=Zt(7,e,r,t),e.lanes=i,e}function zo(e,t,i){return e=Zt(6,e,null,t),e.lanes=i,e}function ju(e){var t=Zt(18,null,null,0);return t.stateNode=e,t}function Io(e,t,i){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pu=new WeakMap;function ui(e,t){if(typeof e=="object"&&e!==null){var i=Pu.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Ot(t)},Pu.set(e,t),t)}return{value:e,source:t,stack:Ot(t)}}var is=[],rs=0,Kn=null,qs=0,hi=[],di=0,er=null,Ei=1,Ri="";function Ii(e,t){is[rs++]=qs,is[rs++]=Kn,Kn=e,qs=t}function Fu(e,t,i){hi[di++]=Ei,hi[di++]=Ri,hi[di++]=er,er=e;var r=Ei;e=Ri;var l=32-gt(r)-1;r&=~(1<<l),i+=1;var g=32-gt(t)+l;if(30<g){var L=l-l%5;g=(r&(1<<L)-1).toString(32),r>>=L,l-=L,Ei=1<<32-gt(t)+l|i<<l|r,Ri=g+e}else Ei=1<<g|i<<l|r,Ri=e}function Uo(e){e.return!==null&&(Ii(e,1),Fu(e,1,0))}function No(e){for(;e===Kn;)Kn=is[--rs],is[rs]=null,qs=is[--rs],is[rs]=null;for(;e===er;)er=hi[--di],hi[di]=null,Ri=hi[--di],hi[di]=null,Ei=hi[--di],hi[di]=null}function qu(e,t){hi[di++]=Ei,hi[di++]=Ri,hi[di++]=er,Ei=t.id,Ri=t.overflow,er=e}var Dt=null,Je=null,Ie=!1,tr=null,fi=!1,jo=Error(A(519));function ir(e){var t=Error(A(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ws(ui(t,e)),jo}function Wu(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[At]=e,t[jt]=r,i){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(i=0;i<fn.length;i++)ke(fn[i],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),ru(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),nu(t,r.value,r.defaultValue,r.children)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||lf(t.textContent,i)?(r.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),r.onScroll!=null&&ke("scroll",t),r.onScrollEnd!=null&&ke("scrollend",t),r.onClick!=null&&(t.onclick=ki),t=!0):t=!1,t||ir(e,!0)}function Gu(e){for(Dt=e.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:Dt=Dt.return}}function ss(e){if(e!==Dt)return!1;if(!Ie)return Gu(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||sc(e.type,e.memoizedProps)),i=!i),i&&Je&&ir(e),Gu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=pf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=pf(e)}else t===27?(t=Je,gr(e.type)?(e=cc,cc=null,Je=e):Je=t):Je=Dt?vi(e.stateNode.nextSibling):null;return!0}function Tr(){Je=Dt=null,Ie=!1}function Po(){var e=tr;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),tr=null),e}function Ws(e){tr===null?tr=[e]:tr.push(e)}var Fo=B(null),Mr=null,Ui=null;function rr(e,t,i){Q(Fo,t._currentValue),t._currentValue=i}function Ni(e){e._currentValue=Fo.current,j(Fo)}function qo(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function Wo(e,t,i,r){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var g=l.dependencies;if(g!==null){var L=l.child;g=g.firstContext;e:for(;g!==null;){var N=g;g=l;for(var Y=0;Y<t.length;Y++)if(N.context===t[Y]){g.lanes|=i,N=g.alternate,N!==null&&(N.lanes|=i),qo(g.return,i,e),r||(L=null);break e}g=N.next}}else if(l.tag===18){if(L=l.return,L===null)throw Error(A(341));L.lanes|=i,g=L.alternate,g!==null&&(g.lanes|=i),qo(L,i,e),L=null}else L=l.child;if(L!==null)L.return=l;else for(L=l;L!==null;){if(L===e){L=null;break}if(l=L.sibling,l!==null){l.return=L.return,L=l;break}L=L.return}l=L}}function ns(e,t,i,r){e=null;for(var l=t,g=!1;l!==null;){if(!g){if((l.flags&524288)!==0)g=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var L=l.alternate;if(L===null)throw Error(A(387));if(L=L.memoizedProps,L!==null){var N=l.type;Qt(l.pendingProps.value,L.value)||(e!==null?e.push(N):e=[N])}}else if(l===X.current){if(L=l.alternate,L===null)throw Error(A(387));L.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(mn):e=[mn])}l=l.return}e!==null&&Wo(t,e,i,r),t.flags|=262144}function Qn(e){for(e=e.firstContext;e!==null;){if(!Qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){Mr=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return $u(Mr,e)}function Zn(e,t){return Mr===null&&Or(e),$u(e,t)}function $u(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ui===null){if(e===null)throw Error(A(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return i}var cg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},ug=_.unstable_scheduleCallback,hg=_.unstable_NormalPriority,ht={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Go(){return{controller:new cg,data:new Map,refCount:0}}function Gs(e){e.refCount--,e.refCount===0&&ug(hg,function(){e.controller.abort()})}var $s=null,$o=0,as=0,os=null;function dg(e,t){if($s===null){var i=$s=[];$o=0,as=Yl(),os={status:"pending",value:void 0,then:function(r){i.push(r)}}}return $o++,t.then(Vu,Vu),t}function Vu(){if(--$o===0&&$s!==null){os!==null&&(os.status="fulfilled");var e=$s;$s=null,as=0,os=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fg(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(l){i.push(l)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var l=0;l<i.length;l++)(0,i[l])(t)},function(l){for(r.status="rejected",r.reason=l,l=0;l<i.length;l++)(0,i[l])(void 0)}),r}var Xu=W.S;W.S=function(e,t){Md=we(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&dg(e,t),Xu!==null&&Xu(e,t)};var Br=B(null);function Vo(){var e=Br.current;return e!==null?e:Ye.pooledCache}function Jn(e,t){t===null?Q(Br,Br.current):Q(Br,t.pool)}function Yu(){var e=Vo();return e===null?null:{parent:ht._currentValue,pool:e}}var ls=Error(A(460)),Xo=Error(A(474)),ea=Error(A(542)),ta={then:function(){}};function Ku(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(ki,ki),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ju(e),e;default:if(typeof t.status=="string")t.then(ki,ki);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(A(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=r}},function(r){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ju(e),e}throw Hr=t,ls}}function kr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Hr=i,ls):i}}var Hr=null;function Zu(){if(Hr===null)throw Error(A(459));var e=Hr;return Hr=null,e}function Ju(e){if(e===ls||e===ea)throw Error(A(483))}var cs=null,Vs=0;function ia(e){var t=Vs;return Vs+=1,cs===null&&(cs=[]),Qu(cs,e,t)}function Xs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ra(e,t){throw t.$$typeof===p?Error(A(525)):(e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function eh(e){function t(te,Z){if(e){var re=te.deletions;re===null?(te.deletions=[Z],te.flags|=16):re.push(Z)}}function i(te,Z){if(!e)return null;for(;Z!==null;)t(te,Z),Z=Z.sibling;return null}function r(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function l(te,Z){return te=zi(te,Z),te.index=0,te.sibling=null,te}function g(te,Z,re){return te.index=re,e?(re=te.alternate,re!==null?(re=re.index,re<Z?(te.flags|=67108866,Z):re):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function L(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function N(te,Z,re,ce){return Z===null||Z.tag!==6?(Z=zo(re,te.mode,ce),Z.return=te,Z):(Z=l(Z,re),Z.return=te,Z)}function Y(te,Z,re,ce){var be=re.type;return be===f?le(te,Z,re.props.children,ce,re.key):Z!==null&&(Z.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===b&&kr(be)===Z.type)?(Z=l(Z,re.props),Xs(Z,re),Z.return=te,Z):(Z=Yn(re.type,re.key,re.props,null,te.mode,ce),Xs(Z,re),Z.return=te,Z)}function se(te,Z,re,ce){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=Io(re,te.mode,ce),Z.return=te,Z):(Z=l(Z,re.children||[]),Z.return=te,Z)}function le(te,Z,re,ce,be){return Z===null||Z.tag!==7?(Z=Lr(re,te.mode,ce,be),Z.return=te,Z):(Z=l(Z,re),Z.return=te,Z)}function de(te,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=zo(""+Z,te.mode,re),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return re=Yn(Z.type,Z.key,Z.props,null,te.mode,re),Xs(re,Z),re.return=te,re;case w:return Z=Io(Z,te.mode,re),Z.return=te,Z;case b:return Z=kr(Z),de(te,Z,re)}if(K(Z)||M(Z))return Z=Lr(Z,te.mode,re,null),Z.return=te,Z;if(typeof Z.then=="function")return de(te,ia(Z),re);if(Z.$$typeof===h)return de(te,Zn(te,Z),re);ra(te,Z)}return null}function ne(te,Z,re,ce){var be=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return be!==null?null:N(te,Z,""+re,ce);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return re.key===be?Y(te,Z,re,ce):null;case w:return re.key===be?se(te,Z,re,ce):null;case b:return re=kr(re),ne(te,Z,re,ce)}if(K(re)||M(re))return be!==null?null:le(te,Z,re,ce,null);if(typeof re.then=="function")return ne(te,Z,ia(re),ce);if(re.$$typeof===h)return ne(te,Z,Zn(te,re),ce);ra(te,re)}return null}function oe(te,Z,re,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return te=te.get(re)||null,N(Z,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case S:return te=te.get(ce.key===null?re:ce.key)||null,Y(Z,te,ce,be);case w:return te=te.get(ce.key===null?re:ce.key)||null,se(Z,te,ce,be);case b:return ce=kr(ce),oe(te,Z,re,ce,be)}if(K(ce)||M(ce))return te=te.get(re)||null,le(Z,te,ce,be,null);if(typeof ce.then=="function")return oe(te,Z,re,ia(ce),be);if(ce.$$typeof===h)return oe(te,Z,re,Zn(Z,ce),be);ra(Z,ce)}return null}function pe(te,Z,re,ce){for(var be=null,Ne=null,me=Z,Me=Z=0,ze=null;me!==null&&Me<re.length;Me++){me.index>Me?(ze=me,me=null):ze=me.sibling;var je=ne(te,me,re[Me],ce);if(je===null){me===null&&(me=ze);break}e&&me&&je.alternate===null&&t(te,me),Z=g(je,Z,Me),Ne===null?be=je:Ne.sibling=je,Ne=je,me=ze}if(Me===re.length)return i(te,me),Ie&&Ii(te,Me),be;if(me===null){for(;Me<re.length;Me++)me=de(te,re[Me],ce),me!==null&&(Z=g(me,Z,Me),Ne===null?be=me:Ne.sibling=me,Ne=me);return Ie&&Ii(te,Me),be}for(me=r(me);Me<re.length;Me++)ze=oe(me,te,Me,re[Me],ce),ze!==null&&(e&&ze.alternate!==null&&me.delete(ze.key===null?Me:ze.key),Z=g(ze,Z,Me),Ne===null?be=ze:Ne.sibling=ze,Ne=ze);return e&&me.forEach(function(yr){return t(te,yr)}),Ie&&Ii(te,Me),be}function Ce(te,Z,re,ce){if(re==null)throw Error(A(151));for(var be=null,Ne=null,me=Z,Me=Z=0,ze=null,je=re.next();me!==null&&!je.done;Me++,je=re.next()){me.index>Me?(ze=me,me=null):ze=me.sibling;var yr=ne(te,me,je.value,ce);if(yr===null){me===null&&(me=ze);break}e&&me&&yr.alternate===null&&t(te,me),Z=g(yr,Z,Me),Ne===null?be=yr:Ne.sibling=yr,Ne=yr,me=ze}if(je.done)return i(te,me),Ie&&Ii(te,Me),be;if(me===null){for(;!je.done;Me++,je=re.next())je=de(te,je.value,ce),je!==null&&(Z=g(je,Z,Me),Ne===null?be=je:Ne.sibling=je,Ne=je);return Ie&&Ii(te,Me),be}for(me=r(me);!je.done;Me++,je=re.next())je=oe(me,te,Me,je.value,ce),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Me:je.key),Z=g(je,Z,Me),Ne===null?be=je:Ne.sibling=je,Ne=je);return e&&me.forEach(function(x0){return t(te,x0)}),Ie&&Ii(te,Me),be}function Xe(te,Z,re,ce){if(typeof re=="object"&&re!==null&&re.type===f&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case S:e:{for(var be=re.key;Z!==null;){if(Z.key===be){if(be=re.type,be===f){if(Z.tag===7){i(te,Z.sibling),ce=l(Z,re.props.children),ce.return=te,te=ce;break e}}else if(Z.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===b&&kr(be)===Z.type){i(te,Z.sibling),ce=l(Z,re.props),Xs(ce,re),ce.return=te,te=ce;break e}i(te,Z);break}else t(te,Z);Z=Z.sibling}re.type===f?(ce=Lr(re.props.children,te.mode,ce,re.key),ce.return=te,te=ce):(ce=Yn(re.type,re.key,re.props,null,te.mode,ce),Xs(ce,re),ce.return=te,te=ce)}return L(te);case w:e:{for(be=re.key;Z!==null;){if(Z.key===be)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){i(te,Z.sibling),ce=l(Z,re.children||[]),ce.return=te,te=ce;break e}else{i(te,Z);break}else t(te,Z);Z=Z.sibling}ce=Io(re,te.mode,ce),ce.return=te,te=ce}return L(te);case b:return re=kr(re),Xe(te,Z,re,ce)}if(K(re))return pe(te,Z,re,ce);if(M(re)){if(be=M(re),typeof be!="function")throw Error(A(150));return re=be.call(re),Ce(te,Z,re,ce)}if(typeof re.then=="function")return Xe(te,Z,ia(re),ce);if(re.$$typeof===h)return Xe(te,Z,Zn(te,re),ce);ra(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Z!==null&&Z.tag===6?(i(te,Z.sibling),ce=l(Z,re),ce.return=te,te=ce):(i(te,Z),ce=zo(re,te.mode,ce),ce.return=te,te=ce),L(te)):i(te,Z)}return function(te,Z,re,ce){try{Vs=0;var be=Xe(te,Z,re,ce);return cs=null,be}catch(me){if(me===ls||me===ea)throw me;var Ne=Zt(29,me,null,te.mode);return Ne.lanes=ce,Ne.return=te,Ne}finally{}}}var zr=eh(!0),th=eh(!1),sr=!1;function Yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ko(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ar(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Fe&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,t=Xn(e),Uu(e,null,i),t}return Vn(e,r,t,i),Xn(e)}function Ys(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}function Qo(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var l=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var L={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?l=g=L:g=g.next=L,i=i.next}while(i!==null);g===null?l=g=t:g=g.next=t}else l=g=t;i={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:g,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Zo=!1;function Ks(){if(Zo){var e=os;if(e!==null)throw e}}function Qs(e,t,i,r){Zo=!1;var l=e.updateQueue;sr=!1;var g=l.firstBaseUpdate,L=l.lastBaseUpdate,N=l.shared.pending;if(N!==null){l.shared.pending=null;var Y=N,se=Y.next;Y.next=null,L===null?g=se:L.next=se,L=Y;var le=e.alternate;le!==null&&(le=le.updateQueue,N=le.lastBaseUpdate,N!==L&&(N===null?le.firstBaseUpdate=se:N.next=se,le.lastBaseUpdate=Y))}if(g!==null){var de=l.baseState;L=0,le=se=Y=null,N=g;do{var ne=N.lane&-536870913,oe=ne!==N.lane;if(oe?(He&ne)===ne:(r&ne)===ne){ne!==0&&ne===as&&(Zo=!0),le!==null&&(le=le.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var pe=e,Ce=N;ne=t;var Xe=i;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){de=pe.call(Xe,de,ne);break e}de=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,ne=typeof pe=="function"?pe.call(Xe,de,ne):pe,ne==null)break e;de=a({},de,ne);break e;case 2:sr=!0}}ne=N.callback,ne!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=l.callbacks,oe===null?l.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},le===null?(se=le=oe,Y=de):le=le.next=oe,L|=ne;if(N=N.next,N===null){if(N=l.shared.pending,N===null)break;oe=N,N=oe.next,oe.next=null,l.lastBaseUpdate=oe,l.shared.pending=null}}while(!0);le===null&&(Y=de),l.baseState=Y,l.firstBaseUpdate=se,l.lastBaseUpdate=le,g===null&&(l.shared.lanes=0),hr|=L,e.lanes=L,e.memoizedState=de}}function ih(e,t){if(typeof e!="function")throw Error(A(191,e));e.call(t)}function rh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)ih(i[e],t)}var us=B(null),sa=B(0);function sh(e,t){e=Xi,Q(sa,e),Q(us,t),Xi=e|t.baseLanes}function Jo(){Q(sa,Xi),Q(us,us.current)}function el(){Xi=sa.current,j(us),j(sa)}var Jt=B(null),_i=null;function or(e){var t=e.alternate;Q(at,at.current&1),Q(Jt,e),_i===null&&(t===null||us.current!==null||t.memoizedState!==null)&&(_i=e)}function tl(e){Q(at,at.current),Q(Jt,e),_i===null&&(_i=e)}function nh(e){e.tag===22?(Q(at,at.current),Q(Jt,e),_i===null&&(_i=e)):lr()}function lr(){Q(at,at.current),Q(Jt,Jt.current)}function ei(e){j(Jt),_i===e&&(_i=null),j(at)}var at=B(0);function na(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||oc(i)||lc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ji=0,Le=null,$e=null,dt=null,aa=!1,hs=!1,Ir=!1,oa=0,Zs=0,ds=null,_g=0;function st(){throw Error(A(321))}function il(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Qt(e[i],t[i]))return!1;return!0}function rl(e,t,i,r,l,g){return ji=g,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?Fh:ml,Ir=!1,g=i(r,l),Ir=!1,hs&&(g=oh(t,i,r,l)),ah(e),g}function ah(e){W.H=tn;var t=$e!==null&&$e.next!==null;if(ji=0,dt=$e=Le=null,aa=!1,Zs=0,ds=null,t)throw Error(A(300));e===null||ft||(e=e.dependencies,e!==null&&Qn(e)&&(ft=!0))}function oh(e,t,i,r){Le=e;var l=0;do{if(hs&&(ds=null),Zs=0,hs=!1,25<=l)throw Error(A(301));if(l+=1,dt=$e=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}W.H=qh,g=t(i,r)}while(hs);return g}function vg(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?Js(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(Le.flags|=1024),t}function sl(){var e=oa!==0;return oa=0,e}function nl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function al(e){if(aa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}aa=!1}ji=0,dt=$e=Le=null,hs=!1,Zs=oa=0,ds=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Le.memoizedState=dt=e:dt=dt.next=e,dt}function ot(){if($e===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=dt===null?Le.memoizedState:dt.next;if(t!==null)dt=t,$e=e;else{if(e===null)throw Le.alternate===null?Error(A(467)):Error(A(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},dt===null?Le.memoizedState=dt=e:dt=dt.next=e}return dt}function la(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Js(e){var t=Zs;return Zs+=1,ds===null&&(ds=[]),e=Qu(ds,e,t),t=Le,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?Fh:ml),e}function ca(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Js(e);if(e.$$typeof===h)return Lt(e)}throw Error(A(438,String(e)))}function ol(e){var t=null,i=Le.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Le.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=la(),Le.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=T;return t.index++,i}function Pi(e,t){return typeof t=="function"?t(e):t}function ua(e){var t=ot();return ll(t,$e,e)}function ll(e,t,i){var r=e.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=i;var l=e.baseQueue,g=r.pending;if(g!==null){if(l!==null){var L=l.next;l.next=g.next,g.next=L}t.baseQueue=l=g,r.pending=null}if(g=e.baseState,l===null)e.memoizedState=g;else{t=l.next;var N=L=null,Y=null,se=t,le=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(He&de)===de:(ji&de)===de){var ne=se.revertLane;if(ne===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===as&&(le=!0);else if((ji&ne)===ne){se=se.next,ne===as&&(le=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(N=Y=de,L=g):Y=Y.next=de,Le.lanes|=ne,hr|=ne;de=se.action,Ir&&i(g,de),g=se.hasEagerState?se.eagerState:i(g,de)}else ne={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(N=Y=ne,L=g):Y=Y.next=ne,Le.lanes|=de,hr|=de;se=se.next}while(se!==null&&se!==t);if(Y===null?L=g:Y.next=N,!Qt(g,e.memoizedState)&&(ft=!0,le&&(i=os,i!==null)))throw i;e.memoizedState=g,e.baseState=L,e.baseQueue=Y,r.lastRenderedState=g}return l===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function cl(e){var t=ot(),i=t.queue;if(i===null)throw Error(A(311));i.lastRenderedReducer=e;var r=i.dispatch,l=i.pending,g=t.memoizedState;if(l!==null){i.pending=null;var L=l=l.next;do g=e(g,L.action),L=L.next;while(L!==l);Qt(g,t.memoizedState)||(ft=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),i.lastRenderedState=g}return[g,r]}function lh(e,t,i){var r=Le,l=ot(),g=Ie;if(g){if(i===void 0)throw Error(A(407));i=i()}else i=t();var L=!Qt(($e||l).memoizedState,i);if(L&&(l.memoizedState=i,ft=!0),l=l.queue,dl(hh.bind(null,r,l,e),[e]),l.getSnapshot!==t||L||dt!==null&&dt.memoizedState.tag&1){if(r.flags|=2048,fs(9,{destroy:void 0},uh.bind(null,r,l,i,t),null),Ye===null)throw Error(A(349));g||(ji&127)!==0||ch(r,t,i)}return i}function ch(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Le.updateQueue,t===null?(t=la(),Le.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function uh(e,t,i,r){t.value=i,t.getSnapshot=r,dh(t)&&fh(e)}function hh(e,t,i){return i(function(){dh(t)&&fh(e)})}function dh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Qt(e,i)}catch{return!0}}function fh(e){var t=Dr(e,2);t!==null&&$t(t,e,2)}function ul(e){var t=Ht();if(typeof e=="function"){var i=e;if(e=i(),Ir){Rt(!0);try{i()}finally{Rt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:e},t}function _h(e,t,i,r){return e.baseState=i,ll(e,$e,typeof r=="function"?r:Pi)}function gg(e,t,i,r,l){if(fa(e))throw Error(A(485));if(e=t.action,e!==null){var g={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){g.listeners.push(L)}};W.T!==null?i(!0):g.isTransition=!1,r(g),i=t.pending,i===null?(g.next=t.pending=g,vh(t,g)):(g.next=i.next,t.pending=i.next=g)}}function vh(e,t){var i=t.action,r=t.payload,l=e.state;if(t.isTransition){var g=W.T,L={};W.T=L;try{var N=i(l,r),Y=W.S;Y!==null&&Y(L,N),gh(e,t,N)}catch(se){hl(e,t,se)}finally{g!==null&&L.types!==null&&(g.types=L.types),W.T=g}}else try{g=i(l,r),gh(e,t,g)}catch(se){hl(e,t,se)}}function gh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){ph(e,t,r)},function(r){return hl(e,t,r)}):ph(e,t,i)}function ph(e,t,i){t.status="fulfilled",t.value=i,mh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,vh(e,i)))}function hl(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,mh(t),t=t.next;while(t!==r)}e.action=null}function mh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sh(e,t){return t}function bh(e,t){if(Ie){var i=Ye.formState;if(i!==null){e:{var r=Le;if(Ie){if(Je){t:{for(var l=Je,g=fi;l.nodeType!==8;){if(!g){l=null;break t}if(l=vi(l.nextSibling),l===null){l=null;break t}}g=l.data,l=g==="F!"||g==="F"?l:null}if(l){Je=vi(l.nextSibling),r=l.data==="F!";break e}}ir(r)}r=!1}r&&(t=i[0])}}return i=Ht(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:t},i.queue=r,i=Nh.bind(null,Le,r),r.dispatch=i,r=ul(!1),g=pl.bind(null,Le,!1,r.queue),r=Ht(),l={state:t,dispatch:null,action:e,pending:null},r.queue=l,i=gg.bind(null,Le,l,g,i),l.dispatch=i,r.memoizedState=e,[t,i,!1]}function yh(e){var t=ot();return Ch(t,$e,e)}function Ch(e,t,i){if(t=ll(e,t,Sh)[0],e=ua(Pi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Js(t)}catch(L){throw L===ls?ea:L}else r=t;t=ot();var l=t.queue,g=l.dispatch;return i!==t.memoizedState&&(Le.flags|=2048,fs(9,{destroy:void 0},pg.bind(null,l,i),null)),[r,g,e]}function pg(e,t){e.action=t}function wh(e){var t=ot(),i=$e;if(i!==null)return Ch(t,i,e);ot(),t=t.memoizedState,i=ot();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function fs(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Le.updateQueue,t===null&&(t=la(),Le.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function xh(){return ot().memoizedState}function ha(e,t,i,r){var l=Ht();Le.flags|=e,l.memoizedState=fs(1|t,{destroy:void 0},i,r===void 0?null:r)}function da(e,t,i,r){var l=ot();r=r===void 0?null:r;var g=l.memoizedState.inst;$e!==null&&r!==null&&il(r,$e.memoizedState.deps)?l.memoizedState=fs(t,g,i,r):(Le.flags|=e,l.memoizedState=fs(1|t,g,i,r))}function Eh(e,t){ha(8390656,8,e,t)}function dl(e,t){da(2048,8,e,t)}function mg(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=la(),Le.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Rh(e){var t=ot().memoizedState;return mg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(A(440));return t.impl.apply(void 0,arguments)}}function Ah(e,t){return da(4,2,e,t)}function Dh(e,t){return da(4,4,e,t)}function Lh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Th(e,t,i){i=i!=null?i.concat([e]):null,da(4,4,Lh.bind(null,t,e),i)}function fl(){}function Mh(e,t){var i=ot();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&il(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Oh(e,t){var i=ot();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&il(t,r[1]))return r[0];if(r=e(),Ir){Rt(!0);try{e()}finally{Rt(!1)}}return i.memoizedState=[r,t],r}function _l(e,t,i){return i===void 0||(ji&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Bd(),Le.lanes|=e,hr|=e,i)}function Bh(e,t,i,r){return Qt(i,t)?i:us.current!==null?(e=_l(e,i,r),Qt(e,t)||(ft=!0),e):(ji&42)===0||(ji&1073741824)!==0&&(He&261930)===0?(ft=!0,e.memoizedState=i):(e=Bd(),Le.lanes|=e,hr|=e,t)}function kh(e,t,i,r,l){var g=$.p;$.p=g!==0&&8>g?g:8;var L=W.T,N={};W.T=N,pl(e,!1,t,i);try{var Y=l(),se=W.S;if(se!==null&&se(N,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var le=fg(Y,r);en(e,t,le,ri(e))}else en(e,t,r,ri(e))}catch(de){en(e,t,{then:function(){},status:"rejected",reason:de},ri())}finally{$.p=g,L!==null&&N.types!==null&&(L.types=N.types),W.T=L}}function Sg(){}function vl(e,t,i,r){if(e.tag!==5)throw Error(A(476));var l=Hh(e).queue;kh(e,l,t,V,i===null?Sg:function(){return zh(e),i(r)})}function Hh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:V},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zh(e){var t=Hh(e);t.next===null&&(t=e.alternate.memoizedState),en(e,t.next.queue,{},ri())}function gl(){return Lt(mn)}function Ih(){return ot().memoizedState}function Uh(){return ot().memoizedState}function bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ri();e=nr(i);var r=ar(t,e,i);r!==null&&($t(r,t,i),Ys(r,t,i)),t={cache:Go()},e.payload=t;return}t=t.return}}function yg(e,t,i){var r=ri();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fa(e)?jh(t,i):(i=ko(e,t,i,r),i!==null&&($t(i,e,r),Ph(i,t,r)))}function Nh(e,t,i){var r=ri();en(e,t,i,r)}function en(e,t,i,r){var l={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fa(e))jh(t,l);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var L=t.lastRenderedState,N=g(L,i);if(l.hasEagerState=!0,l.eagerState=N,Qt(N,L))return Vn(e,t,l,0),Ye===null&&$n(),!1}catch{}finally{}if(i=ko(e,t,l,r),i!==null)return $t(i,e,r),Ph(i,t,r),!0}return!1}function pl(e,t,i,r){if(r={lane:2,revertLane:Yl(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fa(e)){if(t)throw Error(A(479))}else t=ko(e,i,r,2),t!==null&&$t(t,e,2)}function fa(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function jh(e,t){hs=aa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ph(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}var tn={readContext:Lt,use:ca,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};tn.useEffectEvent=st;var Fh={readContext:Lt,use:ca,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Eh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ha(4194308,4,Lh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ha(4194308,4,e,t)},useInsertionEffect:function(e,t){ha(4,2,e,t)},useMemo:function(e,t){var i=Ht();t=t===void 0?null:t;var r=e();if(Ir){Rt(!0);try{e()}finally{Rt(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=Ht();if(i!==void 0){var l=i(t);if(Ir){Rt(!0);try{i(t)}finally{Rt(!1)}}}else l=t;return r.memoizedState=r.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},r.queue=e,e=e.dispatch=yg.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=ul(e);var t=e.queue,i=Nh.bind(null,Le,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:fl,useDeferredValue:function(e,t){var i=Ht();return _l(i,e,t)},useTransition:function(){var e=ul(!1);return e=kh.bind(null,Le,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Le,l=Ht();if(Ie){if(i===void 0)throw Error(A(407));i=i()}else{if(i=t(),Ye===null)throw Error(A(349));(He&127)!==0||ch(r,t,i)}l.memoizedState=i;var g={value:i,getSnapshot:t};return l.queue=g,Eh(hh.bind(null,r,g,e),[e]),r.flags|=2048,fs(9,{destroy:void 0},uh.bind(null,r,g,i,t),null),i},useId:function(){var e=Ht(),t=Ye.identifierPrefix;if(Ie){var i=Ri,r=Ei;i=(r&~(1<<32-gt(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=oa++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=_g++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gl,useFormState:bh,useActionState:bh,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=pl.bind(null,Le,!0,i),i.dispatch=t,[e,t]},useMemoCache:ol,useCacheRefresh:function(){return Ht().memoizedState=bg.bind(null,Le)},useEffectEvent:function(e){var t=Ht(),i={impl:e};return t.memoizedState=i,function(){if((Fe&2)!==0)throw Error(A(440));return i.impl.apply(void 0,arguments)}}},ml={readContext:Lt,use:ca,useCallback:Mh,useContext:Lt,useEffect:dl,useImperativeHandle:Th,useInsertionEffect:Ah,useLayoutEffect:Dh,useMemo:Oh,useReducer:ua,useRef:xh,useState:function(){return ua(Pi)},useDebugValue:fl,useDeferredValue:function(e,t){var i=ot();return Bh(i,$e.memoizedState,e,t)},useTransition:function(){var e=ua(Pi)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:Js(e),t]},useSyncExternalStore:lh,useId:Ih,useHostTransitionStatus:gl,useFormState:yh,useActionState:yh,useOptimistic:function(e,t){var i=ot();return _h(i,$e,e,t)},useMemoCache:ol,useCacheRefresh:Uh};ml.useEffectEvent=Rh;var qh={readContext:Lt,use:ca,useCallback:Mh,useContext:Lt,useEffect:dl,useImperativeHandle:Th,useInsertionEffect:Ah,useLayoutEffect:Dh,useMemo:Oh,useReducer:cl,useRef:xh,useState:function(){return cl(Pi)},useDebugValue:fl,useDeferredValue:function(e,t){var i=ot();return $e===null?_l(i,e,t):Bh(i,$e.memoizedState,e,t)},useTransition:function(){var e=cl(Pi)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:Js(e),t]},useSyncExternalStore:lh,useId:Ih,useHostTransitionStatus:gl,useFormState:wh,useActionState:wh,useOptimistic:function(e,t){var i=ot();return $e!==null?_h(i,$e,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ol,useCacheRefresh:Uh};qh.useEffectEvent=Rh;function Sl(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:a({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var bl={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=ri(),l=nr(r);l.payload=t,i!=null&&(l.callback=i),t=ar(e,l,r),t!==null&&($t(t,e,r),Ys(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=ri(),l=nr(r);l.tag=1,l.payload=t,i!=null&&(l.callback=i),t=ar(e,l,r),t!==null&&($t(t,e,r),Ys(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ri(),r=nr(i);r.tag=2,t!=null&&(r.callback=t),t=ar(e,r,i),t!==null&&($t(t,e,i),Ys(t,e,i))}};function Wh(e,t,i,r,l,g,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,g,L):t.prototype&&t.prototype.isPureReactComponent?!Ps(i,r)||!Ps(l,g):!0}function Gh(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&bl.enqueueReplaceState(t,t.state,null)}function Ur(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=a({},i));for(var l in e)i[l]===void 0&&(i[l]=e[l])}return i}function $h(e){Gn(e)}function Vh(e){console.error(e)}function Xh(e){Gn(e)}function _a(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Yh(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function yl(e,t,i){return i=nr(i),i.tag=3,i.payload={element:null},i.callback=function(){_a(e,t)},i}function Kh(e){return e=nr(e),e.tag=3,e}function Qh(e,t,i,r){var l=i.type.getDerivedStateFromError;if(typeof l=="function"){var g=r.value;e.payload=function(){return l(g)},e.callback=function(){Yh(t,i,r)}}var L=i.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){Yh(t,i,r),typeof l!="function"&&(dr===null?dr=new Set([this]):dr.add(this));var N=r.stack;this.componentDidCatch(r.value,{componentStack:N!==null?N:""})})}function Cg(e,t,i,r,l){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&ns(t,i,l,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:return _i===null?Ra():i.alternate===null&&nt===0&&(nt=3),i.flags&=-257,i.flags|=65536,i.lanes=l,r===ta?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),$l(e,r,l)),!1;case 22:return i.flags|=65536,r===ta?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),$l(e,r,l)),!1}throw Error(A(435,i.tag))}return $l(e,r,l),Ra(),!1}if(Ie)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,r!==jo&&(e=Error(A(422),{cause:r}),Ws(ui(e,i)))):(r!==jo&&(t=Error(A(423),{cause:r}),Ws(ui(t,i))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,r=ui(r,i),l=yl(e.stateNode,r,l),Qo(e,l),nt!==4&&(nt=2)),!1;var g=Error(A(520),{cause:r});if(g=ui(g,i),un===null?un=[g]:un.push(g),nt!==4&&(nt=2),t===null)return!0;r=ui(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=l&-l,i.lanes|=e,e=yl(i.stateNode,r,e),Qo(i,e),!1;case 1:if(t=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(dr===null||!dr.has(g))))return i.flags|=65536,l&=-l,i.lanes|=l,l=Kh(l),Qh(l,e,i,r),Qo(i,l),!1}i=i.return}while(i!==null);return!1}var Cl=Error(A(461)),ft=!1;function Tt(e,t,i,r){t.child=e===null?th(t,null,i,r):zr(t,e.child,i,r)}function Zh(e,t,i,r,l){i=i.render;var g=t.ref;if("ref"in r){var L={};for(var N in r)N!=="ref"&&(L[N]=r[N])}else L=r;return Or(t),r=rl(e,t,i,L,g,l),N=sl(),e!==null&&!ft?(nl(e,t,l),Fi(e,t,l)):(Ie&&N&&Uo(t),t.flags|=1,Tt(e,t,r,l),t.child)}function Jh(e,t,i,r,l){if(e===null){var g=i.type;return typeof g=="function"&&!Ho(g)&&g.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=g,ed(e,t,g,r,l)):(e=Yn(i.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Tl(e,l)){var L=g.memoizedProps;if(i=i.compare,i=i!==null?i:Ps,i(L,r)&&e.ref===t.ref)return Fi(e,t,l)}return t.flags|=1,e=zi(g,r),e.ref=t.ref,e.return=t,t.child=e}function ed(e,t,i,r,l){if(e!==null){var g=e.memoizedProps;if(Ps(g,r)&&e.ref===t.ref)if(ft=!1,t.pendingProps=r=g,Tl(e,l))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Fi(e,t,l)}return wl(e,t,i,r,l)}function td(e,t,i,r){var l=r.children,g=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(g=g!==null?g.baseLanes|i:i,e!==null){for(r=t.child=e.child,l=0;r!==null;)l=l|r.lanes|r.childLanes,r=r.sibling;r=l&~g}else r=0,t.child=null;return id(e,t,g,i,r)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Jn(t,g!==null?g.cachePool:null),g!==null?sh(t,g):Jo(),nh(t);else return r=t.lanes=536870912,id(e,t,g!==null?g.baseLanes|i:i,i,r)}else g!==null?(Jn(t,g.cachePool),sh(t,g),lr(),t.memoizedState=null):(e!==null&&Jn(t,null),Jo(),lr());return Tt(e,t,l,i),t.child}function rn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function id(e,t,i,r,l){var g=Vo();return g=g===null?null:{parent:ht._currentValue,pool:g},t.memoizedState={baseLanes:i,cachePool:g},e!==null&&Jn(t,null),Jo(),nh(t),e!==null&&ns(e,t,r,!0),t.childLanes=l,null}function va(e,t){return t=pa({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function rd(e,t,i){return zr(t,e.child,null,i),e=va(t,t.pendingProps),e.flags|=2,ei(t),t.memoizedState=null,e}function wg(e,t,i){var r=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(r.mode==="hidden")return e=va(t,r),t.lanes=536870912,rn(null,e);if(tl(t),(e=Je)?(e=gf(e,fi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:er!==null?{id:Ei,overflow:Ri}:null,retryLane:536870912,hydrationErrors:null},i=ju(e),i.return=t,t.child=i,Dt=t,Je=null)):e=null,e===null)throw ir(t);return t.lanes=536870912,null}return va(t,r)}var g=e.memoizedState;if(g!==null){var L=g.dehydrated;if(tl(t),l)if(t.flags&256)t.flags&=-257,t=rd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(A(558));else if(ft||ns(e,t,i,!1),l=(i&e.childLanes)!==0,ft||l){if(r=Ye,r!==null&&(L=ni(r,i),L!==0&&L!==g.retryLane))throw g.retryLane=L,Dr(e,L),$t(r,e,L),Cl;Ra(),t=rd(e,t,i)}else e=g.treeContext,Je=vi(L.nextSibling),Dt=t,Ie=!0,tr=null,fi=!1,e!==null&&qu(t,e),t=va(t,r),t.flags|=4096;return t}return e=zi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ga(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(A(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function wl(e,t,i,r,l){return Or(t),i=rl(e,t,i,r,void 0,l),r=sl(),e!==null&&!ft?(nl(e,t,l),Fi(e,t,l)):(Ie&&r&&Uo(t),t.flags|=1,Tt(e,t,i,l),t.child)}function sd(e,t,i,r,l,g){return Or(t),t.updateQueue=null,i=oh(t,r,i,l),ah(e),r=sl(),e!==null&&!ft?(nl(e,t,g),Fi(e,t,g)):(Ie&&r&&Uo(t),t.flags|=1,Tt(e,t,i,g),t.child)}function nd(e,t,i,r,l){if(Or(t),t.stateNode===null){var g=ts,L=i.contextType;typeof L=="object"&&L!==null&&(g=Lt(L)),g=new i(r,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bl,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=r,g.state=t.memoizedState,g.refs={},Yo(t),L=i.contextType,g.context=typeof L=="object"&&L!==null?Lt(L):ts,g.state=t.memoizedState,L=i.getDerivedStateFromProps,typeof L=="function"&&(Sl(t,i,L,r),g.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(L=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),L!==g.state&&bl.enqueueReplaceState(g,g.state,null),Qs(t,r,g,l),Ks(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){g=t.stateNode;var N=t.memoizedProps,Y=Ur(i,N);g.props=Y;var se=g.context,le=i.contextType;L=ts,typeof le=="object"&&le!==null&&(L=Lt(le));var de=i.getDerivedStateFromProps;le=typeof de=="function"||typeof g.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,le||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(N||se!==L)&&Gh(t,g,r,L),sr=!1;var ne=t.memoizedState;g.state=ne,Qs(t,r,g,l),Ks(),se=t.memoizedState,N||ne!==se||sr?(typeof de=="function"&&(Sl(t,i,de,r),se=t.memoizedState),(Y=sr||Wh(t,i,Y,r,ne,se,L))?(le||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=se),g.props=r,g.state=se,g.context=L,r=Y):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{g=t.stateNode,Ko(e,t),L=t.memoizedProps,le=Ur(i,L),g.props=le,de=t.pendingProps,ne=g.context,se=i.contextType,Y=ts,typeof se=="object"&&se!==null&&(Y=Lt(se)),N=i.getDerivedStateFromProps,(se=typeof N=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(L!==de||ne!==Y)&&Gh(t,g,r,Y),sr=!1,ne=t.memoizedState,g.state=ne,Qs(t,r,g,l),Ks();var oe=t.memoizedState;L!==de||ne!==oe||sr||e!==null&&e.dependencies!==null&&Qn(e.dependencies)?(typeof N=="function"&&(Sl(t,i,N,r),oe=t.memoizedState),(le=sr||Wh(t,i,le,r,ne,oe,Y)||e!==null&&e.dependencies!==null&&Qn(e.dependencies))?(se||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(r,oe,Y),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(r,oe,Y)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||L===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=oe),g.props=r,g.state=oe,g.context=Y,r=le):(typeof g.componentDidUpdate!="function"||L===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),r=!1)}return g=r,ga(e,t),r=(t.flags&128)!==0,g||r?(g=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&r?(t.child=zr(t,e.child,null,l),t.child=zr(t,null,i,l)):Tt(e,t,i,l),t.memoizedState=g.state,e=t.child):e=Fi(e,t,l),e}function ad(e,t,i,r){return Tr(),t.flags|=256,Tt(e,t,i,r),t.child}var xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function El(e){return{baseLanes:e,cachePool:Yu()}}function Rl(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ii),e}function od(e,t,i){var r=t.pendingProps,l=!1,g=(t.flags&128)!==0,L;if((L=g)||(L=e!==null&&e.memoizedState===null?!1:(at.current&2)!==0),L&&(l=!0,t.flags&=-129),L=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(l?or(t):lr(),(e=Je)?(e=gf(e,fi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:er!==null?{id:Ei,overflow:Ri}:null,retryLane:536870912,hydrationErrors:null},i=ju(e),i.return=t,t.child=i,Dt=t,Je=null)):e=null,e===null)throw ir(t);return lc(e)?t.lanes=32:t.lanes=536870912,null}var N=r.children;return r=r.fallback,l?(lr(),l=t.mode,N=pa({mode:"hidden",children:N},l),r=Lr(r,l,i,null),N.return=t,r.return=t,N.sibling=r,t.child=N,r=t.child,r.memoizedState=El(i),r.childLanes=Rl(e,L,i),t.memoizedState=xl,rn(null,r)):(or(t),Al(t,N))}var Y=e.memoizedState;if(Y!==null&&(N=Y.dehydrated,N!==null)){if(g)t.flags&256?(or(t),t.flags&=-257,t=Dl(e,t,i)):t.memoizedState!==null?(lr(),t.child=e.child,t.flags|=128,t=null):(lr(),N=r.fallback,l=t.mode,r=pa({mode:"visible",children:r.children},l),N=Lr(N,l,i,null),N.flags|=2,r.return=t,N.return=t,r.sibling=N,t.child=r,zr(t,e.child,null,i),r=t.child,r.memoizedState=El(i),r.childLanes=Rl(e,L,i),t.memoizedState=xl,t=rn(null,r));else if(or(t),lc(N)){if(L=N.nextSibling&&N.nextSibling.dataset,L)var se=L.dgst;L=se,r=Error(A(419)),r.stack="",r.digest=L,Ws({value:r,source:null,stack:null}),t=Dl(e,t,i)}else if(ft||ns(e,t,i,!1),L=(i&e.childLanes)!==0,ft||L){if(L=Ye,L!==null&&(r=ni(L,i),r!==0&&r!==Y.retryLane))throw Y.retryLane=r,Dr(e,r),$t(L,e,r),Cl;oc(N)||Ra(),t=Dl(e,t,i)}else oc(N)?(t.flags|=192,t.child=e.child,t=null):(e=Y.treeContext,Je=vi(N.nextSibling),Dt=t,Ie=!0,tr=null,fi=!1,e!==null&&qu(t,e),t=Al(t,r.children),t.flags|=4096);return t}return l?(lr(),N=r.fallback,l=t.mode,Y=e.child,se=Y.sibling,r=zi(Y,{mode:"hidden",children:r.children}),r.subtreeFlags=Y.subtreeFlags&65011712,se!==null?N=zi(se,N):(N=Lr(N,l,i,null),N.flags|=2),N.return=t,r.return=t,r.sibling=N,t.child=r,rn(null,r),r=t.child,N=e.child.memoizedState,N===null?N=El(i):(l=N.cachePool,l!==null?(Y=ht._currentValue,l=l.parent!==Y?{parent:Y,pool:Y}:l):l=Yu(),N={baseLanes:N.baseLanes|i,cachePool:l}),r.memoizedState=N,r.childLanes=Rl(e,L,i),t.memoizedState=xl,rn(e.child,r)):(or(t),i=e.child,e=i.sibling,i=zi(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(L=t.deletions,L===null?(t.deletions=[e],t.flags|=16):L.push(e)),t.child=i,t.memoizedState=null,i)}function Al(e,t){return t=pa({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pa(e,t){return e=Zt(22,e,null,t),e.lanes=0,e}function Dl(e,t,i){return zr(t,e.child,null,i),e=Al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ld(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qo(e.return,t,i)}function Ll(e,t,i,r,l,g){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:l,treeForkCount:g}:(L.isBackwards=t,L.rendering=null,L.renderingStartTime=0,L.last=r,L.tail=i,L.tailMode=l,L.treeForkCount=g)}function cd(e,t,i){var r=t.pendingProps,l=r.revealOrder,g=r.tail;r=r.children;var L=at.current,N=(L&2)!==0;if(N?(L=L&1|2,t.flags|=128):L&=1,Q(at,L),Tt(e,t,r,i),r=Ie?qs:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ld(e,i,t);else if(e.tag===19)ld(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(i=t.child,l=null;i!==null;)e=i.alternate,e!==null&&na(e)===null&&(l=i),i=i.sibling;i=l,i===null?(l=t.child,t.child=null):(l=i.sibling,i.sibling=null),Ll(t,!1,l,i,g,r);break;case"backwards":case"unstable_legacy-backwards":for(i=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&na(e)===null){t.child=l;break}e=l.sibling,l.sibling=i,i=l,l=e}Ll(t,!0,i,null,g,r);break;case"together":Ll(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),hr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ns(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,i=zi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=zi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Tl(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qn(e)))}function xg(e,t,i){switch(t.tag){case 3:F(t,t.stateNode.containerInfo),rr(t,ht,e.memoizedState.cache),Tr();break;case 27:case 5:ie(t);break;case 4:F(t,t.stateNode.containerInfo);break;case 10:rr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(or(t),t.flags|=128,null):(i&t.child.childLanes)!==0?od(e,t,i):(or(t),e=Fi(e,t,i),e!==null?e.sibling:null);or(t);break;case 19:var l=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(ns(e,t,i,!1),r=(i&t.childLanes)!==0),l){if(r)return cd(e,t,i);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(at,at.current),r)break;return null;case 22:return t.lanes=0,td(e,t,i,t.pendingProps);case 24:rr(t,ht,e.memoizedState.cache)}return Fi(e,t,i)}function ud(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!Tl(e,i)&&(t.flags&128)===0)return ft=!1,xg(e,t,i);ft=(e.flags&131072)!==0}else ft=!1,Ie&&(t.flags&1048576)!==0&&Fu(t,qs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=kr(t.elementType),t.type=e,typeof e=="function")Ho(e)?(r=Ur(e,r),t.tag=1,t=nd(null,t,e,r,i)):(t.tag=0,t=wl(null,t,e,r,i));else{if(e!=null){var l=e.$$typeof;if(l===m){t.tag=11,t=Zh(null,t,e,r,i);break e}else if(l===E){t.tag=14,t=Jh(null,t,e,r,i);break e}}throw t=U(e)||e,Error(A(306,t,""))}}return t;case 0:return wl(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,l=Ur(r,t.pendingProps),nd(e,t,r,l,i);case 3:e:{if(F(t,t.stateNode.containerInfo),e===null)throw Error(A(387));r=t.pendingProps;var g=t.memoizedState;l=g.element,Ko(e,t),Qs(t,r,null,i);var L=t.memoizedState;if(r=L.cache,rr(t,ht,r),r!==g.cache&&Wo(t,[ht],i,!0),Ks(),r=L.element,g.isDehydrated)if(g={element:r,isDehydrated:!1,cache:L.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=ad(e,t,r,i);break e}else if(r!==l){l=ui(Error(A(424)),t),Ws(l),t=ad(e,t,r,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Je=vi(e.firstChild),Dt=t,Ie=!0,tr=null,fi=!0,i=th(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Tr(),r===l){t=Fi(e,t,i);break e}Tt(e,t,r,i)}t=t.child}return t;case 26:return ga(e,t),e===null?(i=Cf(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,r=Ba(he.current).createElement(i),r[At]=t,r[jt]=e,Mt(r,i,e),Ct(r),t.stateNode=r):t.memoizedState=Cf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ie(t),e===null&&Ie&&(r=t.stateNode=Sf(t.type,t.pendingProps,he.current),Dt=t,fi=!0,l=Je,gr(t.type)?(cc=l,Je=vi(r.firstChild)):Je=l),Tt(e,t,t.pendingProps.children,i),ga(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((l=r=Je)&&(r=e0(r,t.type,t.pendingProps,fi),r!==null?(t.stateNode=r,Dt=t,Je=vi(r.firstChild),fi=!1,l=!0):l=!1),l||ir(t)),ie(t),l=t.type,g=t.pendingProps,L=e!==null?e.memoizedProps:null,r=g.children,sc(l,g)?r=null:L!==null&&sc(l,L)&&(t.flags|=32),t.memoizedState!==null&&(l=rl(e,t,vg,null,null,i),mn._currentValue=l),ga(e,t),Tt(e,t,r,i),t.child;case 6:return e===null&&Ie&&((e=i=Je)&&(i=t0(i,t.pendingProps,fi),i!==null?(t.stateNode=i,Dt=t,Je=null,e=!0):e=!1),e||ir(t)),null;case 13:return od(e,t,i);case 4:return F(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zr(t,null,r,i):Tt(e,t,r,i),t.child;case 11:return Zh(e,t,t.type,t.pendingProps,i);case 7:return Tt(e,t,t.pendingProps,i),t.child;case 8:return Tt(e,t,t.pendingProps.children,i),t.child;case 12:return Tt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,rr(t,t.type,r.value),Tt(e,t,r.children,i),t.child;case 9:return l=t.type._context,r=t.pendingProps.children,Or(t),l=Lt(l),r=r(l),t.flags|=1,Tt(e,t,r,i),t.child;case 14:return Jh(e,t,t.type,t.pendingProps,i);case 15:return ed(e,t,t.type,t.pendingProps,i);case 19:return cd(e,t,i);case 31:return wg(e,t,i);case 22:return td(e,t,i,t.pendingProps);case 24:return Or(t),r=Lt(ht),e===null?(l=Vo(),l===null&&(l=Ye,g=Go(),l.pooledCache=g,g.refCount++,g!==null&&(l.pooledCacheLanes|=i),l=g),t.memoizedState={parent:r,cache:l},Yo(t),rr(t,ht,l)):((e.lanes&i)!==0&&(Ko(e,t),Qs(t,null,null,i),Ks()),l=e.memoizedState,g=t.memoizedState,l.parent!==r?(l={parent:r,cache:r},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),rr(t,ht,r)):(r=g.cache,rr(t,ht,r),r!==l.cache&&Wo(t,[ht],i,!0))),Tt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(A(156,t.tag))}function qi(e){e.flags|=4}function Ml(e,t,i,r,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Id())e.flags|=8192;else throw Hr=ta,Xo}else e.flags&=-16777217}function hd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Af(t))if(Id())e.flags|=8192;else throw Hr=ta,Xo}function ma(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Bt():536870912,e.lanes|=t,ps|=t)}function sn(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var l=e.child;l!==null;)i|=l.lanes|l.childLanes,r|=l.subtreeFlags&65011712,r|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)i|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function Eg(e,t,i){var r=t.pendingProps;switch(No(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ni(ht),ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ss(t)?qi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Po())),et(t),null;case 26:var l=t.type,g=t.memoizedState;return e===null?(qi(t),g!==null?(et(t),hd(t,g)):(et(t),Ml(t,l,null,r,i))):g?g!==e.memoizedState?(qi(t),et(t),hd(t,g)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&qi(t),et(t),Ml(t,l,e,r,i)),null;case 27:if(_e(t),i=he.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&qi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}e=J.current,ss(t)?Wu(t):(e=Sf(l,r,i),t.stateNode=e,qi(t))}return et(t),null;case 5:if(_e(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&qi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}if(g=J.current,ss(t))Wu(t);else{var L=Ba(he.current);switch(g){case 1:g=L.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:g=L.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":g=L.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":g=L.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":g=L.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof r.is=="string"?L.createElement("select",{is:r.is}):L.createElement("select"),r.multiple?g.multiple=!0:r.size&&(g.size=r.size);break;default:g=typeof r.is=="string"?L.createElement(l,{is:r.is}):L.createElement(l)}}g[At]=t,g[jt]=r;e:for(L=t.child;L!==null;){if(L.tag===5||L.tag===6)g.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===t)break e;for(;L.sibling===null;){if(L.return===null||L.return===t)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}t.stateNode=g;e:switch(Mt(g,l,r),l){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&qi(t)}}return et(t),Ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&qi(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(A(166));if(e=he.current,ss(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,l=Dt,l!==null)switch(l.tag){case 27:case 5:r=l.memoizedProps}e[At]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||lf(e.nodeValue,i)),e||ir(t,!0)}else e=Ba(e).createTextNode(r),e[At]=t,t.stateNode=e}return et(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=ss(t),i!==null){if(e===null){if(!r)throw Error(A(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(557));e[At]=t}else Tr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else i=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ei(t),t):(ei(t),null);if((t.flags&128)!==0)throw Error(A(558))}return et(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=ss(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(A(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(A(317));l[At]=t}else Tr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),l=!1}else l=Po(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(ei(t),t):(ei(t),null)}return ei(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,l=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(l=r.alternate.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==l&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ma(t,t.updateQueue),et(t),null);case 4:return ae(),e===null&&Jl(t.stateNode.containerInfo),et(t),null;case 10:return Ni(t.type),et(t),null;case 19:if(j(at),r=t.memoizedState,r===null)return et(t),null;if(l=(t.flags&128)!==0,g=r.rendering,g===null)if(l)sn(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=na(e),g!==null){for(t.flags|=128,sn(r,!1),e=g.updateQueue,t.updateQueue=e,ma(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Nu(i,e),i=i.sibling;return Q(at,at.current&1|2),Ie&&Ii(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>wa&&(t.flags|=128,l=!0,sn(r,!1),t.lanes=4194304)}else{if(!l)if(e=na(g),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,ma(t,e),sn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!g.alternate&&!Ie)return et(t),null}else 2*we()-r.renderingStartTime>wa&&i!==536870912&&(t.flags|=128,l=!0,sn(r,!1),t.lanes=4194304);r.isBackwards?(g.sibling=t.child,t.child=g):(e=r.last,e!==null?e.sibling=g:t.child=g,r.last=g)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,i=at.current,Q(at,l?i&1|2:i&1),Ie&&Ii(t,r.treeForkCount),e):(et(t),null);case 22:case 23:return ei(t),el(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),i=t.updateQueue,i!==null&&ma(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&j(Br),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ni(ht),et(t),null;case 25:return null;case 30:return null}throw Error(A(156,t.tag))}function Rg(e,t){switch(No(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ni(ht),ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ei(t),t.alternate===null)throw Error(A(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(at),null;case 4:return ae(),null;case 10:return Ni(t.type),null;case 22:case 23:return ei(t),el(),e!==null&&j(Br),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ni(ht),null;case 25:return null;default:return null}}function dd(e,t){switch(No(t),t.tag){case 3:Ni(ht),ae();break;case 26:case 27:case 5:_e(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&ei(t);break;case 13:ei(t);break;case 19:j(at);break;case 10:Ni(t.type);break;case 22:case 23:ei(t),el(),e!==null&&j(Br);break;case 24:Ni(ht)}}function nn(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var l=r.next;i=l;do{if((i.tag&e)===e){r=void 0;var g=i.create,L=i.inst;r=g(),L.destroy=r}i=i.next}while(i!==l)}}catch(N){Ge(t,t.return,N)}}function cr(e,t,i){try{var r=t.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var g=l.next;r=g;do{if((r.tag&e)===e){var L=r.inst,N=L.destroy;if(N!==void 0){L.destroy=void 0,l=t;var Y=i,se=N;try{se()}catch(le){Ge(l,Y,le)}}}r=r.next}while(r!==g)}}catch(le){Ge(t,t.return,le)}}function fd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{rh(t,i)}catch(r){Ge(e,e.return,r)}}}function _d(e,t,i){i.props=Ur(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){Ge(e,t,r)}}function an(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(l){Ge(e,t,l)}}function Ai(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(l){Ge(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(l){Ge(e,t,l)}else i.current=null}function vd(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(l){Ge(e,e.return,l)}}function Ol(e,t,i){try{var r=e.stateNode;Xg(r,e.type,i,t),r[jt]=t}catch(l){Ge(e,e.return,l)}}function gd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gr(e.type)||e.tag===4}function Bl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kl(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ki));else if(r!==4&&(r===27&&gr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(kl(e,t,i),e=e.sibling;e!==null;)kl(e,t,i),e=e.sibling}function Sa(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&gr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Sa(e,t,i),e=e.sibling;e!==null;)Sa(e,t,i),e=e.sibling}function pd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Mt(t,r,i),t[At]=e,t[jt]=i}catch(g){Ge(e,e.return,g)}}var Wi=!1,_t=!1,Hl=!1,md=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Ag(e,t){if(e=e.containerInfo,ic=ja,e=Tu(e),Do(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var l=r.anchorOffset,g=r.focusNode;r=r.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var L=0,N=-1,Y=-1,se=0,le=0,de=e,ne=null;t:for(;;){for(var oe;de!==i||l!==0&&de.nodeType!==3||(N=L+l),de!==g||r!==0&&de.nodeType!==3||(Y=L+r),de.nodeType===3&&(L+=de.nodeValue.length),(oe=de.firstChild)!==null;)ne=de,de=oe;for(;;){if(de===e)break t;if(ne===i&&++se===l&&(N=L),ne===g&&++le===r&&(Y=L),(oe=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=oe}i=N===-1||Y===-1?null:{start:N,end:Y}}else i=null}i=i||{start:0,end:0}}else i=null;for(rc={focusedElem:e,selectionRange:i},ja=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,g=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)l=e[i],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=t,l=g.memoizedProps,g=g.memoizedState,r=i.stateNode;try{var pe=Ur(i.type,l);e=r.getSnapshotBeforeUpdate(pe,g),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Ge(i,i.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)ac(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ac(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(A(163))}if(e=t.sibling,e!==null){e.return=t.return,wt=e;break}wt=t.return}}function Sd(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:$i(e,i),r&4&&nn(5,i);break;case 1:if($i(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(L){Ge(i,i.return,L)}else{var l=Ur(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(L){Ge(i,i.return,L)}}r&64&&fd(i),r&512&&an(i,i.return);break;case 3:if($i(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{rh(e,t)}catch(L){Ge(i,i.return,L)}}break;case 27:t===null&&r&4&&pd(i);case 26:case 5:$i(e,i),t===null&&r&4&&vd(i),r&512&&an(i,i.return);break;case 12:$i(e,i);break;case 31:$i(e,i),r&4&&Cd(e,i);break;case 13:$i(e,i),r&4&&wd(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=zg.bind(null,i),i0(e,i))));break;case 22:if(r=i.memoizedState!==null||Wi,!r){t=t!==null&&t.memoizedState!==null||_t,l=Wi;var g=_t;Wi=r,(_t=t)&&!g?Vi(e,i,(i.subtreeFlags&8772)!==0):$i(e,i),Wi=l,_t=g}break;case 30:break;default:$i(e,i)}}function bd(e){var t=e.alternate;t!==null&&(e.alternate=null,bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&uo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,Ft=!1;function Gi(e,t,i){for(i=i.child;i!==null;)yd(e,t,i),i=i.sibling}function yd(e,t,i){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(Yt,i)}catch{}switch(i.tag){case 26:_t||Ai(i,t),Gi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:_t||Ai(i,t);var r=it,l=Ft;gr(i.type)&&(it=i.stateNode,Ft=!1),Gi(e,t,i),vn(i.stateNode),it=r,Ft=l;break;case 5:_t||Ai(i,t);case 6:if(r=it,l=Ft,it=null,Gi(e,t,i),it=r,Ft=l,it!==null)if(Ft)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(i.stateNode)}catch(g){Ge(i,t,g)}else try{it.removeChild(i.stateNode)}catch(g){Ge(i,t,g)}break;case 18:it!==null&&(Ft?(e=it,_f(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Es(e)):_f(it,i.stateNode));break;case 4:r=it,l=Ft,it=i.stateNode.containerInfo,Ft=!0,Gi(e,t,i),it=r,Ft=l;break;case 0:case 11:case 14:case 15:cr(2,i,t),_t||cr(4,i,t),Gi(e,t,i);break;case 1:_t||(Ai(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&_d(i,t,r)),Gi(e,t,i);break;case 21:Gi(e,t,i);break;case 22:_t=(r=_t)||i.memoizedState!==null,Gi(e,t,i),_t=r;break;default:Gi(e,t,i)}}function Cd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Es(e)}catch(i){Ge(t,t.return,i)}}}function wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Es(e)}catch(i){Ge(t,t.return,i)}}function Dg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new md),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new md),t;default:throw Error(A(435,e.tag))}}function ba(e,t){var i=Dg(e);t.forEach(function(r){if(!i.has(r)){i.add(r);var l=Ig.bind(null,e,r);r.then(l,l)}})}function qt(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var l=i[r],g=e,L=t,N=L;e:for(;N!==null;){switch(N.tag){case 27:if(gr(N.type)){it=N.stateNode,Ft=!1;break e}break;case 5:it=N.stateNode,Ft=!1;break e;case 3:case 4:it=N.stateNode.containerInfo,Ft=!0;break e}N=N.return}if(it===null)throw Error(A(160));yd(g,L,l),it=null,Ft=!1,g=l.alternate,g!==null&&(g.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xd(t,e),t=t.sibling}var yi=null;function xd(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qt(t,e),Wt(e),r&4&&(cr(3,e,e.return),nn(3,e),cr(5,e,e.return));break;case 1:qt(t,e),Wt(e),r&512&&(_t||i===null||Ai(i,i.return)),r&64&&Wi&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var l=yi;if(qt(t,e),Wt(e),r&512&&(_t||i===null||Ai(i,i.return)),r&4){var g=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,l=l.ownerDocument||l;t:switch(r){case"title":g=l.getElementsByTagName("title")[0],(!g||g[Os]||g[At]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=l.createElement(r),l.head.insertBefore(g,l.querySelector("head > title"))),Mt(g,r,i),g[At]=e,Ct(g),r=g;break e;case"link":var L=Ef("link","href",l).get(r+(i.href||""));if(L){for(var N=0;N<L.length;N++)if(g=L[N],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){L.splice(N,1);break t}}g=l.createElement(r),Mt(g,r,i),l.head.appendChild(g);break;case"meta":if(L=Ef("meta","content",l).get(r+(i.content||""))){for(N=0;N<L.length;N++)if(g=L[N],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){L.splice(N,1);break t}}g=l.createElement(r),Mt(g,r,i),l.head.appendChild(g);break;default:throw Error(A(468,r))}g[At]=e,Ct(g),r=g}e.stateNode=r}else Rf(l,e.type,e.stateNode);else e.stateNode=xf(l,r,e.memoizedProps);else g!==r?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,r===null?Rf(l,e.type,e.stateNode):xf(l,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,i.memoizedProps)}break;case 27:qt(t,e),Wt(e),r&512&&(_t||i===null||Ai(i,i.return)),i!==null&&r&4&&Ol(e,e.memoizedProps,i.memoizedProps);break;case 5:if(qt(t,e),Wt(e),r&512&&(_t||i===null||Ai(i,i.return)),e.flags&32){l=e.stateNode;try{Xr(l,"")}catch(pe){Ge(e,e.return,pe)}}r&4&&e.stateNode!=null&&(l=e.memoizedProps,Ol(e,l,i!==null?i.memoizedProps:l)),r&1024&&(Hl=!0);break;case 6:if(qt(t,e),Wt(e),r&4){if(e.stateNode===null)throw Error(A(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(pe){Ge(e,e.return,pe)}}break;case 3:if(za=null,l=yi,yi=ka(t.containerInfo),qt(t,e),yi=l,Wt(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Es(t.containerInfo)}catch(pe){Ge(e,e.return,pe)}Hl&&(Hl=!1,Ed(e));break;case 4:r=yi,yi=ka(e.stateNode.containerInfo),qt(t,e),Wt(e),yi=r;break;case 12:qt(t,e),Wt(e);break;case 31:qt(t,e),Wt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ba(e,r)));break;case 13:qt(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ca=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ba(e,r)));break;case 22:l=e.memoizedState!==null;var Y=i!==null&&i.memoizedState!==null,se=Wi,le=_t;if(Wi=se||l,_t=le||Y,qt(t,e),_t=le,Wi=se,Wt(e),r&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(i===null||Y||Wi||_t||Nr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Y=i=t;try{if(g=Y.stateNode,l)L=g.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{N=Y.stateNode;var de=Y.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;N.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(pe){Ge(Y,Y.return,pe)}}}else if(t.tag===6){if(i===null){Y=t;try{Y.stateNode.nodeValue=l?"":Y.memoizedProps}catch(pe){Ge(Y,Y.return,pe)}}}else if(t.tag===18){if(i===null){Y=t;try{var oe=Y.stateNode;l?vf(oe,!0):vf(Y.stateNode,!1)}catch(pe){Ge(Y,Y.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,ba(e,i))));break;case 19:qt(t,e),Wt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ba(e,r)));break;case 30:break;case 21:break;default:qt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(gd(r)){i=r;break}r=r.return}if(i==null)throw Error(A(160));switch(i.tag){case 27:var l=i.stateNode,g=Bl(e);Sa(e,g,l);break;case 5:var L=i.stateNode;i.flags&32&&(Xr(L,""),i.flags&=-33);var N=Bl(e);Sa(e,N,L);break;case 3:case 4:var Y=i.stateNode.containerInfo,se=Bl(e);kl(e,se,Y);break;default:throw Error(A(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ed(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ed(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $i(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sd(e,t.alternate,t),t=t.sibling}function Nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:cr(4,t,t.return),Nr(t);break;case 1:Ai(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&_d(t,t.return,i),Nr(t);break;case 27:vn(t.stateNode);case 26:case 5:Ai(t,t.return),Nr(t);break;case 22:t.memoizedState===null&&Nr(t);break;case 30:Nr(t);break;default:Nr(t)}e=e.sibling}}function Vi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,l=e,g=t,L=g.flags;switch(g.tag){case 0:case 11:case 15:Vi(l,g,i),nn(4,g);break;case 1:if(Vi(l,g,i),r=g,l=r.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(se){Ge(r,r.return,se)}if(r=g,l=r.updateQueue,l!==null){var N=r.stateNode;try{var Y=l.shared.hiddenCallbacks;if(Y!==null)for(l.shared.hiddenCallbacks=null,l=0;l<Y.length;l++)ih(Y[l],N)}catch(se){Ge(r,r.return,se)}}i&&L&64&&fd(g),an(g,g.return);break;case 27:pd(g);case 26:case 5:Vi(l,g,i),i&&r===null&&L&4&&vd(g),an(g,g.return);break;case 12:Vi(l,g,i);break;case 31:Vi(l,g,i),i&&L&4&&Cd(l,g);break;case 13:Vi(l,g,i),i&&L&4&&wd(l,g);break;case 22:g.memoizedState===null&&Vi(l,g,i),an(g,g.return);break;case 30:break;default:Vi(l,g,i)}t=t.sibling}}function zl(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Gs(i))}function Il(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gs(e))}function Ci(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rd(e,t,i,r),t=t.sibling}function Rd(e,t,i,r){var l=t.flags;switch(t.tag){case 0:case 11:case 15:Ci(e,t,i,r),l&2048&&nn(9,t);break;case 1:Ci(e,t,i,r);break;case 3:Ci(e,t,i,r),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gs(e)));break;case 12:if(l&2048){Ci(e,t,i,r),e=t.stateNode;try{var g=t.memoizedProps,L=g.id,N=g.onPostCommit;typeof N=="function"&&N(L,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Y){Ge(t,t.return,Y)}}else Ci(e,t,i,r);break;case 31:Ci(e,t,i,r);break;case 13:Ci(e,t,i,r);break;case 23:break;case 22:g=t.stateNode,L=t.alternate,t.memoizedState!==null?g._visibility&2?Ci(e,t,i,r):on(e,t):g._visibility&2?Ci(e,t,i,r):(g._visibility|=2,_s(e,t,i,r,(t.subtreeFlags&10256)!==0||!1)),l&2048&&zl(L,t);break;case 24:Ci(e,t,i,r),l&2048&&Il(t.alternate,t);break;default:Ci(e,t,i,r)}}function _s(e,t,i,r,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var g=e,L=t,N=i,Y=r,se=L.flags;switch(L.tag){case 0:case 11:case 15:_s(g,L,N,Y,l),nn(8,L);break;case 23:break;case 22:var le=L.stateNode;L.memoizedState!==null?le._visibility&2?_s(g,L,N,Y,l):on(g,L):(le._visibility|=2,_s(g,L,N,Y,l)),l&&se&2048&&zl(L.alternate,L);break;case 24:_s(g,L,N,Y,l),l&&se&2048&&Il(L.alternate,L);break;default:_s(g,L,N,Y,l)}t=t.sibling}}function on(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,l=r.flags;switch(r.tag){case 22:on(i,r),l&2048&&zl(r.alternate,r);break;case 24:on(i,r),l&2048&&Il(r.alternate,r);break;default:on(i,r)}t=t.sibling}}var ln=8192;function vs(e,t,i){if(e.subtreeFlags&ln)for(e=e.child;e!==null;)Ad(e,t,i),e=e.sibling}function Ad(e,t,i){switch(e.tag){case 26:vs(e,t,i),e.flags&ln&&e.memoizedState!==null&&_0(i,yi,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,i);break;case 3:case 4:var r=yi;yi=ka(e.stateNode.containerInfo),vs(e,t,i),yi=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ln,ln=16777216,vs(e,t,i),ln=r):vs(e,t,i));break;default:vs(e,t,i)}}function Dd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function cn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];wt=r,Td(r,e)}Dd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ld(e),e=e.sibling}function Ld(e){switch(e.tag){case 0:case 11:case 15:cn(e),e.flags&2048&&cr(9,e,e.return);break;case 3:cn(e);break;case 12:cn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ya(e)):cn(e);break;default:cn(e)}}function ya(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];wt=r,Td(r,e)}Dd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:cr(8,t,t.return),ya(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ya(t));break;default:ya(t)}e=e.sibling}}function Td(e,t){for(;wt!==null;){var i=wt;switch(i.tag){case 0:case 11:case 15:cr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Gs(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,wt=r;else e:for(i=e;wt!==null;){r=wt;var l=r.sibling,g=r.return;if(bd(r),r===i){wt=null;break e}if(l!==null){l.return=g,wt=l;break e}wt=g}}}var Lg={getCacheForType:function(e){var t=Lt(ht),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Lt(ht).controller.signal}},Tg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Ye=null,Be=null,He=0,We=0,ti=null,ur=!1,gs=!1,Ul=!1,Xi=0,nt=0,hr=0,jr=0,Nl=0,ii=0,ps=0,un=null,Gt=null,jl=!1,Ca=0,Md=0,wa=1/0,xa=null,dr=null,mt=0,fr=null,ms=null,Yi=0,Pl=0,Fl=null,Od=null,hn=0,ql=null;function ri(){return(Fe&2)!==0&&He!==0?He&-He:W.T!==null?Yl():Si()}function Bd(){if(ii===0)if((He&536870912)===0||Ie){var e=Ti;Ti<<=1,(Ti&3932160)===0&&(Ti=262144),ii=e}else ii=536870912;return e=Jt.current,e!==null&&(e.flags|=32),ii}function $t(e,t,i){(e===Ye&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Ss(e,0),_r(e,He,ii,!1)),si(e,i),((Fe&2)===0||e!==Ye)&&(e===Ye&&((Fe&2)===0&&(jr|=i),nt===4&&_r(e,He,ii,!1)),Di(e))}function kd(e,t,i){if((Fe&6)!==0)throw Error(A(327));var r=!i&&(t&127)===0&&(t&e.expiredLanes)===0||It(e,t),l=r?Bg(e,t):Gl(e,t,!0),g=r;do{if(l===0){gs&&!r&&_r(e,t,0,!1);break}else{if(i=e.current.alternate,g&&!Mg(i)){l=Gl(e,t,!1),g=!1;continue}if(l===2){if(g=t,e.errorRecoveryDisabledLanes&g)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){t=L;e:{var N=e;l=un;var Y=N.current.memoizedState.isDehydrated;if(Y&&(Ss(N,L).flags|=256),L=Gl(N,L,!1),L!==2){if(Ul&&!Y){N.errorRecoveryDisabledLanes|=g,jr|=g,l=4;break e}g=Gt,Gt=l,g!==null&&(Gt===null?Gt=g:Gt.push.apply(Gt,g))}l=L}if(g=!1,l!==2)continue}}if(l===1){Ss(e,0),_r(e,t,0,!0);break}e:{switch(r=e,g=l,g){case 0:case 1:throw Error(A(345));case 4:if((t&4194048)!==t)break;case 6:_r(r,t,ii,!ur);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(A(329))}if((t&62914560)===t&&(l=Ca+300-we(),10<l)){if(_r(r,t,ii,!ur),yt(r,0,!0)!==0)break e;Yi=t,r.timeoutHandle=df(Hd.bind(null,r,i,Gt,xa,jl,t,ii,jr,ps,ur,g,"Throttled",-0,0),l);break e}Hd(r,i,Gt,xa,jl,t,ii,jr,ps,ur,g,null,-0,0)}}break}while(!0);Di(e)}function Hd(e,t,i,r,l,g,L,N,Y,se,le,de,ne,oe){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ki},Ad(t,g,de);var pe=(g&62914560)===g?Ca-we():(g&4194048)===g?Md-we():0;if(pe=v0(de,pe),pe!==null){Yi=g,e.cancelPendingCommit=pe(qd.bind(null,e,t,g,i,r,l,L,N,Y,le,de,null,ne,oe)),_r(e,g,L,!se);return}}qd(e,t,g,i,r,l,L,N,Y)}function Mg(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var l=i[r],g=l.getSnapshot;l=l.value;try{if(!Qt(g(),l))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _r(e,t,i,r){t&=~Nl,t&=~jr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var l=t;0<l;){var g=31-gt(l),L=1<<g;r[g]=-1,l&=~L}i!==0&&mi(e,i,t)}function Ea(){return(Fe&6)===0?(dn(0),!1):!0}function Wl(){if(Be!==null){if(We===0)var e=Be.return;else e=Be,Ui=Mr=null,al(e),cs=null,Vs=0,e=Be;for(;e!==null;)dd(e.alternate,e),e=e.return;Be=null}}function Ss(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Qg(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Yi=0,Wl(),Ye=e,Be=i=zi(e.current,null),He=t,We=0,ti=null,ur=!1,gs=It(e,t),Ul=!1,ps=ii=Nl=jr=hr=nt=0,Gt=un=null,jl=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var l=31-gt(r),g=1<<l;t|=e[l],r&=~g}return Xi=t,$n(),i}function zd(e,t){Le=null,W.H=tn,t===ls||t===ea?(t=Zu(),We=3):t===Xo?(t=Zu(),We=4):We=t===Cl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ti=t,Be===null&&(nt=1,_a(e,ui(t,e.current)))}function Id(){var e=Jt.current;return e===null?!0:(He&4194048)===He?_i===null:(He&62914560)===He||(He&536870912)!==0?e===_i:!1}function Ud(){var e=W.H;return W.H=tn,e===null?tn:e}function Nd(){var e=W.A;return W.A=Lg,e}function Ra(){nt=4,ur||(He&4194048)!==He&&Jt.current!==null||(gs=!0),(hr&134217727)===0&&(jr&134217727)===0||Ye===null||_r(Ye,He,ii,!1)}function Gl(e,t,i){var r=Fe;Fe|=2;var l=Ud(),g=Nd();(Ye!==e||He!==t)&&(xa=null,Ss(e,t)),t=!1;var L=nt;e:do try{if(We!==0&&Be!==null){var N=Be,Y=ti;switch(We){case 8:Wl(),L=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var se=We;if(We=0,ti=null,bs(e,N,Y,se),i&&gs){L=0;break e}break;default:se=We,We=0,ti=null,bs(e,N,Y,se)}}Og(),L=nt;break}catch(le){zd(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ui=Mr=null,Fe=r,W.H=l,W.A=g,Be===null&&(Ye=null,He=0,$n()),L}function Og(){for(;Be!==null;)jd(Be)}function Bg(e,t){var i=Fe;Fe|=2;var r=Ud(),l=Nd();Ye!==e||He!==t?(xa=null,wa=we()+500,Ss(e,t)):gs=It(e,t);e:do try{if(We!==0&&Be!==null){t=Be;var g=ti;t:switch(We){case 1:We=0,ti=null,bs(e,t,g,1);break;case 2:case 9:if(Ku(g)){We=0,ti=null,Pd(t);break}t=function(){We!==2&&We!==9||Ye!==e||(We=7),Di(e)},g.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Ku(g)?(We=0,ti=null,Pd(t)):(We=0,ti=null,bs(e,t,g,7));break;case 5:var L=null;switch(Be.tag){case 26:L=Be.memoizedState;case 5:case 27:var N=Be;if(L?Af(L):N.stateNode.complete){We=0,ti=null;var Y=N.sibling;if(Y!==null)Be=Y;else{var se=N.return;se!==null?(Be=se,Aa(se)):Be=null}break t}}We=0,ti=null,bs(e,t,g,5);break;case 6:We=0,ti=null,bs(e,t,g,6);break;case 8:Wl(),nt=6;break e;default:throw Error(A(462))}}kg();break}catch(le){zd(e,le)}while(!0);return Ui=Mr=null,W.H=r,W.A=l,Fe=i,Be!==null?0:(Ye=null,He=0,$n(),nt)}function kg(){for(;Be!==null&&!Ae();)jd(Be)}function jd(e){var t=ud(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,t===null?Aa(e):Be=t}function Pd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=sd(i,t,t.pendingProps,t.type,void 0,He);break;case 11:t=sd(i,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:al(t);default:dd(i,t),t=Be=Nu(t,Xi),t=ud(i,t,Xi)}e.memoizedProps=e.pendingProps,t===null?Aa(e):Be=t}function bs(e,t,i,r){Ui=Mr=null,al(t),cs=null,Vs=0;var l=t.return;try{if(Cg(e,l,t,i,He)){nt=1,_a(e,ui(i,e.current)),Be=null;return}}catch(g){if(l!==null)throw Be=l,g;nt=1,_a(e,ui(i,e.current)),Be=null;return}t.flags&32768?(Ie||r===1?e=!0:gs||(He&536870912)!==0?e=!1:(ur=e=!0,(r===2||r===9||r===3||r===6)&&(r=Jt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fd(t,e)):Aa(t)}function Aa(e){var t=e;do{if((t.flags&32768)!==0){Fd(t,ur);return}e=t.return;var i=Eg(t.alternate,t,Xi);if(i!==null){Be=i;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);nt===0&&(nt=5)}function Fd(e,t){do{var i=Rg(e.alternate,e);if(i!==null){i.flags&=32767,Be=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=i}while(e!==null);nt=6,Be=null}function qd(e,t,i,r,l,g,L,N,Y){e.cancelPendingCommit=null;do Da();while(mt!==0);if((Fe&6)!==0)throw Error(A(327));if(t!==null){if(t===e.current)throw Error(A(177));if(g=t.lanes|t.childLanes,g|=Bo,pt(e,i,g,L,N,Y),e===Ye&&(Be=Ye=null,He=0),ms=t,fr=e,Yi=i,Pl=g,Fl=l,Od=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ug(Qe,function(){return Xd(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=W.T,W.T=null,l=$.p,$.p=2,L=Fe,Fe|=4;try{Ag(e,t,i)}finally{Fe=L,$.p=l,W.T=r}}mt=1,Wd(),Gd(),$d()}}function Wd(){if(mt===1){mt=0;var e=fr,t=ms,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=W.T,W.T=null;var r=$.p;$.p=2;var l=Fe;Fe|=4;try{xd(t,e);var g=rc,L=Tu(e.containerInfo),N=g.focusedElem,Y=g.selectionRange;if(L!==N&&N&&N.ownerDocument&&Lu(N.ownerDocument.documentElement,N)){if(Y!==null&&Do(N)){var se=Y.start,le=Y.end;if(le===void 0&&(le=se),"selectionStart"in N)N.selectionStart=se,N.selectionEnd=Math.min(le,N.value.length);else{var de=N.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),pe=N.textContent.length,Ce=Math.min(Y.start,pe),Xe=Y.end===void 0?Ce:Math.min(Y.end,pe);!oe.extend&&Ce>Xe&&(L=Xe,Xe=Ce,Ce=L);var te=Du(N,Ce),Z=Du(N,Xe);if(te&&Z&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var re=de.createRange();re.setStart(te.node,te.offset),oe.removeAllRanges(),Ce>Xe?(oe.addRange(re),oe.extend(Z.node,Z.offset)):(re.setEnd(Z.node,Z.offset),oe.addRange(re))}}}}for(de=[],oe=N;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<de.length;N++){var ce=de[N];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}ja=!!ic,rc=ic=null}finally{Fe=l,$.p=r,W.T=i}}e.current=t,mt=2}}function Gd(){if(mt===2){mt=0;var e=fr,t=ms,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var r=$.p;$.p=2;var l=Fe;Fe|=4;try{Sd(e,t.alternate,t)}finally{Fe=l,$.p=r,W.T=i}}mt=3}}function $d(){if(mt===4||mt===3){mt=0,ve();var e=fr,t=ms,i=Yi,r=Od;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?mt=5:(mt=0,ms=fr=null,Vd(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(dr=null),Oi(i),t=t.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(Yt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=W.T,l=$.p,$.p=2,W.T=null;try{for(var g=e.onRecoverableError,L=0;L<r.length;L++){var N=r[L];g(N.value,{componentStack:N.stack})}}finally{W.T=t,$.p=l}}(Yi&3)!==0&&Da(),Di(e),l=e.pendingLanes,(i&261930)!==0&&(l&42)!==0?e===ql?hn++:(hn=0,ql=e):hn=0,dn(0)}}function Vd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gs(t)))}function Da(){return Wd(),Gd(),$d(),Xd()}function Xd(){if(mt!==5)return!1;var e=fr,t=Pl;Pl=0;var i=Oi(Yi),r=W.T,l=$.p;try{$.p=32>i?32:i,W.T=null,i=Fl,Fl=null;var g=fr,L=Yi;if(mt=0,ms=fr=null,Yi=0,(Fe&6)!==0)throw Error(A(331));var N=Fe;if(Fe|=4,Ld(g.current),Rd(g,g.current,L,i),Fe=N,dn(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(Yt,g)}catch{}return!0}finally{$.p=l,W.T=r,Vd(e,t)}}function Yd(e,t,i){t=ui(i,t),t=yl(e.stateNode,t,2),e=ar(e,t,2),e!==null&&(si(e,2),Di(e))}function Ge(e,t,i){if(e.tag===3)Yd(e,e,i);else for(;t!==null;){if(t.tag===3){Yd(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(dr===null||!dr.has(r))){e=ui(i,e),i=Kh(2),r=ar(t,i,2),r!==null&&(Qh(i,r,t,e),si(r,2),Di(r));break}}t=t.return}}function $l(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new Tg;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(i)||(Ul=!0,l.add(i),e=Hg.bind(null,e,t,i),t.then(e,e))}function Hg(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ye===e&&(He&i)===i&&(nt===4||nt===3&&(He&62914560)===He&&300>we()-Ca?(Fe&2)===0&&Ss(e,0):Nl|=i,ps===He&&(ps=0)),Di(e)}function Kd(e,t){t===0&&(t=Bt()),e=Dr(e,t),e!==null&&(si(e,t),Di(e))}function zg(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Kd(e,i)}function Ig(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(i=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(A(314))}r!==null&&r.delete(t),Kd(e,i)}function Ug(e,t){return xe(e,t)}var La=null,ys=null,Vl=!1,Ta=!1,Xl=!1,vr=0;function Di(e){e!==ys&&e.next===null&&(ys===null?La=ys=e:ys=ys.next=e),Ta=!0,Vl||(Vl=!0,jg())}function dn(e,t){if(!Xl&&Ta){Xl=!0;do for(var i=!1,r=La;r!==null;){if(e!==0){var l=r.pendingLanes;if(l===0)var g=0;else{var L=r.suspendedLanes,N=r.pingedLanes;g=(1<<31-gt(42|e)+1)-1,g&=l&~(L&~N),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,ef(r,g))}else g=He,g=yt(r,r===Ye?g:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(g&3)===0||It(r,g)||(i=!0,ef(r,g));r=r.next}while(i);Xl=!1}}function Ng(){Qd()}function Qd(){Ta=Vl=!1;var e=0;vr!==0&&Kg()&&(e=vr);for(var t=we(),i=null,r=La;r!==null;){var l=r.next,g=Zd(r,t);g===0?(r.next=null,i===null?La=l:i.next=l,l===null&&(ys=i)):(i=r,(e!==0||(g&3)!==0)&&(Ta=!0)),r=l}mt!==0&&mt!==5||dn(e),vr!==0&&(vr=0)}function Zd(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var L=31-gt(g),N=1<<L,Y=l[L];Y===-1?((N&i)===0||(N&r)!==0)&&(l[L]=Ut(N,t)):Y<=t&&(e.expiredLanes|=N),g&=~N}if(t=Ye,i=He,i=yt(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||It(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),Oi(i)){case 2:case 8:i=vt;break;case 32:i=Qe;break;case 268435456:i=Ze;break;default:i=Qe}return r=Jd.bind(null,e),i=xe(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function Jd(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Da()&&e.callbackNode!==i)return null;var r=He;return r=yt(e,e===Ye?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(kd(e,r,t),Zd(e,we()),e.callbackNode!=null&&e.callbackNode===i?Jd.bind(null,e):null)}function ef(e,t){if(Da())return null;kd(e,t,!0)}function jg(){Zg(function(){(Fe&6)!==0?xe(qe,Ng):Qd()})}function Yl(){if(vr===0){var e=as;e===0&&(e=xi,xi<<=1,(xi&261888)===0&&(xi=256)),vr=e}return vr}function tf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Un(""+e)}function rf(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Pg(e,t,i,r,l){if(t==="submit"&&i&&i.stateNode===l){var g=tf((l[jt]||null).action),L=r.submitter;L&&(t=(t=L[jt]||null)?tf(t.formAction):L.getAttribute("formAction"),t!==null&&(g=t,L=null));var N=new Fn("action","action",null,r,l);e.push({event:N,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vr!==0){var Y=L?rf(l,L):new FormData(l);vl(i,{pending:!0,data:Y,method:l.method,action:g},null,Y)}}else typeof g=="function"&&(N.preventDefault(),Y=L?rf(l,L):new FormData(l),vl(i,{pending:!0,data:Y,method:l.method,action:g},g,Y))},currentTarget:l}]})}}for(var Kl=0;Kl<Oo.length;Kl++){var Ql=Oo[Kl],Fg=Ql.toLowerCase(),qg=Ql[0].toUpperCase()+Ql.slice(1);bi(Fg,"on"+qg)}bi(Bu,"onAnimationEnd"),bi(ku,"onAnimationIteration"),bi(Hu,"onAnimationStart"),bi("dblclick","onDoubleClick"),bi("focusin","onFocus"),bi("focusout","onBlur"),bi(ng,"onTransitionRun"),bi(ag,"onTransitionStart"),bi(og,"onTransitionCancel"),bi(zu,"onTransitionEnd"),$r("onMouseEnter",["mouseout","mouseover"]),$r("onMouseLeave",["mouseout","mouseover"]),$r("onPointerEnter",["pointerout","pointerover"]),$r("onPointerLeave",["pointerout","pointerover"]),xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xr("onBeforeInput",["compositionend","keypress","textInput","paste"]),xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fn="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(" "),Wg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fn));function sf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],l=r.event;r=r.listeners;e:{var g=void 0;if(t)for(var L=r.length-1;0<=L;L--){var N=r[L],Y=N.instance,se=N.currentTarget;if(N=N.listener,Y!==g&&l.isPropagationStopped())break e;g=N,l.currentTarget=se;try{g(l)}catch(le){Gn(le)}l.currentTarget=null,g=Y}else for(L=0;L<r.length;L++){if(N=r[L],Y=N.instance,se=N.currentTarget,N=N.listener,Y!==g&&l.isPropagationStopped())break e;g=N,l.currentTarget=se;try{g(l)}catch(le){Gn(le)}l.currentTarget=null,g=Y}}}}function ke(e,t){var i=t[co];i===void 0&&(i=t[co]=new Set);var r=e+"__bubble";i.has(r)||(nf(t,e,2,!1),i.add(r))}function Zl(e,t,i){var r=0;t&&(r|=4),nf(i,e,r,t)}var Ma="_reactListening"+Math.random().toString(36).slice(2);function Jl(e){if(!e[Ma]){e[Ma]=!0,Qc.forEach(function(i){i!=="selectionchange"&&(Wg.has(i)||Zl(i,!1,e),Zl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ma]||(t[Ma]=!0,Zl("selectionchange",!1,t))}}function nf(e,t,i,r){switch(kf(t)){case 2:var l=m0;break;case 8:l=S0;break;default:l=_c}i=l.bind(null,t,i,e),l=void 0,!So||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,i,{capture:!0,passive:l}):e.addEventListener(t,i,!0):l!==void 0?e.addEventListener(t,i,{passive:l}):e.addEventListener(t,i,!1)}function ec(e,t,i,r,l){var g=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var L=r.tag;if(L===3||L===4){var N=r.stateNode.containerInfo;if(N===l)break;if(L===4)for(L=r.return;L!==null;){var Y=L.tag;if((Y===3||Y===4)&&L.stateNode.containerInfo===l)return;L=L.return}for(;N!==null;){if(L=qr(N),L===null)return;if(Y=L.tag,Y===5||Y===6||Y===26||Y===27){r=g=L;continue e}N=N.parentNode}}r=r.return}cu(function(){var se=g,le=po(i),de=[];e:{var ne=Iu.get(e);if(ne!==void 0){var oe=Fn,pe=e;switch(e){case"keypress":if(jn(i)===0)break e;case"keydown":case"keyup":oe=Iv;break;case"focusin":pe="focus",oe=wo;break;case"focusout":pe="blur",oe=wo;break;case"beforeblur":case"afterblur":oe=wo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=du;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Ev;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=jv;break;case Bu:case ku:case Hu:oe=Dv;break;case zu:oe=Fv;break;case"scroll":case"scrollend":oe=wv;break;case"wheel":oe=Wv;break;case"copy":case"cut":case"paste":oe=Tv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=_u;break;case"toggle":case"beforetoggle":oe=$v}var Ce=(t&4)!==0,Xe=!Ce&&(e==="scroll"||e==="scrollend"),te=Ce?ne!==null?ne+"Capture":null:ne;Ce=[];for(var Z=se,re;Z!==null;){var ce=Z;if(re=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||re===null||te===null||(ce=ks(Z,te),ce!=null&&Ce.push(_n(Z,ce,re))),Xe)break;Z=Z.return}0<Ce.length&&(ne=new oe(ne,pe,null,i,le),de.push({event:ne,listeners:Ce}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",ne&&i!==go&&(pe=i.relatedTarget||i.fromElement)&&(qr(pe)||pe[Fr]))break e;if((oe||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(pe=i.relatedTarget||i.toElement,oe=se,pe=pe?qr(pe):null,pe!==null&&(Xe=P(pe),Ce=pe.tag,pe!==Xe||Ce!==5&&Ce!==27&&Ce!==6)&&(pe=null)):(oe=null,pe=se),oe!==pe)){if(Ce=du,ce="onMouseLeave",te="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=_u,ce="onPointerLeave",te="onPointerEnter",Z="pointer"),Xe=oe==null?ne:Bs(oe),re=pe==null?ne:Bs(pe),ne=new Ce(ce,Z+"leave",oe,i,le),ne.target=Xe,ne.relatedTarget=re,ce=null,qr(le)===se&&(Ce=new Ce(te,Z+"enter",pe,i,le),Ce.target=re,Ce.relatedTarget=Xe,ce=Ce),Xe=ce,oe&&pe)t:{for(Ce=Gg,te=oe,Z=pe,re=0,ce=te;ce;ce=Ce(ce))re++;ce=0;for(var be=Z;be;be=Ce(be))ce++;for(;0<re-ce;)te=Ce(te),re--;for(;0<ce-re;)Z=Ce(Z),ce--;for(;re--;){if(te===Z||Z!==null&&te===Z.alternate){Ce=te;break t}te=Ce(te),Z=Ce(Z)}Ce=null}else Ce=null;oe!==null&&af(de,ne,oe,Ce,!1),pe!==null&&Xe!==null&&af(de,Xe,pe,Ce,!0)}}e:{if(ne=se?Bs(se):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var Ne=Cu;else if(bu(ne))if(wu)Ne=ig;else{Ne=eg;var me=Jv}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?se&&vo(se.elementType)&&(Ne=Cu):Ne=tg;if(Ne&&(Ne=Ne(e,se))){yu(de,Ne,i,le);break e}me&&me(e,ne,se),e==="focusout"&&se&&ne.type==="number"&&se.memoizedProps.value!=null&&_o(ne,"number",ne.value)}switch(me=se?Bs(se):window,e){case"focusin":(bu(me)||me.contentEditable==="true")&&(Zr=me,Lo=se,Fs=null);break;case"focusout":Fs=Lo=Zr=null;break;case"mousedown":To=!0;break;case"contextmenu":case"mouseup":case"dragend":To=!1,Mu(de,i,le);break;case"selectionchange":if(sg)break;case"keydown":case"keyup":Mu(de,i,le)}var Me;if(Eo)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Qr?mu(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(vu&&i.locale!=="ko"&&(Qr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Qr&&(Me=uu()):(Ji=le,bo="value"in Ji?Ji.value:Ji.textContent,Qr=!0)),me=Oa(se,ze),0<me.length&&(ze=new fu(ze,e,null,i,le),de.push({event:ze,listeners:me}),Me?ze.data=Me:(Me=Su(i),Me!==null&&(ze.data=Me)))),(Me=Xv?Yv(e,i):Kv(e,i))&&(ze=Oa(se,"onBeforeInput"),0<ze.length&&(me=new fu("onBeforeInput","beforeinput",null,i,le),de.push({event:me,listeners:ze}),me.data=Me)),Pg(de,e,se,i,le)}sf(de,t)})}function _n(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Oa(e,t){for(var i=t+"Capture",r=[];e!==null;){var l=e,g=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||g===null||(l=ks(e,i),l!=null&&r.unshift(_n(e,l,g)),l=ks(e,t),l!=null&&r.push(_n(e,l,g))),e.tag===3)return r;e=e.return}return[]}function Gg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function af(e,t,i,r,l){for(var g=t._reactName,L=[];i!==null&&i!==r;){var N=i,Y=N.alternate,se=N.stateNode;if(N=N.tag,Y!==null&&Y===r)break;N!==5&&N!==26&&N!==27||se===null||(Y=se,l?(se=ks(i,g),se!=null&&L.unshift(_n(i,se,Y))):l||(se=ks(i,g),se!=null&&L.push(_n(i,se,Y)))),i=i.return}L.length!==0&&e.push({event:t,listeners:L})}var $g=/\r\n?/g,Vg=/\u0000|\uFFFD/g;function of(e){return(typeof e=="string"?e:""+e).replace($g,`
|
|
49
|
+
`).replace(Vg,"")}function lf(e,t){return t=of(t),of(e)===t}function Ve(e,t,i,r,l,g){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xr(e,""+r);break;case"className":zn(e,"class",r);break;case"tabIndex":zn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":zn(e,i,r);break;case"style":ou(e,r,g);break;case"data":if(t!=="object"){zn(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Un(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(i==="formAction"?(t!=="input"&&Ve(e,t,"name",l.name,l,null),Ve(e,t,"formEncType",l.formEncType,l,null),Ve(e,t,"formMethod",l.formMethod,l,null),Ve(e,t,"formTarget",l.formTarget,l,null)):(Ve(e,t,"encType",l.encType,l,null),Ve(e,t,"method",l.method,l,null),Ve(e,t,"target",l.target,l,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Un(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=ki);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(l.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=Un(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":ke("beforetoggle",e),ke("toggle",e),Hn(e,"popover",r);break;case"xlinkActuate":Bi(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Bi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Bi(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Bi(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Bi(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Bi(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Hn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=yv.get(i)||i,Hn(e,i,r))}}function tc(e,t,i,r,l,g){switch(i){case"style":ou(e,r,g);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(l.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&Xr(e,""+r);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(l=i.endsWith("Capture"),t=i.slice(2,l?i.length-7:void 0),g=e[jt]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(t,g,l),typeof r=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,l);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):Hn(e,i,r)}}}function Mt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var r=!1,l=!1,g;for(g in i)if(i.hasOwnProperty(g)){var L=i[g];if(L!=null)switch(g){case"src":r=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ve(e,t,g,L,i,null)}}l&&Ve(e,t,"srcSet",i.srcSet,i,null),r&&Ve(e,t,"src",i.src,i,null);return;case"input":ke("invalid",e);var N=g=L=l=null,Y=null,se=null;for(r in i)if(i.hasOwnProperty(r)){var le=i[r];if(le!=null)switch(r){case"name":l=le;break;case"type":L=le;break;case"checked":Y=le;break;case"defaultChecked":se=le;break;case"value":g=le;break;case"defaultValue":N=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(A(137,t));break;default:Ve(e,t,r,le,i,null)}}ru(e,g,N,Y,se,L,l,!1);return;case"select":ke("invalid",e),r=L=g=null;for(l in i)if(i.hasOwnProperty(l)&&(N=i[l],N!=null))switch(l){case"value":g=N;break;case"defaultValue":L=N;break;case"multiple":r=N;default:Ve(e,t,l,N,i,null)}t=g,i=L,e.multiple=!!r,t!=null?Vr(e,!!r,t,!1):i!=null&&Vr(e,!!r,i,!0);return;case"textarea":ke("invalid",e),g=l=r=null;for(L in i)if(i.hasOwnProperty(L)&&(N=i[L],N!=null))switch(L){case"value":r=N;break;case"defaultValue":l=N;break;case"children":g=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(A(91));break;default:Ve(e,t,L,N,i,null)}nu(e,r,l,g);return;case"option":for(Y in i)if(i.hasOwnProperty(Y)&&(r=i[Y],r!=null))switch(Y){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ve(e,t,Y,r,i,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(r=0;r<fn.length;r++)ke(fn[r],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in i)if(i.hasOwnProperty(se)&&(r=i[se],r!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ve(e,t,se,r,i,null)}return;default:if(vo(t)){for(le in i)i.hasOwnProperty(le)&&(r=i[le],r!==void 0&&tc(e,t,le,r,i,void 0));return}}for(N in i)i.hasOwnProperty(N)&&(r=i[N],r!=null&&Ve(e,t,N,r,i,null))}function Xg(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,g=null,L=null,N=null,Y=null,se=null,le=null;for(oe in i){var de=i[oe];if(i.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Y=de;default:r.hasOwnProperty(oe)||Ve(e,t,oe,null,r,de)}}for(var ne in r){var oe=r[ne];if(de=i[ne],r.hasOwnProperty(ne)&&(oe!=null||de!=null))switch(ne){case"type":g=oe;break;case"name":l=oe;break;case"checked":se=oe;break;case"defaultChecked":le=oe;break;case"value":L=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(A(137,t));break;default:oe!==de&&Ve(e,t,ne,oe,r,de)}}fo(e,L,N,Y,se,le,g,l);return;case"select":oe=L=N=ne=null;for(g in i)if(Y=i[g],i.hasOwnProperty(g)&&Y!=null)switch(g){case"value":break;case"multiple":oe=Y;default:r.hasOwnProperty(g)||Ve(e,t,g,null,r,Y)}for(l in r)if(g=r[l],Y=i[l],r.hasOwnProperty(l)&&(g!=null||Y!=null))switch(l){case"value":ne=g;break;case"defaultValue":N=g;break;case"multiple":L=g;default:g!==Y&&Ve(e,t,l,g,r,Y)}t=N,i=L,r=oe,ne!=null?Vr(e,!!i,ne,!1):!!r!=!!i&&(t!=null?Vr(e,!!i,t,!0):Vr(e,!!i,i?[]:"",!1));return;case"textarea":oe=ne=null;for(N in i)if(l=i[N],i.hasOwnProperty(N)&&l!=null&&!r.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ve(e,t,N,null,r,l)}for(L in r)if(l=r[L],g=i[L],r.hasOwnProperty(L)&&(l!=null||g!=null))switch(L){case"value":ne=l;break;case"defaultValue":oe=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(A(91));break;default:l!==g&&Ve(e,t,L,l,r,g)}su(e,ne,oe);return;case"option":for(var pe in i)if(ne=i[pe],i.hasOwnProperty(pe)&&ne!=null&&!r.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Ve(e,t,pe,null,r,ne)}for(Y in r)if(ne=r[Y],oe=i[Y],r.hasOwnProperty(Y)&&ne!==oe&&(ne!=null||oe!=null))switch(Y){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Ve(e,t,Y,ne,r,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in i)ne=i[Ce],i.hasOwnProperty(Ce)&&ne!=null&&!r.hasOwnProperty(Ce)&&Ve(e,t,Ce,null,r,ne);for(se in r)if(ne=r[se],oe=i[se],r.hasOwnProperty(se)&&ne!==oe&&(ne!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(A(137,t));break;default:Ve(e,t,se,ne,r,oe)}return;default:if(vo(t)){for(var Xe in i)ne=i[Xe],i.hasOwnProperty(Xe)&&ne!==void 0&&!r.hasOwnProperty(Xe)&&tc(e,t,Xe,void 0,r,ne);for(le in r)ne=r[le],oe=i[le],!r.hasOwnProperty(le)||ne===oe||ne===void 0&&oe===void 0||tc(e,t,le,ne,r,oe);return}}for(var te in i)ne=i[te],i.hasOwnProperty(te)&&ne!=null&&!r.hasOwnProperty(te)&&Ve(e,t,te,null,r,ne);for(de in r)ne=r[de],oe=i[de],!r.hasOwnProperty(de)||ne===oe||ne==null&&oe==null||Ve(e,t,de,ne,r,oe)}function cf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Yg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var l=i[r],g=l.transferSize,L=l.initiatorType,N=l.duration;if(g&&N&&cf(L)){for(L=0,N=l.responseEnd,r+=1;r<i.length;r++){var Y=i[r],se=Y.startTime;if(se>N)break;var le=Y.transferSize,de=Y.initiatorType;le&&cf(de)&&(Y=Y.responseEnd,L+=le*(Y<N?1:(N-se)/(Y-se)))}if(--r,t+=8*(g+L)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ic=null,rc=null;function Ba(e){return e.nodeType===9?e:e.ownerDocument}function uf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function sc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nc=null;function Kg(){var e=window.event;return e&&e.type==="popstate"?e===nc?!1:(nc=e,!0):(nc=null,!1)}var df=typeof setTimeout=="function"?setTimeout:void 0,Qg=typeof clearTimeout=="function"?clearTimeout:void 0,ff=typeof Promise=="function"?Promise:void 0,Zg=typeof queueMicrotask=="function"?queueMicrotask:typeof ff<"u"?function(e){return ff.resolve(null).then(e).catch(Jg)}:df;function Jg(e){setTimeout(function(){throw e})}function gr(e){return e==="head"}function _f(e,t){var i=t,r=0;do{var l=i.nextSibling;if(e.removeChild(i),l&&l.nodeType===8)if(i=l.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(l),Es(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")vn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,vn(i);for(var g=i.firstChild;g;){var L=g.nextSibling,N=g.nodeName;g[Os]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&g.rel.toLowerCase()==="stylesheet"||i.removeChild(g),g=L}}else i==="body"&&vn(e.ownerDocument.body);i=l}while(i);Es(t)}function vf(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function ac(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":ac(i),uo(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function e0(e,t,i,r){for(;e.nodeType===1;){var l=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Os])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=vi(e.nextSibling),e===null)break}return null}function t0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=vi(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vi(e.nextSibling),e===null))return null;return e}function oc(e){return e.data==="$?"||e.data==="$~"}function lc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function vi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var cc=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return vi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Sf(e,t,i){switch(t=Ba(i),e){case"html":if(e=t.documentElement,!e)throw Error(A(452));return e;case"head":if(e=t.head,!e)throw Error(A(453));return e;case"body":if(e=t.body,!e)throw Error(A(454));return e;default:throw Error(A(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);uo(e)}var gi=new Map,bf=new Set;function ka(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ki=$.d;$.d={f:r0,r:s0,D:n0,C:a0,L:o0,m:l0,X:u0,S:c0,M:h0};function r0(){var e=Ki.f(),t=Ea();return e||t}function s0(e){var t=Wr(e);t!==null&&t.tag===5&&t.type==="form"?zh(t):Ki.r(e)}var Cs=typeof document>"u"?null:document;function yf(e,t,i){var r=Cs;if(r&&typeof t=="string"&&t){var l=li(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof i=="string"&&(l+='[crossorigin="'+i+'"]'),bf.has(l)||(bf.add(l),e={rel:e,crossOrigin:i,href:t},r.querySelector(l)===null&&(t=r.createElement("link"),Mt(t,"link",e),Ct(t),r.head.appendChild(t)))}}function n0(e){Ki.D(e),yf("dns-prefetch",e,null)}function a0(e,t){Ki.C(e,t),yf("preconnect",e,t)}function o0(e,t,i){Ki.L(e,t,i);var r=Cs;if(r&&e&&t){var l='link[rel="preload"][as="'+li(t)+'"]';t==="image"&&i&&i.imageSrcSet?(l+='[imagesrcset="'+li(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(l+='[imagesizes="'+li(i.imageSizes)+'"]')):l+='[href="'+li(e)+'"]';var g=l;switch(t){case"style":g=ws(e);break;case"script":g=xs(e)}gi.has(g)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),gi.set(g,e),r.querySelector(l)!==null||t==="style"&&r.querySelector(gn(g))||t==="script"&&r.querySelector(pn(g))||(t=r.createElement("link"),Mt(t,"link",e),Ct(t),r.head.appendChild(t)))}}function l0(e,t){Ki.m(e,t);var i=Cs;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+li(r)+'"][href="'+li(e)+'"]',g=l;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xs(e)}if(!gi.has(g)&&(e=a({rel:"modulepreload",href:e},t),gi.set(g,e),i.querySelector(l)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(pn(g)))return}r=i.createElement("link"),Mt(r,"link",e),Ct(r),i.head.appendChild(r)}}}function c0(e,t,i){Ki.S(e,t,i);var r=Cs;if(r&&e){var l=Gr(r).hoistableStyles,g=ws(e);t=t||"default";var L=l.get(g);if(!L){var N={loading:0,preload:null};if(L=r.querySelector(gn(g)))N.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=gi.get(g))&&uc(e,i);var Y=L=r.createElement("link");Ct(Y),Mt(Y,"link",e),Y._p=new Promise(function(se,le){Y.onload=se,Y.onerror=le}),Y.addEventListener("load",function(){N.loading|=1}),Y.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ha(L,t,r)}L={type:"stylesheet",instance:L,count:1,state:N},l.set(g,L)}}}function u0(e,t){Ki.X(e,t);var i=Cs;if(i&&e){var r=Gr(i).hoistableScripts,l=xs(e),g=r.get(l);g||(g=i.querySelector(pn(l)),g||(e=a({src:e,async:!0},t),(t=gi.get(l))&&hc(e,t),g=i.createElement("script"),Ct(g),Mt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},r.set(l,g))}}function h0(e,t){Ki.M(e,t);var i=Cs;if(i&&e){var r=Gr(i).hoistableScripts,l=xs(e),g=r.get(l);g||(g=i.querySelector(pn(l)),g||(e=a({src:e,async:!0,type:"module"},t),(t=gi.get(l))&&hc(e,t),g=i.createElement("script"),Ct(g),Mt(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},r.set(l,g))}}function Cf(e,t,i,r){var l=(l=he.current)?ka(l):null;if(!l)throw Error(A(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ws(i.href),i=Gr(l).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ws(i.href);var g=Gr(l).hoistableStyles,L=g.get(e);if(L||(l=l.ownerDocument||l,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,L),(g=l.querySelector(gn(e)))&&!g._p&&(L.instance=g,L.state.loading=5),gi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},gi.set(e,i),g||d0(l,e,i,L.state))),t&&r===null)throw Error(A(528,""));return L}if(t&&r!==null)throw Error(A(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xs(i),i=Gr(l).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(A(444,e))}}function ws(e){return'href="'+li(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function wf(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function d0(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Mt(t,"link",i),Ct(t),e.head.appendChild(t))}function xs(e){return'[src="'+li(e)+'"]'}function pn(e){return"script[async]"+e}function xf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+li(i.href)+'"]');if(r)return t.instance=r,Ct(r),r;var l=a({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Ct(r),Mt(r,"style",l),Ha(r,i.precedence,e),t.instance=r;case"stylesheet":l=ws(i.href);var g=e.querySelector(gn(l));if(g)return t.state.loading|=4,t.instance=g,Ct(g),g;r=wf(i),(l=gi.get(l))&&uc(r,l),g=(e.ownerDocument||e).createElement("link"),Ct(g);var L=g;return L._p=new Promise(function(N,Y){L.onload=N,L.onerror=Y}),Mt(g,"link",r),t.state.loading|=4,Ha(g,i.precedence,e),t.instance=g;case"script":return g=xs(i.src),(l=e.querySelector(pn(g)))?(t.instance=l,Ct(l),l):(r=i,(l=gi.get(g))&&(r=a({},i),hc(r,l)),e=e.ownerDocument||e,l=e.createElement("script"),Ct(l),Mt(l,"link",r),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(A(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ha(r,i.precedence,e));return t.instance}function Ha(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=r.length?r[r.length-1]:null,g=l,L=0;L<r.length;L++){var N=r[L];if(N.dataset.precedence===t)g=N;else if(g!==l)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var za=null;function Ef(e,t,i){if(za===null){var r=new Map,l=za=new Map;l.set(i,r)}else l=za,r=l.get(i),r||(r=new Map,l.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),l=0;l<i.length;l++){var g=i[l];if(!(g[Os]||g[At]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var L=g.getAttribute(t)||"";L=e+L;var N=r.get(L);N?N.push(g):r.set(L,[g])}}return r}function Rf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function f0(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Af(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _0(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var l=ws(r.href),g=t.querySelector(gn(l));if(g){t=g._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ia.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=g,Ct(g);return}g=t.ownerDocument||t,r=wf(r),(l=gi.get(l))&&uc(r,l),g=g.createElement("link"),Ct(g);var L=g;L._p=new Promise(function(N,Y){L.onload=N,L.onerror=Y}),Mt(g,"link",r),i.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ia.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var dc=0;function v0(e,t){return e.stylesheets&&e.count===0&&Na(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&Na(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+t);0<e.imgBytes&&dc===0&&(dc=62500*Yg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Na(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>dc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(l)}}:null}function Ia(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Na(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ua=null;function Na(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ua=new Map,t.forEach(g0,e),Ua=null,Ia.call(e))}function g0(e,t){if(!(t.state.loading&4)){var i=Ua.get(e);if(i)var r=i.get(null);else{i=new Map,Ua.set(e,i);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<l.length;g++){var L=l[g];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(i.set(L.dataset.precedence,L),r=L)}r&&i.set(null,r)}l=t.instance,L=l.getAttribute("data-precedence"),g=i.get(L)||r,g===r&&i.set(null,l),i.set(L,l),this.count++,r=Ia.bind(this),l.addEventListener("load",r),l.addEventListener("error",r),g?g.parentNode.insertBefore(l,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var mn={$$typeof:h,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function p0(e,t,i,r,l,g,L,N,Y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.hiddenUpdates=Nt(null),this.identifierPrefix=r,this.onUncaughtError=l,this.onCaughtError=g,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function Df(e,t,i,r,l,g,L,N,Y,se,le,de){return e=new p0(e,t,i,L,Y,se,le,de,N),t=1,g===!0&&(t|=24),g=Zt(3,null,null,t),e.current=g,g.stateNode=e,t=Go(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:r,isDehydrated:i,cache:t},Yo(g),e}function Lf(e){return e?(e=ts,e):ts}function Tf(e,t,i,r,l,g){l=Lf(l),r.context===null?r.context=l:r.pendingContext=l,r=nr(t),r.payload={element:i},g=g===void 0?null:g,g!==null&&(r.callback=g),i=ar(e,r,t),i!==null&&($t(i,e,t),Ys(i,e,t))}function Mf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function fc(e,t){Mf(e,t),(e=e.alternate)&&Mf(e,t)}function Of(e){if(e.tag===13||e.tag===31){var t=Dr(e,67108864);t!==null&&$t(t,e,67108864),fc(e,67108864)}}function Bf(e){if(e.tag===13||e.tag===31){var t=ri();t=Mi(t);var i=Dr(e,t);i!==null&&$t(i,e,t),fc(e,t)}}var ja=!0;function m0(e,t,i,r){var l=W.T;W.T=null;var g=$.p;try{$.p=2,_c(e,t,i,r)}finally{$.p=g,W.T=l}}function S0(e,t,i,r){var l=W.T;W.T=null;var g=$.p;try{$.p=8,_c(e,t,i,r)}finally{$.p=g,W.T=l}}function _c(e,t,i,r){if(ja){var l=vc(r);if(l===null)ec(e,t,r,Pa,i),Hf(e,r);else if(y0(l,e,t,i,r))r.stopPropagation();else if(Hf(e,r),t&4&&-1<b0.indexOf(e)){for(;l!==null;){var g=Wr(l);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var L=rt(g.pendingLanes);if(L!==0){var N=g;for(N.pendingLanes|=2,N.entangledLanes|=2;L;){var Y=1<<31-gt(L);N.entanglements[1]|=Y,L&=~Y}Di(g),(Fe&6)===0&&(wa=we()+500,dn(0))}}break;case 31:case 13:N=Dr(g,2),N!==null&&$t(N,g,2),Ea(),fc(g,2)}if(g=vc(r),g===null&&ec(e,t,r,Pa,i),g===l)break;l=g}l!==null&&r.stopPropagation()}else ec(e,t,r,null,i)}}function vc(e){return e=po(e),gc(e)}var Pa=null;function gc(e){if(Pa=null,e=qr(e),e!==null){var t=P(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=H(t),e!==null)return e;e=null}else if(i===31){if(e=s(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pa=e,null}function kf(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ke()){case qe:return 2;case vt:return 8;case Qe:case ct:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var pc=!1,pr=null,mr=null,Sr=null,Sn=new Map,bn=new Map,br=[],b0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hf(e,t){switch(e){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":mr=null;break;case"mouseover":case"mouseout":Sr=null;break;case"pointerover":case"pointerout":Sn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bn.delete(t.pointerId)}}function yn(e,t,i,r,l,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:g,targetContainers:[l]},t!==null&&(t=Wr(t),t!==null&&Of(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function y0(e,t,i,r,l){switch(t){case"focusin":return pr=yn(pr,e,t,i,r,l),!0;case"dragenter":return mr=yn(mr,e,t,i,r,l),!0;case"mouseover":return Sr=yn(Sr,e,t,i,r,l),!0;case"pointerover":var g=l.pointerId;return Sn.set(g,yn(Sn.get(g)||null,e,t,i,r,l)),!0;case"gotpointercapture":return g=l.pointerId,bn.set(g,yn(bn.get(g)||null,e,t,i,r,l)),!0}return!1}function zf(e){var t=qr(e.target);if(t!==null){var i=P(t);if(i!==null){if(t=i.tag,t===13){if(t=H(i),t!==null){e.blockedOn=t,Zi(e.priority,function(){Bf(i)});return}}else if(t===31){if(t=s(i),t!==null){e.blockedOn=t,Zi(e.priority,function(){Bf(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=vc(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);go=r,i.target.dispatchEvent(r),go=null}else return t=Wr(i),t!==null&&Of(t),e.blockedOn=i,!1;t.shift()}return!0}function If(e,t,i){Fa(e)&&i.delete(t)}function C0(){pc=!1,pr!==null&&Fa(pr)&&(pr=null),mr!==null&&Fa(mr)&&(mr=null),Sr!==null&&Fa(Sr)&&(Sr=null),Sn.forEach(If),bn.forEach(If)}function qa(e,t){e.blockedOn===t&&(e.blockedOn=null,pc||(pc=!0,_.unstable_scheduleCallback(_.unstable_NormalPriority,C0)))}var Wa=null;function Uf(e){Wa!==e&&(Wa=e,_.unstable_scheduleCallback(_.unstable_NormalPriority,function(){Wa===e&&(Wa=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],l=e[t+2];if(typeof r!="function"){if(gc(r||i)===null)continue;break}var g=Wr(i);g!==null&&(e.splice(t,3),t-=3,vl(g,{pending:!0,data:l,method:i.method,action:r},r,l))}}))}function Es(e){function t(Y){return qa(Y,e)}pr!==null&&qa(pr,e),mr!==null&&qa(mr,e),Sr!==null&&qa(Sr,e),Sn.forEach(t),bn.forEach(t);for(var i=0;i<br.length;i++){var r=br[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<br.length&&(i=br[0],i.blockedOn===null);)zf(i),i.blockedOn===null&&br.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var l=i[r],g=i[r+1],L=l[jt]||null;if(typeof g=="function")L||Uf(i);else if(L){var N=null;if(g&&g.hasAttribute("formAction")){if(l=g,L=g[jt]||null)N=L.formAction;else if(gc(l)!==null)continue}else N=L.action;typeof N=="function"?i[r+1]=N:(i.splice(r,3),r-=3),Uf(i)}}}function Nf(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(L){return l=L})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),r||setTimeout(i,20)}function i(){if(!r&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function mc(e){this._internalRoot=e}Ga.prototype.render=mc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));var i=t.current,r=ri();Tf(i,r,e,t,null,null)},Ga.prototype.unmount=mc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Tf(e.current,2,null,e,null,null),Ea(),t[Fr]=null}};function Ga(e){this._internalRoot=e}Ga.prototype.unstable_scheduleHydration=function(e){if(e){var t=Si();e={blockedOn:null,target:e,priority:t};for(var i=0;i<br.length&&t!==0&&t<br[i].priority;i++);br.splice(i,0,e),i===0&&zf(e)}};var jf=C.version;if(jf!=="19.2.4")throw Error(A(527,jf,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=d(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var w0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$a.isDisabled&&$a.supportsFiber)try{Yt=$a.inject(w0),ut=$a}catch{}}return wn.createRoot=function(e,t){if(!z(e))throw Error(A(299));var i=!1,r="",l=$h,g=Vh,L=Xh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(L=t.onRecoverableError)),t=Df(e,1,!1,null,null,i,r,null,l,g,L,Nf),e[Fr]=t.current,Jl(e),new mc(t)},wn.hydrateRoot=function(e,t,i){if(!z(e))throw Error(A(299));var r=!1,l="",g=$h,L=Vh,N=Xh,Y=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(L=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.formState!==void 0&&(Y=i.formState)),t=Df(e,1,!0,t,i??null,r,l,Y,g,L,N,Nf),t.context=Lf(null),i=t.current,r=ri(),r=Mi(r),l=nr(r),l.callback=null,ar(i,l,r),i=r,t.current.lanes=i,si(t,i),Di(t),e[Fr]=t.current,Jl(e),new Ga(t)},wn.version="19.2.4",wn}var Kf;function B0(){if(Kf)return yc.exports;Kf=1;function _(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(C){console.error(C)}}return _(),yc.exports=O0(),yc.exports}var k0=B0();const Qf=_=>{let C;const D=new Set,A=(d,v)=>{const a=typeof d=="function"?d(C):d;if(!Object.is(a,C)){const p=C;C=v??(typeof a!="object"||a===null)?a:Object.assign({},C,a),D.forEach(S=>S(C,p))}},z=()=>C,s={setState:A,getState:z,getInitialState:()=>u,subscribe:d=>(D.add(d),()=>D.delete(d))},u=C=_(A,z,s);return s},H0=(_=>_?Qf(_):Qf),z0=_=>_;function I0(_,C=z0){const D=Et.useSyncExternalStore(_.subscribe,Et.useCallback(()=>C(_.getState()),[_,C]),Et.useCallback(()=>C(_.getInitialState()),[_,C]));return Et.useDebugValue(D),D}const Zf=_=>{const C=H0(_),D=A=>I0(C,A);return Object.assign(D,C),D},A_=(_=>_?Zf(_):Zf),lt=A_(_=>({isAuthenticated:!1,isCheckingAuth:!0,setAuthenticated:C=>_({isAuthenticated:C,isCheckingAuth:!1}),setCheckingAuth:C=>_({isCheckingAuth:C}),connectionStatus:"disconnected",instanceConnectionStatus:{},setConnectionStatus:C=>_({connectionStatus:C}),setInstanceConnectionStatus:(C,D)=>_(A=>({instanceConnectionStatus:{...A.instanceConnectionStatus,[C]:D}})),removeInstanceConnectionStatus:C=>_(D=>{const{[C]:A,...z}=D.instanceConnectionStatus;return{instanceConnectionStatus:z}}),sessionStatus:"idle",setSessionStatus:C=>_({sessionStatus:C}),cachedToken:null,setCachedToken:C=>_({cachedToken:C}),ipChangeInfo:null,setIpChangeInfo:C=>_({ipChangeInfo:C}),toastMessage:null,showToast:C=>_({toastMessage:C}),hideToast:()=>_({toastMessage:null})})),so="/api";async function wr(_){const C=await fetch(`${so}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:_})});if(C.status===429)throw new Error("Too many attempts. Try again later.");return C.ok}async function U0(){const _=await fetch(`${so}/status`,{credentials:"include"});if(_.status===401)throw new Error("Unauthorized");return _.json()}async function D_(){const _=await fetch(`${so}/config`,{credentials:"include"});if(_.status===401)throw new Error("Unauthorized");if(!_.ok)throw new Error(`Config fetch failed: ${_.status}`);return _.json()}async function N0(_){const C=await fetch(`${so}/config`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_)});if(C.status===401)throw new Error("Unauthorized");return C.ok}const Pc="claude_remote_token";function j0(_){sessionStorage.setItem(Pc,_)}function As(){return sessionStorage.getItem(Pc)}function L_(){sessionStorage.removeItem(Pc)}function P0(){const[_,C]=G.useState(null),[D,A]=G.useState(!1),z=lt(u=>u.setAuthenticated),P=lt(u=>u.setCachedToken),H=G.useCallback(async u=>{C(null),A(!0);try{await wr(u)?(z(!0),P(u),j0(u)):C("Invalid token")}catch(d){C(d instanceof Error?d.message:"Authentication failed")}finally{A(!1)}},[z,P]),s=G.useCallback(()=>{z(!1),P(null),L_()},[z,P]);return{login:H,logout:s,error:_,loading:D}}function F0(){const[_,C]=G.useState(""),{login:D,error:A,loading:z}=P0();G.useEffect(()=>{const H=sessionStorage.getItem("prefill_token");H&&(C(H),sessionStorage.removeItem("prefill_token"))},[]);const P=H=>{H.preventDefault(),_.trim()&&D(_.trim())};return ee.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--bg-primary)"},children:ee.jsxs("form",{onSubmit:P,style:{width:"100%",maxWidth:400,display:"flex",flexDirection:"column",gap:16},children:[ee.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[ee.jsx("h1",{style:{fontSize:24,fontWeight:700,marginBottom:8},children:"Claude Code Remote"}),ee.jsx("p",{style:{fontSize:14,color:"var(--text-secondary)"},children:"Enter the token shown on your PC terminal"})]}),ee.jsx("input",{type:"password",value:_,onChange:H=>C(H.target.value),placeholder:"Paste token here…","aria-label":"Authentication token",autoComplete:"off",style:{height:48,padding:"0 16px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16}}),A&&ee.jsx("div",{style:{color:"var(--status-error)",fontSize:14,textAlign:"center"},children:A}),ee.jsx("button",{type:"submit",disabled:z||!_.trim(),style:{height:48,borderRadius:8,background:_.trim()?"var(--status-running)":"var(--bg-tertiary)",color:_.trim()?"#fff":"var(--text-muted)",fontWeight:600,fontSize:16,transition:"background 0.15s",opacity:z?.7:1},children:z?"Authenticating…":"Connect"})]})})}const Vt=A_(_=>({instances:[],activeInstanceId:null,currentHostOverride:null,setInstances:C=>_({instances:C}),setActiveInstanceId:C=>_({activeInstanceId:C}),setCurrentHostOverride:C=>_({currentHostOverride:C})})),q0=[{label:"Esc",data:"\x1B",enabled:!0},{label:"Enter",data:"\r",enabled:!0},{label:"Tab",data:" ",enabled:!0},{label:"↑",data:"\x1B[A",enabled:!0},{label:"↓",data:"\x1B[B",enabled:!0},{label:"←",data:"\x1B[D",enabled:!0},{label:"→",data:"\x1B[C",enabled:!0},{label:"S-Tab",data:"\x1B[Z",enabled:!0,desc:"Shift+Tab, 向前切换"}],W0=[{label:"/clear",command:"/clear",enabled:!0},{label:"/compact",command:"/compact",enabled:!0},{label:"/resume",command:"/resume",enabled:!0},{label:"/stats",command:"/stats",enabled:!0},{label:"/exit",command:"/exit",enabled:!0},{label:"/commit-commands:commit",command:"/commit-commands:commit",enabled:!0},{label:"/feature-dev:feature-dev",command:"/feature-dev:feature-dev",enabled:!0},{label:"/auto-doc",command:"/auto-doc",enabled:!0},{label:"/code-review-expert",command:"/code-review-expert",enabled:!0},{label:"/systematic-debugging",command:"/systematic-debugging",enabled:!0}],T_=q0.map(({enabled:_,desc:C,...D})=>D),M_=W0.map(({enabled:_,desc:C,...D})=>D);function Jf(_){return _.filter(C=>C.enabled).map(({enabled:C,desc:D,...A})=>A)}let O_=0;const Bc=new Set;function G0(_){return Bc.add(_),()=>Bc.delete(_)}function $0(){return O_}function B_(){O_++,Bc.forEach(_=>_())}function V0(){const[_,C]=G.useState(null),[D,A]=G.useState(null),[z,P]=G.useState(!0),H=G.useSyncExternalStore(G0,$0),s=G.useCallback(async()=>{P(!0);try{const a=await D_();C(a.config),A(a.configPath)}catch{C(null)}finally{P(!1)}},[]);G.useEffect(()=>{s()},[s,H]);const u=_!=null&&_.shortcuts?Jf(_.shortcuts):T_,d=_!=null&&_.commands?Jf(_.commands):M_,v=G.useCallback(()=>{B_()},[]);return{shortcuts:u,commands:d,configPath:D,isLoading:z,reload:v}}var xn=R_();function X0(){for(var _=arguments.length,C=new Array(_),D=0;D<_;D++)C[D]=arguments[D];return G.useMemo(()=>A=>{C.forEach(z=>z(A))},C)}const no=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ds(_){const C=Object.prototype.toString.call(_);return C==="[object Window]"||C==="[object global]"}function Fc(_){return"nodeType"in _}function Xt(_){var C,D;return _?Ds(_)?_:Fc(_)&&(C=(D=_.ownerDocument)==null?void 0:D.defaultView)!=null?C:window:window}function qc(_){const{Document:C}=Xt(_);return _ instanceof C}function On(_){return Ds(_)?!1:_ instanceof Xt(_).HTMLElement}function k_(_){return _ instanceof Xt(_).SVGElement}function Ls(_){return _?Ds(_)?_.document:Fc(_)?qc(_)?_:On(_)||k_(_)?_.ownerDocument:document:document:document}const Li=no?G.useLayoutEffect:G.useEffect;function Wc(_){const C=G.useRef(_);return Li(()=>{C.current=_}),G.useCallback(function(){for(var D=arguments.length,A=new Array(D),z=0;z<D;z++)A[z]=arguments[z];return C.current==null?void 0:C.current(...A)},[])}function Y0(){const _=G.useRef(null),C=G.useCallback((A,z)=>{_.current=setInterval(A,z)},[]),D=G.useCallback(()=>{_.current!==null&&(clearInterval(_.current),_.current=null)},[]);return[C,D]}function Dn(_,C){C===void 0&&(C=[_]);const D=G.useRef(_);return Li(()=>{D.current!==_&&(D.current=_)},C),D}function Bn(_,C){const D=G.useRef();return G.useMemo(()=>{const A=_(D.current);return D.current=A,A},[...C])}function Ja(_){const C=Wc(_),D=G.useRef(null),A=G.useCallback(z=>{z!==D.current&&(C==null||C(z,D.current)),D.current=z},[]);return[D,A]}function kc(_){const C=G.useRef();return G.useEffect(()=>{C.current=_},[_]),C.current}let Ec={};function kn(_,C){return G.useMemo(()=>{if(C)return C;const D=Ec[_]==null?0:Ec[_]+1;return Ec[_]=D,_+"-"+D},[_,C])}function H_(_){return function(C){for(var D=arguments.length,A=new Array(D>1?D-1:0),z=1;z<D;z++)A[z-1]=arguments[z];return A.reduce((P,H)=>{const s=Object.entries(H);for(const[u,d]of s){const v=P[u];v!=null&&(P[u]=v+_*d)}return P},{...C})}}const Rs=H_(1),Ln=H_(-1);function K0(_){return"clientX"in _&&"clientY"in _}function Gc(_){if(!_)return!1;const{KeyboardEvent:C}=Xt(_.target);return C&&_ instanceof C}function Q0(_){if(!_)return!1;const{TouchEvent:C}=Xt(_.target);return C&&_ instanceof C}function Hc(_){if(Q0(_)){if(_.touches&&_.touches.length){const{clientX:C,clientY:D}=_.touches[0];return{x:C,y:D}}else if(_.changedTouches&&_.changedTouches.length){const{clientX:C,clientY:D}=_.changedTouches[0];return{x:C,y:D}}}return K0(_)?{x:_.clientX,y:_.clientY}:null}const Tn=Object.freeze({Translate:{toString(_){if(!_)return;const{x:C,y:D}=_;return"translate3d("+(C?Math.round(C):0)+"px, "+(D?Math.round(D):0)+"px, 0)"}},Scale:{toString(_){if(!_)return;const{scaleX:C,scaleY:D}=_;return"scaleX("+C+") scaleY("+D+")"}},Transform:{toString(_){if(_)return[Tn.Translate.toString(_),Tn.Scale.toString(_)].join(" ")}},Transition:{toString(_){let{property:C,duration:D,easing:A}=_;return C+" "+D+"ms "+A}}}),e_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Z0(_){return _.matches(e_)?_:_.querySelector(e_)}const J0={display:"none"};function ep(_){let{id:C,value:D}=_;return Et.createElement("div",{id:C,style:J0},D)}function tp(_){let{id:C,announcement:D,ariaLiveType:A="assertive"}=_;const z={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Et.createElement("div",{id:C,style:z,role:"status","aria-live":A,"aria-atomic":!0},D)}function ip(){const[_,C]=G.useState("");return{announce:G.useCallback(A=>{A!=null&&C(A)},[]),announcement:_}}const z_=G.createContext(null);function rp(_){const C=G.useContext(z_);G.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(_)},[_,C])}function sp(){const[_]=G.useState(()=>new Set),C=G.useCallback(A=>(_.add(A),()=>_.delete(A)),[_]);return[G.useCallback(A=>{let{type:z,event:P}=A;_.forEach(H=>{var s;return(s=H[z])==null?void 0:s.call(H,P)})},[_]),C]}const np={draggable:`
|
|
50
|
+
To pick up a draggable item, press the space bar.
|
|
51
|
+
While dragging, use the arrow keys to move the item.
|
|
52
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
53
|
+
`},ap={onDragStart(_){let{active:C}=_;return"Picked up draggable item "+C.id+"."},onDragOver(_){let{active:C,over:D}=_;return D?"Draggable item "+C.id+" was moved over droppable area "+D.id+".":"Draggable item "+C.id+" is no longer over a droppable area."},onDragEnd(_){let{active:C,over:D}=_;return D?"Draggable item "+C.id+" was dropped over droppable area "+D.id:"Draggable item "+C.id+" was dropped."},onDragCancel(_){let{active:C}=_;return"Dragging was cancelled. Draggable item "+C.id+" was dropped."}};function op(_){let{announcements:C=ap,container:D,hiddenTextDescribedById:A,screenReaderInstructions:z=np}=_;const{announce:P,announcement:H}=ip(),s=kn("DndLiveRegion"),[u,d]=G.useState(!1);if(G.useEffect(()=>{d(!0)},[]),rp(G.useMemo(()=>({onDragStart(a){let{active:p}=a;P(C.onDragStart({active:p}))},onDragMove(a){let{active:p,over:S}=a;C.onDragMove&&P(C.onDragMove({active:p,over:S}))},onDragOver(a){let{active:p,over:S}=a;P(C.onDragOver({active:p,over:S}))},onDragEnd(a){let{active:p,over:S}=a;P(C.onDragEnd({active:p,over:S}))},onDragCancel(a){let{active:p,over:S}=a;P(C.onDragCancel({active:p,over:S}))}}),[P,C])),!u)return null;const v=Et.createElement(Et.Fragment,null,Et.createElement(ep,{id:A,value:z.draggable}),Et.createElement(tp,{id:s,announcement:H}));return D?xn.createPortal(v,D):v}var bt;(function(_){_.DragStart="dragStart",_.DragMove="dragMove",_.DragEnd="dragEnd",_.DragCancel="dragCancel",_.DragOver="dragOver",_.RegisterDroppable="registerDroppable",_.SetDroppableDisabled="setDroppableDisabled",_.UnregisterDroppable="unregisterDroppable"})(bt||(bt={}));function eo(){}function t_(_,C){return G.useMemo(()=>({sensor:_,options:C??{}}),[_,C])}function lp(){for(var _=arguments.length,C=new Array(_),D=0;D<_;D++)C[D]=arguments[D];return G.useMemo(()=>[...C].filter(A=>A!=null),[...C])}const wi=Object.freeze({x:0,y:0});function I_(_,C){return Math.sqrt(Math.pow(_.x-C.x,2)+Math.pow(_.y-C.y,2))}function U_(_,C){let{data:{value:D}}=_,{data:{value:A}}=C;return D-A}function cp(_,C){let{data:{value:D}}=_,{data:{value:A}}=C;return A-D}function i_(_){let{left:C,top:D,height:A,width:z}=_;return[{x:C,y:D},{x:C+z,y:D},{x:C,y:D+A},{x:C+z,y:D+A}]}function N_(_,C){if(!_||_.length===0)return null;const[D]=_;return D[C]}function r_(_,C,D){return C===void 0&&(C=_.left),D===void 0&&(D=_.top),{x:C+_.width*.5,y:D+_.height*.5}}const j_=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const z=r_(C,C.left,C.top),P=[];for(const H of A){const{id:s}=H,u=D.get(s);if(u){const d=I_(r_(u),z);P.push({id:s,data:{droppableContainer:H,value:d}})}}return P.sort(U_)},up=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const z=i_(C),P=[];for(const H of A){const{id:s}=H,u=D.get(s);if(u){const d=i_(u),v=z.reduce((p,S,w)=>p+I_(d[w],S),0),a=Number((v/4).toFixed(4));P.push({id:s,data:{droppableContainer:H,value:a}})}}return P.sort(U_)};function hp(_,C){const D=Math.max(C.top,_.top),A=Math.max(C.left,_.left),z=Math.min(C.left+C.width,_.left+_.width),P=Math.min(C.top+C.height,_.top+_.height),H=z-A,s=P-D;if(A<z&&D<P){const u=C.width*C.height,d=_.width*_.height,v=H*s,a=v/(u+d-v);return Number(a.toFixed(4))}return 0}const dp=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const z=[];for(const P of A){const{id:H}=P,s=D.get(H);if(s){const u=hp(s,C);u>0&&z.push({id:H,data:{droppableContainer:P,value:u}})}}return z.sort(cp)};function fp(_,C,D){return{..._,scaleX:C&&D?C.width/D.width:1,scaleY:C&&D?C.height/D.height:1}}function P_(_,C){return _&&C?{x:_.left-C.left,y:_.top-C.top}:wi}function _p(_){return function(D){for(var A=arguments.length,z=new Array(A>1?A-1:0),P=1;P<A;P++)z[P-1]=arguments[P];return z.reduce((H,s)=>({...H,top:H.top+_*s.y,bottom:H.bottom+_*s.y,left:H.left+_*s.x,right:H.right+_*s.x}),{...D})}}const vp=_p(1);function gp(_){if(_.startsWith("matrix3d(")){const C=_.slice(9,-1).split(/, /);return{x:+C[12],y:+C[13],scaleX:+C[0],scaleY:+C[5]}}else if(_.startsWith("matrix(")){const C=_.slice(7,-1).split(/, /);return{x:+C[4],y:+C[5],scaleX:+C[0],scaleY:+C[3]}}return null}function pp(_,C,D){const A=gp(C);if(!A)return _;const{scaleX:z,scaleY:P,x:H,y:s}=A,u=_.left-H-(1-z)*parseFloat(D),d=_.top-s-(1-P)*parseFloat(D.slice(D.indexOf(" ")+1)),v=z?_.width/z:_.width,a=P?_.height/P:_.height;return{width:v,height:a,top:d,right:u+v,bottom:d+a,left:u}}const mp={ignoreTransform:!1};function Ts(_,C){C===void 0&&(C=mp);let D=_.getBoundingClientRect();if(C.ignoreTransform){const{transform:d,transformOrigin:v}=Xt(_).getComputedStyle(_);d&&(D=pp(D,d,v))}const{top:A,left:z,width:P,height:H,bottom:s,right:u}=D;return{top:A,left:z,width:P,height:H,bottom:s,right:u}}function s_(_){return Ts(_,{ignoreTransform:!0})}function Sp(_){const C=_.innerWidth,D=_.innerHeight;return{top:0,left:0,right:C,bottom:D,width:C,height:D}}function bp(_,C){return C===void 0&&(C=Xt(_).getComputedStyle(_)),C.position==="fixed"}function yp(_,C){C===void 0&&(C=Xt(_).getComputedStyle(_));const D=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(z=>{const P=C[z];return typeof P=="string"?D.test(P):!1})}function ao(_,C){const D=[];function A(z){if(C!=null&&D.length>=C||!z)return D;if(qc(z)&&z.scrollingElement!=null&&!D.includes(z.scrollingElement))return D.push(z.scrollingElement),D;if(!On(z)||k_(z)||D.includes(z))return D;const P=Xt(_).getComputedStyle(z);return z!==_&&yp(z,P)&&D.push(z),bp(z,P)?D:A(z.parentNode)}return _?A(_):D}function F_(_){const[C]=ao(_,1);return C??null}function Rc(_){return!no||!_?null:Ds(_)?_:Fc(_)?qc(_)||_===Ls(_).scrollingElement?window:On(_)?_:null:null}function q_(_){return Ds(_)?_.scrollX:_.scrollLeft}function W_(_){return Ds(_)?_.scrollY:_.scrollTop}function zc(_){return{x:q_(_),y:W_(_)}}var xt;(function(_){_[_.Forward=1]="Forward",_[_.Backward=-1]="Backward"})(xt||(xt={}));function G_(_){return!no||!_?!1:_===document.scrollingElement}function $_(_){const C={x:0,y:0},D=G_(_)?{height:window.innerHeight,width:window.innerWidth}:{height:_.clientHeight,width:_.clientWidth},A={x:_.scrollWidth-D.width,y:_.scrollHeight-D.height},z=_.scrollTop<=C.y,P=_.scrollLeft<=C.x,H=_.scrollTop>=A.y,s=_.scrollLeft>=A.x;return{isTop:z,isLeft:P,isBottom:H,isRight:s,maxScroll:A,minScroll:C}}const Cp={x:.2,y:.2};function wp(_,C,D,A,z){let{top:P,left:H,right:s,bottom:u}=D;A===void 0&&(A=10),z===void 0&&(z=Cp);const{isTop:d,isBottom:v,isLeft:a,isRight:p}=$_(_),S={x:0,y:0},w={x:0,y:0},f={height:C.height*z.y,width:C.width*z.x};return!d&&P<=C.top+f.height?(S.y=xt.Backward,w.y=A*Math.abs((C.top+f.height-P)/f.height)):!v&&u>=C.bottom-f.height&&(S.y=xt.Forward,w.y=A*Math.abs((C.bottom-f.height-u)/f.height)),!p&&s>=C.right-f.width?(S.x=xt.Forward,w.x=A*Math.abs((C.right-f.width-s)/f.width)):!a&&H<=C.left+f.width&&(S.x=xt.Backward,w.x=A*Math.abs((C.left+f.width-H)/f.width)),{direction:S,speed:w}}function xp(_){if(_===document.scrollingElement){const{innerWidth:P,innerHeight:H}=window;return{top:0,left:0,right:P,bottom:H,width:P,height:H}}const{top:C,left:D,right:A,bottom:z}=_.getBoundingClientRect();return{top:C,left:D,right:A,bottom:z,width:_.clientWidth,height:_.clientHeight}}function V_(_){return _.reduce((C,D)=>Rs(C,zc(D)),wi)}function Ep(_){return _.reduce((C,D)=>C+q_(D),0)}function Rp(_){return _.reduce((C,D)=>C+W_(D),0)}function Ap(_,C){if(C===void 0&&(C=Ts),!_)return;const{top:D,left:A,bottom:z,right:P}=C(_);F_(_)&&(z<=0||P<=0||D>=window.innerHeight||A>=window.innerWidth)&&_.scrollIntoView({block:"center",inline:"center"})}const Dp=[["x",["left","right"],Ep],["y",["top","bottom"],Rp]];class $c{constructor(C,D){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const A=ao(D),z=V_(A);this.rect={...C},this.width=C.width,this.height=C.height;for(const[P,H,s]of Dp)for(const u of H)Object.defineProperty(this,u,{get:()=>{const d=s(A),v=z[P]-d;return this.rect[u]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class En{constructor(C){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(D=>{var A;return(A=this.target)==null?void 0:A.removeEventListener(...D)})},this.target=C}add(C,D,A){var z;(z=this.target)==null||z.addEventListener(C,D,A),this.listeners.push([C,D,A])}}function Lp(_){const{EventTarget:C}=Xt(_);return _ instanceof C?_:Ls(_)}function Ac(_,C){const D=Math.abs(_.x),A=Math.abs(_.y);return typeof C=="number"?Math.sqrt(D**2+A**2)>C:"x"in C&&"y"in C?D>C.x&&A>C.y:"x"in C?D>C.x:"y"in C?A>C.y:!1}var pi;(function(_){_.Click="click",_.DragStart="dragstart",_.Keydown="keydown",_.ContextMenu="contextmenu",_.Resize="resize",_.SelectionChange="selectionchange",_.VisibilityChange="visibilitychange"})(pi||(pi={}));function n_(_){_.preventDefault()}function Tp(_){_.stopPropagation()}var Ue;(function(_){_.Space="Space",_.Down="ArrowDown",_.Right="ArrowRight",_.Left="ArrowLeft",_.Up="ArrowUp",_.Esc="Escape",_.Enter="Enter",_.Tab="Tab"})(Ue||(Ue={}));const X_={start:[Ue.Space,Ue.Enter],cancel:[Ue.Esc],end:[Ue.Space,Ue.Enter,Ue.Tab]},Mp=(_,C)=>{let{currentCoordinates:D}=C;switch(_.code){case Ue.Right:return{...D,x:D.x+25};case Ue.Left:return{...D,x:D.x-25};case Ue.Down:return{...D,y:D.y+25};case Ue.Up:return{...D,y:D.y-25}}};class Vc{constructor(C){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=C;const{event:{target:D}}=C;this.props=C,this.listeners=new En(Ls(D)),this.windowListeners=new En(Xt(D)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pi.Resize,this.handleCancel),this.windowListeners.add(pi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:C,onStart:D}=this.props,A=C.node.current;A&&Ap(A),D(wi)}handleKeyDown(C){if(Gc(C)){const{active:D,context:A,options:z}=this.props,{keyboardCodes:P=X_,coordinateGetter:H=Mp,scrollBehavior:s="smooth"}=z,{code:u}=C;if(P.end.includes(u)){this.handleEnd(C);return}if(P.cancel.includes(u)){this.handleCancel(C);return}const{collisionRect:d}=A.current,v=d?{x:d.left,y:d.top}:wi;this.referenceCoordinates||(this.referenceCoordinates=v);const a=H(C,{active:D,context:A.current,currentCoordinates:v});if(a){const p=Ln(a,v),S={x:0,y:0},{scrollableAncestors:w}=A.current;for(const f of w){const n=C.code,{isTop:c,isRight:o,isLeft:h,isBottom:m,maxScroll:x,minScroll:y}=$_(f),E=xp(f),b={x:Math.min(n===Ue.Right?E.right-E.width/2:E.right,Math.max(n===Ue.Right?E.left:E.left+E.width/2,a.x)),y:Math.min(n===Ue.Down?E.bottom-E.height/2:E.bottom,Math.max(n===Ue.Down?E.top:E.top+E.height/2,a.y))},R=n===Ue.Right&&!o||n===Ue.Left&&!h,T=n===Ue.Down&&!m||n===Ue.Up&&!c;if(R&&b.x!==a.x){const I=f.scrollLeft+p.x,M=n===Ue.Right&&I<=x.x||n===Ue.Left&&I>=y.x;if(M&&!p.y){f.scrollTo({left:I,behavior:s});return}M?S.x=f.scrollLeft-I:S.x=n===Ue.Right?f.scrollLeft-x.x:f.scrollLeft-y.x,S.x&&f.scrollBy({left:-S.x,behavior:s});break}else if(T&&b.y!==a.y){const I=f.scrollTop+p.y,M=n===Ue.Down&&I<=x.y||n===Ue.Up&&I>=y.y;if(M&&!p.x){f.scrollTo({top:I,behavior:s});return}M?S.y=f.scrollTop-I:S.y=n===Ue.Down?f.scrollTop-x.y:f.scrollTop-y.y,S.y&&f.scrollBy({top:-S.y,behavior:s});break}}this.handleMove(C,Rs(Ln(a,this.referenceCoordinates),S))}}}handleMove(C,D){const{onMove:A}=this.props;C.preventDefault(),A(D)}handleEnd(C){const{onEnd:D}=this.props;C.preventDefault(),this.detach(),D()}handleCancel(C){const{onCancel:D}=this.props;C.preventDefault(),this.detach(),D()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Vc.activators=[{eventName:"onKeyDown",handler:(_,C,D)=>{let{keyboardCodes:A=X_,onActivation:z}=C,{active:P}=D;const{code:H}=_.nativeEvent;if(A.start.includes(H)){const s=P.activatorNode.current;return s&&_.target!==s?!1:(_.preventDefault(),z==null||z({event:_.nativeEvent}),!0)}return!1}}];function a_(_){return!!(_&&"distance"in _)}function o_(_){return!!(_&&"delay"in _)}class Xc{constructor(C,D,A){var z;A===void 0&&(A=Lp(C.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=C,this.events=D;const{event:P}=C,{target:H}=P;this.props=C,this.events=D,this.document=Ls(H),this.documentListeners=new En(this.document),this.listeners=new En(A),this.windowListeners=new En(Xt(H)),this.initialCoordinates=(z=Hc(P))!=null?z:wi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:C,props:{options:{activationConstraint:D,bypassActivationConstraint:A}}}=this;if(this.listeners.add(C.move.name,this.handleMove,{passive:!1}),this.listeners.add(C.end.name,this.handleEnd),C.cancel&&this.listeners.add(C.cancel.name,this.handleCancel),this.windowListeners.add(pi.Resize,this.handleCancel),this.windowListeners.add(pi.DragStart,n_),this.windowListeners.add(pi.VisibilityChange,this.handleCancel),this.windowListeners.add(pi.ContextMenu,n_),this.documentListeners.add(pi.Keydown,this.handleKeydown),D){if(A!=null&&A({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(o_(D)){this.timeoutId=setTimeout(this.handleStart,D.delay),this.handlePending(D);return}if(a_(D)){this.handlePending(D);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(C,D){const{active:A,onPending:z}=this.props;z(A,C,this.initialCoordinates,D)}handleStart(){const{initialCoordinates:C}=this,{onStart:D}=this.props;C&&(this.activated=!0,this.documentListeners.add(pi.Click,Tp,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pi.SelectionChange,this.removeTextSelection),D(C))}handleMove(C){var D;const{activated:A,initialCoordinates:z,props:P}=this,{onMove:H,options:{activationConstraint:s}}=P;if(!z)return;const u=(D=Hc(C))!=null?D:wi,d=Ln(z,u);if(!A&&s){if(a_(s)){if(s.tolerance!=null&&Ac(d,s.tolerance))return this.handleCancel();if(Ac(d,s.distance))return this.handleStart()}if(o_(s)&&Ac(d,s.tolerance))return this.handleCancel();this.handlePending(s,d);return}C.cancelable&&C.preventDefault(),H(u)}handleEnd(){const{onAbort:C,onEnd:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleCancel(){const{onAbort:C,onCancel:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleKeydown(C){C.code===Ue.Esc&&this.handleCancel()}removeTextSelection(){var C;(C=this.document.getSelection())==null||C.removeAllRanges()}}const Op={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yc extends Xc{constructor(C){const{event:D}=C,A=Ls(D.target);super(C,Op,A)}}Yc.activators=[{eventName:"onPointerDown",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;return!D.isPrimary||D.button!==0?!1:(A==null||A({event:D}),!0)}}];const Bp={move:{name:"mousemove"},end:{name:"mouseup"}};var Ic;(function(_){_[_.RightClick=2]="RightClick"})(Ic||(Ic={}));class kp extends Xc{constructor(C){super(C,Bp,Ls(C.event.target))}}kp.activators=[{eventName:"onMouseDown",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;return D.button===Ic.RightClick?!1:(A==null||A({event:D}),!0)}}];const Dc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Hp extends Xc{constructor(C){super(C,Dc)}static setup(){return window.addEventListener(Dc.move.name,C,{capture:!1,passive:!1}),function(){window.removeEventListener(Dc.move.name,C)};function C(){}}}Hp.activators=[{eventName:"onTouchStart",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;const{touches:z}=D;return z.length>1?!1:(A==null||A({event:D}),!0)}}];var Rn;(function(_){_[_.Pointer=0]="Pointer",_[_.DraggableRect=1]="DraggableRect"})(Rn||(Rn={}));var to;(function(_){_[_.TreeOrder=0]="TreeOrder",_[_.ReversedTreeOrder=1]="ReversedTreeOrder"})(to||(to={}));function zp(_){let{acceleration:C,activator:D=Rn.Pointer,canScroll:A,draggingRect:z,enabled:P,interval:H=5,order:s=to.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:v,delta:a,threshold:p}=_;const S=Up({delta:a,disabled:!P}),[w,f]=Y0(),n=G.useRef({x:0,y:0}),c=G.useRef({x:0,y:0}),o=G.useMemo(()=>{switch(D){case Rn.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Rn.DraggableRect:return z}},[D,z,u]),h=G.useRef(null),m=G.useCallback(()=>{const y=h.current;if(!y)return;const E=n.current.x*c.current.x,b=n.current.y*c.current.y;y.scrollBy(E,b)},[]),x=G.useMemo(()=>s===to.TreeOrder?[...d].reverse():d,[s,d]);G.useEffect(()=>{if(!P||!d.length||!o){f();return}for(const y of x){if((A==null?void 0:A(y))===!1)continue;const E=d.indexOf(y),b=v[E];if(!b)continue;const{direction:R,speed:T}=wp(y,b,o,C,p);for(const I of["x","y"])S[I][R[I]]||(T[I]=0,R[I]=0);if(T.x>0||T.y>0){f(),h.current=y,w(m,H),n.current=T,c.current=R;return}}n.current={x:0,y:0},c.current={x:0,y:0},f()},[C,m,A,f,P,H,JSON.stringify(o),JSON.stringify(S),w,d,x,v,JSON.stringify(p)])}const Ip={x:{[xt.Backward]:!1,[xt.Forward]:!1},y:{[xt.Backward]:!1,[xt.Forward]:!1}};function Up(_){let{delta:C,disabled:D}=_;const A=kc(C);return Bn(z=>{if(D||!A||!z)return Ip;const P={x:Math.sign(C.x-A.x),y:Math.sign(C.y-A.y)};return{x:{[xt.Backward]:z.x[xt.Backward]||P.x===-1,[xt.Forward]:z.x[xt.Forward]||P.x===1},y:{[xt.Backward]:z.y[xt.Backward]||P.y===-1,[xt.Forward]:z.y[xt.Forward]||P.y===1}}},[D,C,A])}function Np(_,C){const D=C!=null?_.get(C):void 0,A=D?D.node.current:null;return Bn(z=>{var P;return C==null?null:(P=A??z)!=null?P:null},[A,C])}function jp(_,C){return G.useMemo(()=>_.reduce((D,A)=>{const{sensor:z}=A,P=z.activators.map(H=>({eventName:H.eventName,handler:C(H.handler,A)}));return[...D,...P]},[]),[_,C])}var Mn;(function(_){_[_.Always=0]="Always",_[_.BeforeDragging=1]="BeforeDragging",_[_.WhileDragging=2]="WhileDragging"})(Mn||(Mn={}));var Uc;(function(_){_.Optimized="optimized"})(Uc||(Uc={}));const l_=new Map;function Pp(_,C){let{dragging:D,dependencies:A,config:z}=C;const[P,H]=G.useState(null),{frequency:s,measure:u,strategy:d}=z,v=G.useRef(_),a=n(),p=Dn(a),S=G.useCallback(function(c){c===void 0&&(c=[]),!p.current&&H(o=>o===null?c:o.concat(c.filter(h=>!o.includes(h))))},[p]),w=G.useRef(null),f=Bn(c=>{if(a&&!D)return l_;if(!c||c===l_||v.current!==_||P!=null){const o=new Map;for(let h of _){if(!h)continue;if(P&&P.length>0&&!P.includes(h.id)&&h.rect.current){o.set(h.id,h.rect.current);continue}const m=h.node.current,x=m?new $c(u(m),m):null;h.rect.current=x,x&&o.set(h.id,x)}return o}return c},[_,P,D,a,u]);return G.useEffect(()=>{v.current=_},[_]),G.useEffect(()=>{a||S()},[D,a]),G.useEffect(()=>{P&&P.length>0&&H(null)},[JSON.stringify(P)]),G.useEffect(()=>{a||typeof s!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},s))},[s,a,S,...A]),{droppableRects:f,measureDroppableContainers:S,measuringScheduled:P!=null};function n(){switch(d){case Mn.Always:return!1;case Mn.BeforeDragging:return D;default:return!D}}}function Y_(_,C){return Bn(D=>_?D||(typeof C=="function"?C(_):_):null,[C,_])}function Fp(_,C){return Y_(_,C)}function qp(_){let{callback:C,disabled:D}=_;const A=Wc(C),z=G.useMemo(()=>{if(D||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:P}=window;return new P(A)},[A,D]);return G.useEffect(()=>()=>z==null?void 0:z.disconnect(),[z]),z}function oo(_){let{callback:C,disabled:D}=_;const A=Wc(C),z=G.useMemo(()=>{if(D||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:P}=window;return new P(A)},[D]);return G.useEffect(()=>()=>z==null?void 0:z.disconnect(),[z]),z}function Wp(_){return new $c(Ts(_),_)}function c_(_,C,D){C===void 0&&(C=Wp);const[A,z]=G.useState(null);function P(){z(u=>{if(!_)return null;if(_.isConnected===!1){var d;return(d=u??D)!=null?d:null}const v=C(_);return JSON.stringify(u)===JSON.stringify(v)?u:v})}const H=qp({callback(u){if(_)for(const d of u){const{type:v,target:a}=d;if(v==="childList"&&a instanceof HTMLElement&&a.contains(_)){P();break}}}}),s=oo({callback:P});return Li(()=>{P(),_?(s==null||s.observe(_),H==null||H.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),H==null||H.disconnect())},[_]),A}function Gp(_){const C=Y_(_);return P_(_,C)}const u_=[];function $p(_){const C=G.useRef(_),D=Bn(A=>_?A&&A!==u_&&_&&C.current&&_.parentNode===C.current.parentNode?A:ao(_):u_,[_]);return G.useEffect(()=>{C.current=_},[_]),D}function Vp(_){const[C,D]=G.useState(null),A=G.useRef(_),z=G.useCallback(P=>{const H=Rc(P.target);H&&D(s=>s?(s.set(H,zc(H)),new Map(s)):null)},[]);return G.useEffect(()=>{const P=A.current;if(_!==P){H(P);const s=_.map(u=>{const d=Rc(u);return d?(d.addEventListener("scroll",z,{passive:!0}),[d,zc(d)]):null}).filter(u=>u!=null);D(s.length?new Map(s):null),A.current=_}return()=>{H(_),H(P)};function H(s){s.forEach(u=>{const d=Rc(u);d==null||d.removeEventListener("scroll",z)})}},[z,_]),G.useMemo(()=>_.length?C?Array.from(C.values()).reduce((P,H)=>Rs(P,H),wi):V_(_):wi,[_,C])}function h_(_,C){C===void 0&&(C=[]);const D=G.useRef(null);return G.useEffect(()=>{D.current=null},C),G.useEffect(()=>{const A=_!==wi;A&&!D.current&&(D.current=_),!A&&D.current&&(D.current=null)},[_]),D.current?Ln(_,D.current):wi}function Xp(_){G.useEffect(()=>{if(!no)return;const C=_.map(D=>{let{sensor:A}=D;return A.setup==null?void 0:A.setup()});return()=>{for(const D of C)D==null||D()}},_.map(C=>{let{sensor:D}=C;return D}))}function Yp(_,C){return G.useMemo(()=>_.reduce((D,A)=>{let{eventName:z,handler:P}=A;return D[z]=H=>{P(H,C)},D},{}),[_,C])}function K_(_){return G.useMemo(()=>_?Sp(_):null,[_])}const d_=[];function Kp(_,C){C===void 0&&(C=Ts);const[D]=_,A=K_(D?Xt(D):null),[z,P]=G.useState(d_);function H(){P(()=>_.length?_.map(u=>G_(u)?A:new $c(C(u),u)):d_)}const s=oo({callback:H});return Li(()=>{s==null||s.disconnect(),H(),_.forEach(u=>s==null?void 0:s.observe(u))},[_]),z}function Qp(_){if(!_)return null;if(_.children.length>1)return _;const C=_.children[0];return On(C)?C:_}function Zp(_){let{measure:C}=_;const[D,A]=G.useState(null),z=G.useCallback(d=>{for(const{target:v}of d)if(On(v)){A(a=>{const p=C(v);return a?{...a,width:p.width,height:p.height}:p});break}},[C]),P=oo({callback:z}),H=G.useCallback(d=>{const v=Qp(d);P==null||P.disconnect(),v&&(P==null||P.observe(v)),A(v?C(v):null)},[C,P]),[s,u]=Ja(H);return G.useMemo(()=>({nodeRef:s,rect:D,setRef:u}),[D,s,u])}const Jp=[{sensor:Yc,options:{}},{sensor:Vc,options:{}}],e1={current:{}},Qa={draggable:{measure:s_},droppable:{measure:s_,strategy:Mn.WhileDragging,frequency:Uc.Optimized},dragOverlay:{measure:Ts}};class An extends Map{get(C){var D;return C!=null&&(D=super.get(C))!=null?D:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(C=>{let{disabled:D}=C;return!D})}getNodeFor(C){var D,A;return(D=(A=this.get(C))==null?void 0:A.node.current)!=null?D:void 0}}const t1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new An,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:eo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Qa,measureDroppableContainers:eo,windowRect:null,measuringScheduled:!1},i1={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:eo,draggableNodes:new Map,over:null,measureDroppableContainers:eo},lo=G.createContext(i1),Q_=G.createContext(t1);function r1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new An}}}function s1(_,C){switch(C.type){case bt.DragStart:return{..._,draggable:{..._.draggable,initialCoordinates:C.initialCoordinates,active:C.active}};case bt.DragMove:return _.draggable.active==null?_:{..._,draggable:{..._.draggable,translate:{x:C.coordinates.x-_.draggable.initialCoordinates.x,y:C.coordinates.y-_.draggable.initialCoordinates.y}}};case bt.DragEnd:case bt.DragCancel:return{..._,draggable:{..._.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bt.RegisterDroppable:{const{element:D}=C,{id:A}=D,z=new An(_.droppable.containers);return z.set(A,D),{..._,droppable:{..._.droppable,containers:z}}}case bt.SetDroppableDisabled:{const{id:D,key:A,disabled:z}=C,P=_.droppable.containers.get(D);if(!P||A!==P.key)return _;const H=new An(_.droppable.containers);return H.set(D,{...P,disabled:z}),{..._,droppable:{..._.droppable,containers:H}}}case bt.UnregisterDroppable:{const{id:D,key:A}=C,z=_.droppable.containers.get(D);if(!z||A!==z.key)return _;const P=new An(_.droppable.containers);return P.delete(D),{..._,droppable:{..._.droppable,containers:P}}}default:return _}}function n1(_){let{disabled:C}=_;const{active:D,activatorEvent:A,draggableNodes:z}=G.useContext(lo),P=kc(A),H=kc(D==null?void 0:D.id);return G.useEffect(()=>{if(!C&&!A&&P&&H!=null){if(!Gc(P)||document.activeElement===P.target)return;const s=z.get(H);if(!s)return;const{activatorNode:u,node:d}=s;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const v of[u.current,d.current]){if(!v)continue;const a=Z0(v);if(a){a.focus();break}}})}},[A,C,z,H,P]),null}function a1(_,C){let{transform:D,...A}=C;return _!=null&&_.length?_.reduce((z,P)=>P({transform:z,...A}),D):D}function o1(_){return G.useMemo(()=>({draggable:{...Qa.draggable,..._==null?void 0:_.draggable},droppable:{...Qa.droppable,..._==null?void 0:_.droppable},dragOverlay:{...Qa.dragOverlay,..._==null?void 0:_.dragOverlay}}),[_==null?void 0:_.draggable,_==null?void 0:_.droppable,_==null?void 0:_.dragOverlay])}function l1(_){let{activeNode:C,measure:D,initialRect:A,config:z=!0}=_;const P=G.useRef(!1),{x:H,y:s}=typeof z=="boolean"?{x:z,y:z}:z;Li(()=>{if(!H&&!s||!C){P.current=!1;return}if(P.current||!A)return;const d=C==null?void 0:C.node.current;if(!d||d.isConnected===!1)return;const v=D(d),a=P_(v,A);if(H||(a.x=0),s||(a.y=0),P.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){const p=F_(d);p&&p.scrollBy({top:a.y,left:a.x})}},[C,H,s,A,D])}const Z_=G.createContext({...wi,scaleX:1,scaleY:1});var Cr;(function(_){_[_.Uninitialized=0]="Uninitialized",_[_.Initializing=1]="Initializing",_[_.Initialized=2]="Initialized"})(Cr||(Cr={}));const J_=G.memo(function(C){var D,A,z,P;let{id:H,accessibility:s,autoScroll:u=!0,children:d,sensors:v=Jp,collisionDetection:a=dp,measuring:p,modifiers:S,...w}=C;const f=G.useReducer(s1,void 0,r1),[n,c]=f,[o,h]=sp(),[m,x]=G.useState(Cr.Uninitialized),y=m===Cr.Initialized,{draggable:{active:E,nodes:b,translate:R},droppable:{containers:T}}=n,I=E!=null?b.get(E):null,M=G.useRef({initial:null,translated:null}),k=G.useMemo(()=>{var tt;return E!=null?{id:E,data:(tt=I==null?void 0:I.data)!=null?tt:e1,rect:M}:null},[E,I]),U=G.useRef(null),[K,W]=G.useState(null),[$,V]=G.useState(null),O=Dn(w,Object.values(w)),q=kn("DndDescribedBy",H),B=G.useMemo(()=>T.getEnabled(),[T]),j=o1(p),{droppableRects:Q,measureDroppableContainers:J,measuringScheduled:ue}=Pp(B,{dragging:y,dependencies:[R.x,R.y],config:j.droppable}),he=Np(b,E),X=G.useMemo(()=>$?Hc($):null,[$]),F=Ti(),ae=Fp(he,j.draggable.measure);l1({activeNode:E!=null?b.get(E):null,config:F.layoutShiftCompensation,initialRect:ae,measure:j.draggable.measure});const ie=c_(he,j.draggable.measure,ae),_e=c_(he?he.parentElement:null),fe=G.useRef({activatorEvent:null,active:null,activeNode:he,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=T.getNodeFor((D=fe.current.over)==null?void 0:D.id),ge=Zp({measure:j.dragOverlay.measure}),Te=(A=ge.nodeRef.current)!=null?A:he,Pe=y?(z=ge.rect)!=null?z:ie:null,Se=!!(ge.nodeRef.current&&ge.rect),Ot=Gp(Se?null:ie),zt=K_(Te?Xt(Te):null),xe=$p(y?ye??he:null),Ee=Kp(xe),Ae=a1(S,{transform:{x:R.x-Ot.x,y:R.y-Ot.y,scaleX:1,scaleY:1},activatorEvent:$,active:k,activeNodeRect:ie,containerNodeRect:_e,draggingNodeRect:Pe,over:fe.current.over,overlayNodeRect:ge.rect,scrollableAncestors:xe,scrollableAncestorRects:Ee,windowRect:zt}),ve=X?Rs(X,R):null,we=Vp(xe),Ke=h_(we),qe=h_(we,[ie]),vt=Rs(Ae,Ke),Qe=Pe?vp(Pe,Ae):null,ct=k&&Qe?a({active:k,collisionRect:Qe,droppableRects:Q,droppableContainers:B,pointerCoordinates:ve}):null,Ze=N_(ct,"id"),[Oe,De]=G.useState(null),Yt=Se?Ae:Rs(Ae,qe),ut=fp(Yt,(P=Oe==null?void 0:Oe.rect)!=null?P:null,ie),Rt=G.useRef(null),gt=G.useCallback((tt,rt)=>{let{sensor:yt,options:It}=rt;if(U.current==null)return;const Ut=b.get(U.current);if(!Ut)return;const Bt=tt.nativeEvent,Nt=new yt({active:U.current,activeNode:Ut,event:Bt,options:It,context:fe,onAbort(pt){if(!b.get(pt))return;const{onDragAbort:Kt}=O.current,ni={id:pt};Kt==null||Kt(ni),o({type:"onDragAbort",event:ni})},onPending(pt,mi,Kt,ni){if(!b.get(pt))return;const{onDragPending:Oi}=O.current,Si={id:pt,constraint:mi,initialCoordinates:Kt,offset:ni};Oi==null||Oi(Si),o({type:"onDragPending",event:Si})},onStart(pt){const mi=U.current;if(mi==null)return;const Kt=b.get(mi);if(!Kt)return;const{onDragStart:ni}=O.current,Mi={activatorEvent:Bt,active:{id:mi,data:Kt.data,rect:M}};xn.unstable_batchedUpdates(()=>{ni==null||ni(Mi),x(Cr.Initializing),c({type:bt.DragStart,initialCoordinates:pt,active:mi}),o({type:"onDragStart",event:Mi}),W(Rt.current),V(Bt)})},onMove(pt){c({type:bt.DragMove,coordinates:pt})},onEnd:si(bt.DragEnd),onCancel:si(bt.DragCancel)});Rt.current=Nt;function si(pt){return async function(){const{active:Kt,collisions:ni,over:Mi,scrollAdjustedTranslate:Oi}=fe.current;let Si=null;if(Kt&&Oi){const{cancelDrop:Zi}=O.current;Si={activatorEvent:Bt,active:Kt,collisions:ni,delta:Oi,over:Mi},pt===bt.DragEnd&&typeof Zi=="function"&&await Promise.resolve(Zi(Si))&&(pt=bt.DragCancel)}U.current=null,xn.unstable_batchedUpdates(()=>{c({type:pt}),x(Cr.Uninitialized),De(null),W(null),V(null),Rt.current=null;const Zi=pt===bt.DragEnd?"onDragEnd":"onDragCancel";if(Si){const ai=O.current[Zi];ai==null||ai(Si),o({type:Zi,event:Si})}})}}},[b]),Qi=G.useCallback((tt,rt)=>(yt,It)=>{const Ut=yt.nativeEvent,Bt=b.get(It);if(U.current!==null||!Bt||Ut.dndKit||Ut.defaultPrevented)return;const Nt={active:Bt};tt(yt,rt.options,Nt)===!0&&(Ut.dndKit={capturedBy:rt.sensor},U.current=It,gt(yt,rt))},[b,gt]),Pr=jp(v,Qi);Xp(v),Li(()=>{ie&&m===Cr.Initializing&&x(Cr.Initialized)},[ie,m]),G.useEffect(()=>{const{onDragMove:tt}=O.current,{active:rt,activatorEvent:yt,collisions:It,over:Ut}=fe.current;if(!rt||!yt)return;const Bt={active:rt,activatorEvent:yt,collisions:It,delta:{x:vt.x,y:vt.y},over:Ut};xn.unstable_batchedUpdates(()=>{tt==null||tt(Bt),o({type:"onDragMove",event:Bt})})},[vt.x,vt.y]),G.useEffect(()=>{const{active:tt,activatorEvent:rt,collisions:yt,droppableContainers:It,scrollAdjustedTranslate:Ut}=fe.current;if(!tt||U.current==null||!rt||!Ut)return;const{onDragOver:Bt}=O.current,Nt=It.get(Ze),si=Nt&&Nt.rect.current?{id:Nt.id,rect:Nt.rect.current,data:Nt.data,disabled:Nt.disabled}:null,pt={active:tt,activatorEvent:rt,collisions:yt,delta:{x:Ut.x,y:Ut.y},over:si};xn.unstable_batchedUpdates(()=>{De(si),Bt==null||Bt(pt),o({type:"onDragOver",event:pt})})},[Ze]),Li(()=>{fe.current={activatorEvent:$,active:k,activeNode:he,collisionRect:Qe,collisions:ct,droppableRects:Q,draggableNodes:b,draggingNode:Te,draggingNodeRect:Pe,droppableContainers:T,over:Oe,scrollableAncestors:xe,scrollAdjustedTranslate:vt},M.current={initial:Pe,translated:Qe}},[k,he,ct,Qe,b,Te,Pe,Q,T,Oe,xe,vt]),zp({...F,delta:R,draggingRect:Qe,pointerCoordinates:ve,scrollableAncestors:xe,scrollableAncestorRects:Ee});const Ms=G.useMemo(()=>({active:k,activeNode:he,activeNodeRect:ie,activatorEvent:$,collisions:ct,containerNodeRect:_e,dragOverlay:ge,draggableNodes:b,droppableContainers:T,droppableRects:Q,over:Oe,measureDroppableContainers:J,scrollableAncestors:xe,scrollableAncestorRects:Ee,measuringConfiguration:j,measuringScheduled:ue,windowRect:zt}),[k,he,ie,$,ct,_e,ge,b,T,Q,Oe,J,xe,Ee,j,ue,zt]),xi=G.useMemo(()=>({activatorEvent:$,activators:Pr,active:k,activeNodeRect:ie,ariaDescribedById:{draggable:q},dispatch:c,draggableNodes:b,over:Oe,measureDroppableContainers:J}),[$,Pr,k,ie,c,q,b,Oe,J]);return Et.createElement(z_.Provider,{value:h},Et.createElement(lo.Provider,{value:xi},Et.createElement(Q_.Provider,{value:Ms},Et.createElement(Z_.Provider,{value:ut},d)),Et.createElement(n1,{disabled:(s==null?void 0:s.restoreFocus)===!1})),Et.createElement(op,{...s,hiddenTextDescribedById:q}));function Ti(){const tt=(K==null?void 0:K.autoScrollEnabled)===!1,rt=typeof u=="object"?u.enabled===!1:u===!1,yt=y&&!tt&&!rt;return typeof u=="object"?{...u,enabled:yt}:{enabled:yt}}}),c1=G.createContext(null),f_="button",u1="Draggable";function h1(_){let{id:C,data:D,disabled:A=!1,attributes:z}=_;const P=kn(u1),{activators:H,activatorEvent:s,active:u,activeNodeRect:d,ariaDescribedById:v,draggableNodes:a,over:p}=G.useContext(lo),{role:S=f_,roleDescription:w="draggable",tabIndex:f=0}=z??{},n=(u==null?void 0:u.id)===C,c=G.useContext(n?Z_:c1),[o,h]=Ja(),[m,x]=Ja(),y=Yp(H,C),E=Dn(D);Li(()=>(a.set(C,{id:C,key:P,node:o,activatorNode:m,data:E}),()=>{const R=a.get(C);R&&R.key===P&&a.delete(C)}),[a,C]);const b=G.useMemo(()=>({role:S,tabIndex:f,"aria-disabled":A,"aria-pressed":n&&S===f_?!0:void 0,"aria-roledescription":w,"aria-describedby":v.draggable}),[A,S,f,n,w,v.draggable]);return{active:u,activatorEvent:s,activeNodeRect:d,attributes:b,isDragging:n,listeners:A?void 0:y,node:o,over:p,setNodeRef:h,setActivatorNodeRef:x,transform:c}}function d1(){return G.useContext(Q_)}const f1="Droppable",_1={timeout:25};function v1(_){let{data:C,disabled:D=!1,id:A,resizeObserverConfig:z}=_;const P=kn(f1),{active:H,dispatch:s,over:u,measureDroppableContainers:d}=G.useContext(lo),v=G.useRef({disabled:D}),a=G.useRef(!1),p=G.useRef(null),S=G.useRef(null),{disabled:w,updateMeasurementsFor:f,timeout:n}={..._1,...z},c=Dn(f??A),o=G.useCallback(()=>{if(!a.current){a.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{d(Array.isArray(c.current)?c.current:[c.current]),S.current=null},n)},[n]),h=oo({callback:o,disabled:w||!H}),m=G.useCallback((b,R)=>{h&&(R&&(h.unobserve(R),a.current=!1),b&&h.observe(b))},[h]),[x,y]=Ja(m),E=Dn(C);return G.useEffect(()=>{!h||!x.current||(h.disconnect(),a.current=!1,h.observe(x.current))},[x,h]),G.useEffect(()=>(s({type:bt.RegisterDroppable,element:{id:A,key:P,disabled:D,node:x,rect:p,data:E}}),()=>s({type:bt.UnregisterDroppable,key:P,id:A})),[A]),G.useEffect(()=>{D!==v.current.disabled&&(s({type:bt.SetDroppableDisabled,id:A,key:P,disabled:D}),v.current.disabled=D)},[A,P,D,s]),{active:H,rect:p,isOver:(u==null?void 0:u.id)===A,node:x,over:u,setNodeRef:y}}function ev(_,C,D){const A=_.slice();return A.splice(D<0?A.length+D:D,0,A.splice(C,1)[0]),A}function g1(_,C){return _.reduce((D,A,z)=>{const P=C.get(A);return P&&(D[z]=P),D},Array(_.length))}function Va(_){return _!==null&&_>=0}function p1(_,C){if(_===C)return!0;if(_.length!==C.length)return!1;for(let D=0;D<_.length;D++)if(_[D]!==C[D])return!1;return!0}function m1(_){return typeof _=="boolean"?{draggable:_,droppable:_}:_}const tv=_=>{let{rects:C,activeIndex:D,overIndex:A,index:z}=_;const P=ev(C,A,D),H=C[z],s=P[z];return!s||!H?null:{x:s.left-H.left,y:s.top-H.top,scaleX:s.width/H.width,scaleY:s.height/H.height}},Xa={scaleX:1,scaleY:1},iv=_=>{var C;let{activeIndex:D,activeNodeRect:A,index:z,rects:P,overIndex:H}=_;const s=(C=P[D])!=null?C:A;if(!s)return null;if(z===D){const d=P[H];return d?{x:0,y:D<H?d.top+d.height-(s.top+s.height):d.top-s.top,...Xa}:null}const u=S1(P,z,D);return z>D&&z<=H?{x:0,y:-s.height-u,...Xa}:z<D&&z>=H?{x:0,y:s.height+u,...Xa}:{x:0,y:0,...Xa}};function S1(_,C,D){const A=_[C],z=_[C-1],P=_[C+1];return A?D<C?z?A.top-(z.top+z.height):P?P.top-(A.top+A.height):0:P?P.top-(A.top+A.height):z?A.top-(z.top+z.height):0:0}const rv="Sortable",sv=Et.createContext({activeIndex:-1,containerId:rv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:tv,disabled:{draggable:!1,droppable:!1}});function nv(_){let{children:C,id:D,items:A,strategy:z=tv,disabled:P=!1}=_;const{active:H,dragOverlay:s,droppableRects:u,over:d,measureDroppableContainers:v}=d1(),a=kn(rv,D),p=s.rect!==null,S=G.useMemo(()=>A.map(y=>typeof y=="object"&&"id"in y?y.id:y),[A]),w=H!=null,f=H?S.indexOf(H.id):-1,n=d?S.indexOf(d.id):-1,c=G.useRef(S),o=!p1(S,c.current),h=n!==-1&&f===-1||o,m=m1(P);Li(()=>{o&&w&&v(S)},[o,S,w,v]),G.useEffect(()=>{c.current=S},[S]);const x=G.useMemo(()=>({activeIndex:f,containerId:a,disabled:m,disableTransforms:h,items:S,overIndex:n,useDragOverlay:p,sortedRects:g1(S,u),strategy:z}),[f,a,m.draggable,m.droppable,h,S,n,u,p,z]);return Et.createElement(sv.Provider,{value:x},C)}const b1=_=>{let{id:C,items:D,activeIndex:A,overIndex:z}=_;return ev(D,A,z).indexOf(C)},y1=_=>{let{containerId:C,isSorting:D,wasDragging:A,index:z,items:P,newIndex:H,previousItems:s,previousContainerId:u,transition:d}=_;return!d||!A||s!==P&&z===H?!1:D?!0:H!==z&&C===u},C1={duration:200,easing:"ease"},av="transform",w1=Tn.Transition.toString({property:av,duration:0,easing:"linear"}),x1={roleDescription:"sortable"};function E1(_){let{disabled:C,index:D,node:A,rect:z}=_;const[P,H]=G.useState(null),s=G.useRef(D);return Li(()=>{if(!C&&D!==s.current&&A.current){const u=z.current;if(u){const d=Ts(A.current,{ignoreTransform:!0}),v={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(v.x||v.y)&&H(v)}}D!==s.current&&(s.current=D)},[C,D,A,z]),G.useEffect(()=>{P&&H(null)},[P]),P}function R1(_){let{animateLayoutChanges:C=y1,attributes:D,disabled:A,data:z,getNewIndex:P=b1,id:H,strategy:s,resizeObserverConfig:u,transition:d=C1}=_;const{items:v,containerId:a,activeIndex:p,disabled:S,disableTransforms:w,sortedRects:f,overIndex:n,useDragOverlay:c,strategy:o}=G.useContext(sv),h=A1(A,S),m=v.indexOf(H),x=G.useMemo(()=>({sortable:{containerId:a,index:m,items:v},...z}),[a,z,m,v]),y=G.useMemo(()=>v.slice(v.indexOf(H)),[v,H]),{rect:E,node:b,isOver:R,setNodeRef:T}=v1({id:H,data:x,disabled:h.droppable,resizeObserverConfig:{updateMeasurementsFor:y,...u}}),{active:I,activatorEvent:M,activeNodeRect:k,attributes:U,setNodeRef:K,listeners:W,isDragging:$,over:V,setActivatorNodeRef:O,transform:q}=h1({id:H,data:x,attributes:{...x1,...D},disabled:h.draggable}),B=X0(T,K),j=!!I,Q=j&&!w&&Va(p)&&Va(n),J=!c&&$,ue=J&&Q?q:null,X=Q?ue??(s??o)({rects:f,activeNodeRect:k,activeIndex:p,overIndex:n,index:m}):null,F=Va(p)&&Va(n)?P({id:H,items:v,activeIndex:p,overIndex:n}):m,ae=I==null?void 0:I.id,ie=G.useRef({activeId:ae,items:v,newIndex:F,containerId:a}),_e=v!==ie.current.items,fe=C({active:I,containerId:a,isDragging:$,isSorting:j,id:H,index:m,items:v,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:d,wasDragging:ie.current.activeId!=null}),ye=E1({disabled:!fe,index:m,node:b,rect:E});return G.useEffect(()=>{j&&ie.current.newIndex!==F&&(ie.current.newIndex=F),a!==ie.current.containerId&&(ie.current.containerId=a),v!==ie.current.items&&(ie.current.items=v)},[j,F,a,v]),G.useEffect(()=>{if(ae===ie.current.activeId)return;if(ae&&!ie.current.activeId){ie.current.activeId=ae;return}const Te=setTimeout(()=>{ie.current.activeId=ae},50);return()=>clearTimeout(Te)},[ae]),{active:I,activeIndex:p,attributes:U,data:x,rect:E,index:m,newIndex:F,items:v,isOver:R,isSorting:j,isDragging:$,listeners:W,node:b,overIndex:n,over:V,setNodeRef:B,setActivatorNodeRef:O,setDroppableNodeRef:T,setDraggableNodeRef:K,transform:ye??X,transition:ge()};function ge(){if(ye||_e&&ie.current.newIndex===m)return w1;if(!(J&&!Gc(M)||!d)&&(j||fe))return Tn.Transition.toString({...d,property:av})}}function A1(_,C){var D,A;return typeof _=="boolean"?{draggable:_,droppable:!1}:{draggable:(D=_==null?void 0:_.draggable)!=null?D:C.draggable,droppable:(A=_==null?void 0:_.droppable)!=null?A:C.droppable}}function io(_){if(!_)return!1;const C=_.data.current;return!!(C&&"sortable"in C&&typeof C.sortable=="object"&&"containerId"in C.sortable&&"items"in C.sortable&&"index"in C.sortable)}const D1=[Ue.Down,Ue.Right,Ue.Up,Ue.Left],L1=(_,C)=>{let{context:{active:D,collisionRect:A,droppableRects:z,droppableContainers:P,over:H,scrollableAncestors:s}}=C;if(D1.includes(_.code)){if(_.preventDefault(),!D||!A)return;const u=[];P.getEnabled().forEach(a=>{if(!a||a!=null&&a.disabled)return;const p=z.get(a.id);if(p)switch(_.code){case Ue.Down:A.top<p.top&&u.push(a);break;case Ue.Up:A.top>p.top&&u.push(a);break;case Ue.Left:A.left>p.left&&u.push(a);break;case Ue.Right:A.left<p.left&&u.push(a);break}});const d=up({collisionRect:A,droppableRects:z,droppableContainers:u});let v=N_(d,"id");if(v===(H==null?void 0:H.id)&&d.length>1&&(v=d[1].id),v!=null){const a=P.get(D.id),p=P.get(v),S=p?z.get(p.id):null,w=p==null?void 0:p.node.current;if(w&&S&&a&&p){const n=ao(w).some((y,E)=>s[E]!==y),c=ov(a,p),o=T1(a,p),h=n||!c?{x:0,y:0}:{x:o?A.width-S.width:0,y:o?A.height-S.height:0},m={x:S.left,y:S.top};return h.x&&h.y?m:Ln(m,h)}}}};function ov(_,C){return!io(_)||!io(C)?!1:_.data.current.sortable.containerId===C.data.current.sortable.containerId}function T1(_,C){return!io(_)||!io(C)||!ov(_,C)?!1:_.data.current.sortable.index<C.data.current.sortable.index}function lv(){var _;return((_=crypto.randomUUID)==null?void 0:_.call(crypto))??`id-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function cv({id:_,enabled:C,onToggle:D,onDelete:A,children:z,isExpandable:P,isExpanded:H,onToggleExpand:s,detailContent:u}){const{attributes:d,listeners:v,setNodeRef:a,transform:p,transition:S,isDragging:w}=R1({id:_}),f={transform:Tn.Transform.toString(p),opacity:w?.5:1};return ee.jsxs("div",{ref:a,style:{...f,borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden"},children:[ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",minHeight:"var(--min-touch-target, 44px)",overflow:"hidden"},children:[ee.jsx("div",{...d,...v,"aria-label":"拖拽排序",style:{width:24,color:"var(--text-muted)",cursor:"grab",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,userSelect:"none",touchAction:"none"},children:"⋮⋮"}),ee.jsx("button",{role:"switch","aria-checked":C,"aria-label":C?"已启用,点击禁用":"已禁用,点击启用",onClick:D,style:{width:32,height:20,borderRadius:10,border:"none",background:C?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:ee.jsx("span",{style:{position:"absolute",top:2,left:C?14:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),z,P&&ee.jsx("button",{"aria-label":H?"收起详情":"展开详情","aria-expanded":H,onClick:s,style:{width:28,height:28,padding:0,borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:ee.jsx("span",{style:{display:"inline-block",transform:H?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:"▼"})}),ee.jsx("button",{"aria-label":"删除",onClick:A,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:18,flexShrink:0},children:"×"})]}),P&&H&&ee.jsx("div",{style:{padding:"8px 16px 12px 68px",borderTop:"1px solid var(--border-color)",background:"var(--bg-secondary)"},children:u})]})}function uv(){return lp(t_(Yc,{activationConstraint:{distance:8}}),t_(Vc,{coordinateGetter:L1}))}const __=_=>[..._].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function M1(_){if(["Control","Alt","Shift","Meta"].includes(_.key))return null;let C="",D="";if(_.ctrlKey||_.altKey||_.metaKey){const A=_.key.toUpperCase(),z=_.ctrlKey?"Ctrl":_.altKey?"Alt":"Meta";if(_.key.length===1)if(C=`${z}+${A}`,_.ctrlKey)D=String.fromCharCode(_.key.toUpperCase().charCodeAt(0)-64);else return null;else return null}else if(_.key.startsWith("Arrow")){const z={ArrowUp:{label:"↑",code:"A"},ArrowDown:{label:"↓",code:"B"},ArrowRight:{label:"→",code:"C"},ArrowLeft:{label:"←",code:"D"}}[_.key];if(z)C=z.label,D=`\x1B[${z.code}`;else return null}else if(_.key==="Escape")C="Esc",D="\x1B";else if(_.key==="Enter")C="Enter",D="\r";else if(_.key==="Tab")C=_.shiftKey?"Shift+Tab":"Tab",D=_.shiftKey?"\x1B[Z":" ";else if(_.key==="Backspace")C="Backspace",D="";else if(_.key==="Delete")C="Delete",D="\x1B[3~";else if(_.key==="Home")C="Home",D="\x1B[H";else if(_.key==="End")C="End",D="\x1B[F";else if(_.key==="PageUp")C="PageUp",D="\x1B[5~";else if(_.key==="PageDown")C="PageDown",D="\x1B[6~";else if(_.key.match(/^F([1-9]|1[0-2])$/)){const A={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"};C=_.key,D=A[_.key]??""}else if(_.key.length===1)C=_.key.toUpperCase(),D=_.key;else return null;return{label:C,data:D}}function O1({shortcuts:_,onChange:C}){const[D,A]=G.useState(null),z=uv(),P=(v,a)=>{v.preventDefault(),v.stopPropagation();const p=M1(v);if(p){const S=[..._];S[a]={...S[a],label:p.label,data:p.data},C(S),A(null)}},H=v=>{const a=[..._];a[v]={...a[v],enabled:!a[v].enabled},C(__(a))},s=()=>{const v=[{label:"New",data:"",enabled:!0,_id:lv()},..._];C(__(v)),A(0)},u=v=>{const a=_.filter((p,S)=>S!==v);C(a)},d=v=>{const{active:a,over:p}=v;if(p&&a.id!==p.id){const S=_.findIndex(c=>c._id===a.id),w=_.findIndex(c=>c._id===p.id),f=[..._],[n]=f.splice(S,1);f.splice(w,0,n),C(f)}};return ee.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[ee.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[ee.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"快捷键"}),ee.jsx("button",{onClick:s,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ 添加"})]}),_.length===0&&ee.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"暂无快捷键,点击上方按钮添加"}),ee.jsx(J_,{sensors:z,collisionDetection:j_,onDragEnd:d,children:ee.jsx(nv,{items:_.map(v=>v._id),strategy:iv,children:_.map((v,a)=>ee.jsxs(cv,{id:v._id,enabled:v.enabled,onToggle:()=>H(a),onDelete:()=>u(a),children:[ee.jsx("input",{type:"text",value:v.label,readOnly:!0,placeholder:"按键捕获",onClick:()=>A(a),onKeyDown:p=>P(p,a),onBlur:()=>A(null),"aria-label":`快捷键 ${a+1}`,style:{flex:"1 1 0",minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:D===a?"2px solid var(--status-running)":"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",textAlign:"center"}}),ee.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"monospace",flexShrink:0,marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:80},children:v.data?v.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(未设置)"})]},v._id))})}),D!==null&&ee.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center",marginTop:4},children:"请按下要捕获的按键…"})]})}const v_=_=>[..._].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function B1({commands:_,onChange:C}){const[D,A]=G.useState(null),[z,P]=G.useState(""),[H,s]=G.useState(null),u=uv(),d=c=>{A(c),P(_[c].command)},v=c=>{if(c<0){A(null),P("");return}let o=z.trim();if(!o){f(c);return}o.startsWith("/")||(o="/"+o);const h=[..._];h[c]={...h[c],label:o,command:o},C(h),A(null),P("")},a=c=>{const o=[..._];o[c]={...o[c],enabled:!o[c].enabled},C(v_(o))},p=c=>{const o=[..._];o[c]={...o[c],autoSend:!(o[c].autoSend??!0)},C(o)},S=c=>{s(o=>o===c?null:c)},w=()=>{const c=[{label:"/new",command:"/new",enabled:!0,autoSend:!0,_id:lv()},..._];C(v_(c)),A(0),P("/new")},f=c=>{const o=_.filter((h,m)=>m!==c);C(o),H===c?s(null):H!==null&&H>c&&s(H-1)},n=c=>{const{active:o,over:h}=c;if(h&&o.id!==h.id){const m=_.findIndex(b=>b._id===o.id),x=_.findIndex(b=>b._id===h.id),y=[..._],[E]=y.splice(m,1);y.splice(x,0,E),C(y),H!==null&&(H===m?s(x):m<H&&x>=H?s(H-1):m>H&&x<=H&&s(H+1))}};return ee.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[ee.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[ee.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"命令"}),ee.jsx("button",{onClick:w,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ 添加"})]}),_.length===0&&ee.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"暂无命令,点击上方按钮添加"}),ee.jsx(J_,{sensors:u,collisionDetection:j_,onDragEnd:n,children:ee.jsx(nv,{items:_.map(c=>c._id),strategy:iv,children:_.map((c,o)=>ee.jsx(cv,{id:c._id,enabled:c.enabled,onToggle:()=>a(o),onDelete:()=>f(o),isExpandable:!0,isExpanded:H===o,onToggleExpand:()=>S(o),detailContent:ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[ee.jsx("button",{role:"switch","aria-checked":c.autoSend??!0,"aria-label":c.autoSend??!0?"自动发送已开启,点击关闭":"自动发送已关闭,点击开启",onClick:()=>p(o),style:{width:36,height:22,borderRadius:11,border:"none",background:c.autoSend??!0?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:ee.jsx("span",{style:{position:"absolute",top:2,left:c.autoSend??!0?16:2,width:18,height:18,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),ee.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"点击后自动发送"})]}),children:D===o?ee.jsx("input",{type:"text",value:z,onChange:h=>P(h.target.value),onKeyDown:h=>{h.key==="Enter"&&v(o),h.key==="Escape"&&(P(""),v(-1))},onBlur:()=>v(o),placeholder:"输入命令…","aria-label":`命令 ${o+1}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"2px solid var(--status-running)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14}}):ee.jsx("button",{type:"button",onClick:()=>d(o),"aria-label":`编辑命令 ${c.label}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,display:"flex",alignItems:"center",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.label})},c._id))})}),ee.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:8},children:"提示:命令会自动补足 / 前缀(如 help → /help)"})]})}const k1=/^https:\/\/oapi\.dingtalk\.com\/robot\/send\?access_token=/;function H1({isOpen:_,onClose:C,onConfigSaved:D}){const[A,z]=G.useState("shortcuts"),[P,H]=G.useState([]),[s,u]=G.useState([]),[d,v]=G.useState(""),[a,p]=G.useState(!1),[S,w]=G.useState(!1),[f,n]=G.useState(null),[c,o]=G.useState(!1),[h,m]=G.useState(!1),[x,y]=G.useState(!1),E=G.useRef(0);function b(){return String(++E.current)}function R(M){return{...M,_id:b()}}G.useEffect(()=>{_&&T()},[_]),G.useEffect(()=>{if(_)m(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>y(!0))});else if(h){y(!1);const M=setTimeout(()=>m(!1),300);return()=>clearTimeout(M)}},[_,h]);const T=async()=>{var M;try{const{config:k}=await D_();k?(H(k.shortcuts.map(U=>R(U))),u(k.commands.map(U=>R(U))),p(((M=k.dingtalk)==null?void 0:M.configured)??!1),v("")):(H(T_.map(U=>R({...U,enabled:!0}))),u(M_.map(U=>R({...U,enabled:!0}))),p(!1),v(""))}catch(k){n("加载配置失败"),console.error(k)}},I=async()=>{w(!0),n(null),o(!1);try{const M={shortcuts:P.map(({_id:K,...W})=>W),commands:s.map(({_id:K,...W})=>W)},k=d.trim();if(k){if(!k1.test(k)){n("请输入有效的钉钉 Webhook URL(以 https://oapi.dingtalk.com/robot/send?access_token= 开头)"),w(!1);return}M.dingtalk={webhookUrl:k}}await N0(M)?(o(!0),k&&(p(!0),v("")),D==null||D(),setTimeout(()=>o(!1),2e3)):n("保存失败")}catch(M){n("保存失败"),console.error(M)}finally{w(!1)}};return h?ee.jsx("div",{onClick:C,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:x?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1e3},children:ee.jsxs("div",{onClick:M=>M.stopPropagation(),style:{width:"100%",maxWidth:480,maxHeight:"85vh",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",transform:x?"translateY(0)":"translateY(100%)",paddingBottom:"var(--safe-bottom)"},children:[ee.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border-color)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ee.jsx("h2",{style:{fontSize:18,fontWeight:600,margin:0},children:"设置"}),ee.jsx("button",{onClick:C,"aria-label":"关闭",style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",fontSize:20,cursor:"pointer"},children:"×"})]}),ee.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color)"},children:["shortcuts","commands","dingtalk"].map(M=>ee.jsx("button",{onClick:()=>z(M),style:{flex:1,padding:"12px 16px",border:"none",background:"transparent",color:A===M?"var(--text-primary)":"var(--text-secondary)",borderBottom:A===M?"2px solid var(--status-running)":"2px solid transparent",cursor:"pointer",fontSize:14,fontWeight:A===M?600:400},children:M==="shortcuts"?"快捷键":M==="commands"?"命令":"钉钉"},M))}),ee.jsx("div",{style:{flex:1,overflow:"auto",padding:16},children:A==="shortcuts"?ee.jsx(O1,{shortcuts:P,onChange:H}):A==="commands"?ee.jsx(B1,{commands:s,onChange:u}):ee.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[ee.jsx("div",{style:{padding:12,background:"var(--bg-tertiary)",borderRadius:8,fontSize:13,color:"var(--text-secondary)"},children:"配置钉钉群机器人 Webhook 后,当 Claude Code 需要输入时会发送通知到钉钉群。"}),ee.jsxs("div",{children:[ee.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"Webhook URL"}),ee.jsx("input",{type:"url",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",value:d,onChange:M=>v(M.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,boxSizing:"border-box"}})]}),a&&!d&&ee.jsx("div",{style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ 已配置,输入新的 URL 可更新配置"}),ee.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:8},children:ee.jsx("a",{href:"https://open.dingtalk.com/document/robots/custom-robot-access",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"如何获取钉钉群机器人 Webhook?"})})]})}),ee.jsxs("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[ee.jsxs("div",{style:{fontSize:13},children:[f&&ee.jsx("span",{style:{color:"var(--status-error)"},children:f}),c&&ee.jsx("span",{style:{color:"var(--status-running)"},children:"已保存"})]}),ee.jsxs("div",{style:{display:"flex",gap:8},children:[ee.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"取消"}),ee.jsx("button",{onClick:I,disabled:S,style:{padding:"8px 20px",borderRadius:6,border:"none",background:S?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:S?"default":"pointer",opacity:S?.7:1},children:S?"保存中…":"保存"})]})]})]})}):null}const z1={idle:{color:"var(--status-idle)",label:"Idle"},running:{color:"var(--status-running)",label:"Running"},waiting_input:{color:"var(--status-waiting)",label:"Waiting Input"}},I1={connecting:{color:"var(--status-waiting)",label:"Connecting..."},connected:{color:"var(--status-idle)",label:"Connected"},disconnected:{color:"var(--status-error)",label:"Disconnected"}};function U1(){const[_,C]=G.useState(!1),D=lt(s=>s.sessionStatus),A=Vt(s=>s.activeInstanceId),z=lt(s=>A?s.instanceConnectionStatus[A]??"disconnected":s.connectionStatus),P=z1[D],H=I1[z];return ee.jsxs(ee.Fragment,{children:[ee.jsxs("div",{style:{height:"var(--statusbar-height)",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",paddingTop:"var(--safe-top)",flexShrink:0},children:[ee.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,overflow:"hidden",flex:"1 1 auto"},children:ee.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:"Claude Remote"})}),ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[ee.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:P.color,display:"inline-block"}}),ee.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:P.label})]}),ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[ee.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:H.color,display:"inline-block"}}),ee.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:H.label})]}),ee.jsx("button",{onClick:()=>C(!0),"aria-label":"设置",style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:18},children:"⚙"})]})]}),ee.jsx(H1,{isOpen:_,onClose:()=>C(!1),onConfigSaved:B_})]})}function N1({containerRef:_}){return ee.jsx("div",{ref:_,style:{flex:1,overflow:"hidden",background:"var(--bg-primary)"}})}const j1=G.forwardRef(function({onSend:C,disabled:D,isKeyboardOpen:A},z){const[P,H]=G.useState(""),s=G.useRef(null);G.useImperativeHandle(z,()=>({setText:v=>{H(v)},focus:()=>{var v;return(v=s.current)==null?void 0:v.focus()}}),[]);const u=G.useCallback(()=>{const v=P.trim();C(v),H("")},[P,C]),d=G.useCallback(v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),u())},[u]);return ee.jsx("div",{style:{height:"var(--inputbar-height)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center",padding:"8px 12px",paddingBottom:A?"8px":"calc(8px + var(--safe-bottom))",gap:8,flexShrink:0},children:ee.jsx("input",{ref:s,type:"text",value:P,onChange:v=>H(v.target.value),onKeyDown:d,disabled:D,autoComplete:"off",placeholder:"输入命令或数字选择…","aria-label":"命令输入框",style:{flex:1,height:40,padding:"0 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16}})})}),hv={height:36,borderRadius:6,border:"none",background:"var(--bg-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},P1={...hv,minWidth:44,flexShrink:0,color:"var(--text-primary)",fontSize:13,padding:"0 12px"},F1={...hv,minWidth:60,flexShrink:0,color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap",padding:"0 12px"};function Ya(){document.activeElement instanceof HTMLElement&&document.activeElement.blur()}function Lc(_,C,D){_.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),C(D);const A=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};requestAnimationFrame(A),setTimeout(A,0)}function q1({onShortcut:_,onCommandSelect:C,onCommandSend:D,visible:A=!0}){const{shortcuts:z,commands:P,isLoading:H}=V0();return!A||H?null:ee.jsxs("div",{"data-testid":"command-picker",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",flexShrink:0},children:[ee.jsx("div",{"data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:z.map(s=>ee.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:u=>Lc(u,_,s.data),onTouchStart:Ya,onMouseDown:u=>{u.preventDefault(),Ya()},style:P1,children:s.label},s.label))}),ee.jsx("div",{"data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:P.map(s=>{const u=s.autoSend??!0;return ee.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:d=>{u?Lc(d,D,s.command):Lc(d,C,s.command+" ")},onTouchStart:Ya,onMouseDown:d=>{d.preventDefault(),Ya()},style:F1,children:s.label},s.label)})}),ee.jsx("style",{children:`
|
|
54
|
+
[data-scrollable]::-webkit-scrollbar {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
58
|
+
.cmd-picker-btn:hover {
|
|
59
|
+
filter: brightness(1.2);
|
|
60
|
+
}
|
|
61
|
+
.cmd-picker-btn:active {
|
|
62
|
+
transform: scale(0.95);
|
|
63
|
+
filter: brightness(0.9);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
@media (prefers-reduced-motion: reduce) {
|
|
67
|
+
.cmd-picker-btn:hover {
|
|
68
|
+
filter: brightness(1.2);
|
|
69
|
+
}
|
|
70
|
+
.cmd-picker-btn:active {
|
|
71
|
+
filter: brightness(0.9);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`})]})}function W1(){const _=Vt(D=>D.activeInstanceId),C=lt(D=>_?D.instanceConnectionStatus[_]??"disconnected":D.connectionStatus);return C==="connected"?null:ee.jsx("div",{style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:C==="connecting"?"var(--status-waiting)":"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:C==="connecting"?"Connecting…":"Disconnected. Reconnecting…"})}function G1(){const _=lt(z=>z.ipChangeInfo),C=lt(z=>z.setIpChangeInfo);if(!_)return null;const D=()=>{navigator.clipboard.writeText(_.newUrl),C(null)},A=()=>{C(null)};return ee.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top) + 8px)",left:"50%",transform:"translateX(-50%)",zIndex:100,maxWidth:"calc(100% - 32px)",background:"var(--status-waiting)",color:"#fff",borderRadius:"8px",padding:"12px 16px",fontSize:"14px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",gap:"8px"},children:[ee.jsx("div",{style:{fontWeight:500},children:"IP已变更"}),ee.jsxs("div",{style:{fontSize:"13px",opacity:.9},children:[_.oldIp," → ",_.newIp]}),ee.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"4px"},children:[ee.jsx("button",{onClick:D,style:{flex:1,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"复制新地址"}),ee.jsx("button",{onClick:A,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.3)",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"关闭"})]})]})}async function Nc(){const _=await fetch("/api/instances",{credentials:"include"});if(_.status===401){const C=As();if(console.log("[fetchInstances] got 401, cachedToken =",C?"exists":"null"),C)try{console.log("[fetchInstances] attempting re-authentication...");const D=await wr(C);if(console.log("[fetchInstances] re-auth result:",D),D){const A=await fetch("/api/instances",{credentials:"include"});if(A.ok)return console.log("[fetchInstances] retry succeeded"),A.json()}}catch(D){console.log("[fetchInstances] re-auth error:",D)}throw new Error("Unauthorized")}if(!_.ok)throw new Error(`Failed to fetch instances: ${_.status}`);return _.json()}function $1(_,C){return`${window.location.protocol}//${_}:${C}`}function V1(_,C){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${_}:${C}/ws`}async function ro(_,C,D){const A=$1(_,C);return(await fetch(`${A}/api/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:D})})).ok}async function dv(_,C){const D=await fetch(_,C);if(D.status===401){const A=As();if(A)try{if(await wr(A))return fetch(_,C)}catch{}}return D}async function X1(){const _=await dv("/api/instances/config",{credentials:"include"});if(_.status===401)throw new Error("Unauthorized");if(!_.ok)throw new Error(`Failed to get instance config: ${_.status}`);return _.json()}async function Y1(_){const C=await dv("/api/instances/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_)});if(C.status===401)throw new Error("Unauthorized");if(!C.ok){const D=await C.json().catch(()=>({error:"Unknown error"}));throw new Error(D.error||`Failed to create instance: ${C.status}`)}return C.json()}function g_(_){const C=_.split("/").filter(Boolean);return C[C.length-1]||_}function K1(_){const C=_.split("/").filter(Boolean);return C.length<=1?_:".../"+C[C.length-2]}function Q1({workspaces:_,value:C,onChange:D,placeholder:A="选择工作目录…",disabled:z=!1,id:P}){const[H,s]=G.useState(!1),[u,d]=G.useState(""),[v,a]=G.useState(-1),p=G.useRef(null),S=G.useRef(null),w=G.useRef(null),f=G.useMemo(()=>{if(!u.trim())return _;const x=u.toLowerCase();return _.filter(y=>y.toLowerCase().includes(x))},[_,u]),n=C?g_(C):null,c=G.useCallback(()=>{!z&&_.length>0&&(s(!0),a(-1),d(""))},[z,_.length]),o=G.useCallback(()=>{s(!1),d(""),a(-1)},[]),h=G.useCallback(x=>{D(x),o()},[D,o]),m=G.useCallback(x=>{const y=f.length;switch(x.key){case"ArrowDown":x.preventDefault(),a(E=>E<y-1?E+1:0);break;case"ArrowUp":x.preventDefault(),a(E=>E>0?E-1:y-1);break;case"Enter":x.preventDefault(),v>=0&&v<y&&h(f[v]);break;case"Escape":x.preventDefault(),o();break}},[f,v,h,o]);return G.useEffect(()=>{if(!H)return;const x=y=>{w.current&&!w.current.contains(y.target)&&p.current&&!p.current.contains(y.target)&&o()};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[H,o]),_.length===0?ee.jsx("div",{style:St.emptyState,children:"没有可用的工作目录"}):ee.jsxs("div",{style:St.container,children:[ee.jsxs("button",{ref:p,type:"button",onClick:c,disabled:z,id:P,style:{...St.trigger,...z?St.triggerDisabled:{}},"aria-haspopup":"listbox","aria-expanded":H,children:[ee.jsx(p_,{}),ee.jsx("span",{style:St.triggerText,children:n||A}),ee.jsx("span",{style:St.triggerArrow,children:"▼"})]}),H&&ee.jsxs("div",{ref:w,style:St.dropdown,role:"listbox",children:[ee.jsxs("div",{style:St.searchContainer,children:[ee.jsx(Z1,{}),ee.jsx("input",{ref:S,type:"text",value:u,onChange:x=>{d(x.target.value),a(-1)},onKeyDown:m,placeholder:"搜索工作目录…",autoComplete:"off",style:St.searchInput})]}),ee.jsx("div",{style:St.listContainer,children:f.length===0?ee.jsx("div",{style:St.emptyList,children:"没有匹配的工作目录"}):f.map((x,y)=>ee.jsxs("div",{role:"option","aria-selected":v===y,onClick:()=>h(x),onMouseEnter:()=>a(y),style:{...St.option,...v===y?St.optionHighlighted:{},...C===x?St.optionSelected:{}},title:x,children:[ee.jsx(p_,{}),ee.jsxs("div",{style:St.optionContent,children:[ee.jsx("span",{style:St.optionName,children:g_(x)}),ee.jsx("span",{style:St.optionPath,children:K1(x)})]})]},x))})]})]})}function p_(){return ee.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:St.folderIcon,children:[ee.jsx("path",{d:"M2 4C2 3.44772 2.44772 3 3 3H6.17157C6.43678 3 6.69114 3.10536 6.87868 3.29289L7.58579 4H13C13.5523 4 14 4.44772 14 5V12C14 12.5523 13.5523 13 13 13H3C2.44772 13 2 12.5523 2 12V4Z",fill:"currentColor",opacity:"0.6"}),ee.jsx("path",{d:"M2 5.5V12C2 12.5523 2.44772 13 3 13H13C13.5523 13 14 12.5523 14 12V5.5C14 5.22386 13.7761 5 13.5 5H2.5C2.22386 5 2 5.22386 2 5.5Z",fill:"currentColor"})]})}function Z1(){return ee.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:St.searchIcon,children:[ee.jsx("circle",{cx:"5.5",cy:"5.5",r:"4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),ee.jsx("path",{d:"M9 9L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}const St={container:{position:"relative",width:"100%"},emptyState:{padding:"10px 12px",borderRadius:8,background:"var(--bg-tertiary)",color:"var(--text-secondary)",fontSize:13},trigger:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:8,textAlign:"left",boxSizing:"border-box",transition:"border-color 0.15s ease"},triggerDisabled:{opacity:.6,cursor:"not-allowed"},triggerText:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},triggerArrow:{fontSize:10,color:"var(--text-secondary)",marginLeft:"auto"},dropdown:{position:"absolute",top:"100%",left:0,right:0,marginTop:4,borderRadius:8,background:"var(--bg-secondary)",border:"1px solid var(--border-color)",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.4)",zIndex:1e3,overflow:"hidden"},searchContainer:{display:"flex",alignItems:"center",padding:"8px 12px",borderBottom:"1px solid var(--border-color)",background:"var(--bg-tertiary)"},searchIcon:{marginRight:8,flexShrink:0,color:"var(--text-secondary)"},searchInput:{flex:1,border:"none",background:"transparent",color:"var(--text-primary)",fontSize:14,fontFamily:"var(--font-mono)"},listContainer:{maxHeight:240,overflow:"auto",padding:"4px 0"},emptyList:{padding:"16px 12px",textAlign:"center",color:"var(--text-secondary)",fontSize:13},option:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",cursor:"pointer",transition:"background-color 0.1s ease"},optionHighlighted:{background:"rgba(88, 166, 255, 0.15)"},optionSelected:{background:"rgba(88, 166, 255, 0.08)"},optionContent:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:2},optionName:{color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},optionPath:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},folderIcon:{flexShrink:0,color:"var(--text-secondary)"}};function J1({isOpen:_,onClose:C,onSuccess:D}){const[A,z]=G.useState(null),[P,H]=G.useState(""),[s,u]=G.useState(""),[d,v]=G.useState(""),[a,p]=G.useState(!1),[S,w]=G.useState(null);G.useEffect(()=>{_&&(f(),H(""),u(""),v(""),w(null))},[_]);const f=async()=>{try{const o=await X1();z(o),o.claudeArgs.length>0&&v(o.claudeArgs.join(" "))}catch(o){console.error("Failed to load instance config:",o),w("加载配置失败")}},n=async()=>{if(!P){w("请选择工作目录");return}p(!0),w(null);try{const o=d.trim()?d.split(/\s+/).filter(Boolean):void 0;await Y1({cwd:P,name:s.trim()||void 0,claudeArgs:o});const h=s.trim()||P.split("/").pop()||"unknown";D(h),C()}catch(o){console.error("Failed to create instance:",o),w(o instanceof Error?o.message:"创建实例失败")}finally{p(!1)}};if(!_)return null;const c=A&&A.workspaces.length>0;return ee.jsx("div",{onClick:C,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:ee.jsxs("div",{onClick:o=>o.stopPropagation(),style:{width:"90%",maxWidth:480,maxHeight:"80vh",borderRadius:12,background:"var(--bg-secondary)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[ee.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border-color)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ee.jsx("h2",{style:{fontSize:18,fontWeight:600,margin:0},children:"创建新实例"}),ee.jsx("button",{onClick:C,"aria-label":"关闭",style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",fontSize:20,cursor:"pointer"},children:"×"})]}),ee.jsxs("div",{style:{flex:1,overflow:"auto",padding:16,display:"flex",flexDirection:"column",gap:16},children:[ee.jsxs("div",{children:[ee.jsx("label",{htmlFor:"cwd-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"工作目录 *"}),ee.jsx(Q1,{id:"cwd-select",workspaces:(A==null?void 0:A.workspaces)??[],value:P,onChange:H,placeholder:"选择工作目录…",disabled:!c}),!c&&ee.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:6,opacity:.8},children:"请先在配置文件中设置 workspaces,或通过 CLI 启动一个实例。"})]}),ee.jsxs("div",{children:[ee.jsx("label",{htmlFor:"instance-name",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"实例名称(可选)"}),ee.jsx("input",{id:"instance-name",type:"text",value:s,onChange:o=>u(o.target.value),placeholder:"默认为工作目录名",style:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,boxSizing:"border-box"}})]}),ee.jsxs("div",{children:[ee.jsx("label",{htmlFor:"claude-args",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Claude 参数(可选)"}),ee.jsx("input",{id:"claude-args",type:"text",value:d,onChange:o=>v(o.target.value),placeholder:"例如: chat --model claude-sonnet-4-6",style:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,boxSizing:"border-box"}}),ee.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"多个参数用空格分隔(不支持引号包裹含空格的参数)"})]}),S&&ee.jsx("div",{style:{padding:"10px 12px",borderRadius:8,background:"rgba(255, 59, 48, 0.1)",color:"var(--status-error)",fontSize:13},children:S})]}),ee.jsxs("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8},children:[ee.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"取消"}),ee.jsx("button",{onClick:n,disabled:a||!c,style:{padding:"8px 20px",borderRadius:6,border:"none",background:a||!c?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:a||!c?"default":"pointer",opacity:a||!c?.7:1},children:a?"创建中…":"创建"})]})]})})}function em({onSwitch:_}){const C=Vt(u=>u.instances),D=Vt(u=>u.setInstances),A=Vt(u=>u.activeInstanceId),[z,P]=G.useState(!1),H=C.length>1,s=async u=>{for(let v=0;v<5;v++){await new Promise(a=>setTimeout(a,1e3));try{const a=await Nc();if(a.find(S=>S.name===u)){D(a);return}}catch(a){console.error("[InstanceTabs] Failed to fetch instances:",a)}}try{const v=await Nc();D(v)}catch{}};return ee.jsxs(ee.Fragment,{children:[ee.jsxs("div",{style:{display:"flex",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",overflowX:"auto",flexShrink:0},children:[H&&C.map(u=>{const d=u.instanceId===A;return ee.jsxs("button",{onClick:()=>_(u.instanceId),style:{padding:"8px 16px",background:"transparent",border:"none",borderBottom:d?"2px solid var(--accent-color, #007aff)":"2px solid transparent",color:d?"var(--text-primary)":"var(--text-secondary)",fontSize:13,fontWeight:d?600:400,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0},children:[u.name,ee.jsxs("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-tertiary, var(--text-secondary))",opacity:.7},children:[":",u.port]})]},u.instanceId)}),ee.jsx("button",{onClick:()=>P(!0),"aria-label":"创建新实例",style:{padding:"10px 16px",background:"transparent",border:"none",borderLeft:H?"1px solid var(--border-color)":"none",color:"var(--text-secondary)",fontSize:20,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0,marginLeft:H?"auto":0},children:"+"})]}),ee.jsx(J1,{isOpen:z,onClose:()=>P(!1),onSuccess:s})]})}const m_="claude_remote_onboarding_done",Ka=[{title:"欢迎使用 Claude Code Remote",description:"这是一个让你用手机远程掌控 PC 终端的工具。Claude Code 运行在你的 PC 上,你可以在任何地方通过手机访问它。支持 ANSI 颜色渲染,保持完整的终端体验。"},{title:"终端显示区",description:"这里实时显示 Claude Code 的输出内容,就像在 PC 终端里一样。右上角的 ↑↓ 按钮可以快速滚动到顶部或底部,支持 10,000 行历史记录回滚。"},{title:"命令输入框",description:"在底部输入框中输入命令或消息,按 Enter 发送。Claude 会根据你的输入继续工作。"},{title:"快捷按键栏",description:"底部横栏提供常用快捷键:Esc 取消操作、Enter 继续执行、Tab 补全、方向键移动、Ctrl+C 中断。点击即可发送,无需在手机键盘上输入复杂按键组合。"},{title:"命令按钮",description:"快捷栏右侧显示预设命令,点击可直接发送(如 /clear 清屏)。部分命令会先填入输入框供你编辑后再发送,方便自定义参数。"},{title:"状态指示器与工具审批",description:"顶部状态栏显示当前会话状态:Idle(空闲)、Running(执行中)、Waiting Input(等待审批)。当 Claude 需要使用敏感工具时,状态变黄,输入 y 确认或按 Esc 拒绝。"},{title:"多实例、设置与通知",description:"运行多个实例时通过顶部标签页切换。点击 ⚙️ 按钮自定义快捷键和命令。开启通知权限后,Claude 等待输入时会收到本地通知。若 PC 局域网 IP 变化,会自动提示新地址。"}];function tm({onComplete:_}){const[C,D]=G.useState(!1),[A,z]=G.useState(0);G.useEffect(()=>{localStorage.getItem(m_)||D(!0)},[]);const P=()=>{A<Ka.length-1?z(A+1):s()},H=()=>{A>0&&z(A-1)},s=()=>{localStorage.setItem(m_,"true"),D(!1),_==null||_()},u=()=>{s()};if(!C)return null;const d=Ka[A],v=A===Ka.length-1,a=A===0;return ee.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2e3,padding:20},children:ee.jsxs("div",{style:{width:"100%",maxWidth:400,borderRadius:16,background:"var(--bg-secondary)",boxShadow:"0 12px 48px rgba(0, 0, 0, 0.4)",overflow:"hidden"},children:[ee.jsx("div",{style:{padding:"12px 20px",background:"var(--bg-tertiary)",display:"flex",justifyContent:"center",gap:8},children:Ka.map((p,S)=>ee.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:S===A?"var(--status-running)":S<A?"var(--status-idle)":"var(--border-color)"}},S))}),ee.jsxs("div",{style:{padding:"24px 20px"},children:[ee.jsx("h2",{style:{fontSize:20,fontWeight:600,margin:"0 0 12px 0",color:"var(--text-primary)"},children:d.title}),ee.jsx("p",{style:{fontSize:14,lineHeight:1.6,margin:0,color:"var(--text-secondary)"},children:d.description})]}),ee.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid var(--border-color)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ee.jsx("button",{onClick:u,style:{padding:"8px 16px",borderRadius:8,border:"none",background:"transparent",color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:"跳过"}),ee.jsxs("div",{style:{display:"flex",gap:8},children:[!a&&ee.jsx("button",{onClick:H,style:{padding:"8px 20px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"上一步"}),ee.jsx("button",{onClick:P,style:{padding:"8px 24px",borderRadius:8,border:"none",background:"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer"},children:v?"开始使用":"下一步"})]})]})]})})}function im({visible:_,onClick:C}){const[D,A]=G.useState(!1);G.useEffect(()=>{_&&A(!0)},[_]);const z=()=>{_||A(!1)};return D?ee.jsx("button",{className:`scroll-to-bottom-btn ${_?"visible":"hidden"}`,onClick:C,onAnimationEnd:z,"aria-label":"跳转到最新输出",children:"↓"}):null}const S_="__default__",b_=[1e3,2e3,4e3,8e3,16e3,3e4];function rm(_,C,D=S_){const A=G.useRef(null),z=G.useRef(0),P=G.useRef(void 0),H=G.useRef(_),s=G.useRef(0),u=G.useRef(!1),d=lt(h=>h.setConnectionStatus),v=G.useRef(d),a=lt(h=>h.setInstanceConnectionStatus),p=G.useRef(a),S=G.useCallback(h=>{D===S_&&v.current(h),p.current(D,h)},[D]);G.useEffect(()=>{H.current=_},[_]),G.useEffect(()=>{v.current=d},[d]),G.useEffect(()=>{p.current=a},[a]);const w=G.useRef(void 0),f=G.useCallback(h=>{const m=b_[Math.min(z.current,b_.length-1)];z.current++,P.current=setTimeout(()=>{var x;u.current||h!==s.current||(x=w.current)==null||x.call(w)},m)},[]),n=G.useCallback(async()=>{if(A.current&&A.current.readyState===WebSocket.OPEN)return;const h=C??`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;P.current&&(clearTimeout(P.current),P.current=void 0),u.current=!1;const m=++s.current;if(S("connecting"),C){const y=As();if(y)try{const E=new URL(C),b=Number(E.port||(E.protocol==="wss:"?"443":"80"));if(console.log("[useWebSocket] connecting to remote instance, authenticating first..."),!await ro(E.hostname,b,y)){console.log("[useWebSocket] auth failed, will retry..."),f(m);return}console.log("[useWebSocket] auth successful, creating WebSocket...")}catch(E){console.log("[useWebSocket] auth error:",E),f(m);return}else console.log("[useWebSocket] no cached token for remote instance, connecting anyway...")}if(u.current||m!==s.current)return;const x=new WebSocket(h);A.current=x,x.onopen=()=>{u.current||m!==s.current||A.current!==x||(S("connected"),z.current=0)},x.onmessage=y=>{if(!(u.current||m!==s.current||A.current!==x))try{const E=JSON.parse(y.data);H.current(E)}catch{}},x.onclose=async()=>{if(u.current||m!==s.current||A.current!==x)return;A.current=null,S("disconnected");const y=As();if(console.log("[useWebSocket] onclose: cachedToken =",y?"exists":"null"),y)try{console.log("[useWebSocket] attempting re-authentication...");let E=!1;if(C){const b=new URL(C),R=Number(b.port||(b.protocol==="wss:"?"443":"80"));E=await ro(b.hostname,R,y)}else E=await wr(y);console.log("[useWebSocket] re-auth result:",E)}catch(E){console.log("[useWebSocket] re-auth error:",E)}f(m)},x.onerror=()=>{}},[f,S,C]);G.useEffect(()=>{w.current=n},[n]);const c=G.useCallback(h=>{var m;return((m=A.current)==null?void 0:m.readyState)===WebSocket.OPEN?(A.current.send(JSON.stringify(h)),!0):!1},[]),o=G.useCallback(()=>{u.current=!0,s.current++,P.current&&(clearTimeout(P.current),P.current=void 0);const h=A.current;A.current=null,h==null||h.close()},[]);return G.useEffect(()=>{const h=()=>{var m;(m=A.current)==null||m.close()};return window.addEventListener("offline",h),()=>{u.current=!0,s.current++,window.removeEventListener("offline",h),P.current&&(clearTimeout(P.current),P.current=void 0);const m=A.current;A.current=null,m==null||m.close()}},[]),{connect:n,disconnect:o,send:c}}var Tc={exports:{}},y_;function sm(){return y_||(y_=1,(function(_,C){(function(D,A){_.exports=A()})(globalThis,(()=>(()=>{var D={4567:function(H,s,u){var d=this&&this.__decorate||function(o,h,m,x){var y,E=arguments.length,b=E<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,h,m,x);else for(var R=o.length-1;R>=0;R--)(y=o[R])&&(b=(E<3?y(b):E>3?y(h,m,b):y(h,m))||b);return E>3&&b&&Object.defineProperty(h,m,b),b},v=this&&this.__param||function(o,h){return function(m,x){h(m,x,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const a=u(9042),p=u(9924),S=u(844),w=u(4725),f=u(2585),n=u(3656);let c=s.AccessibilityManager=class extends S.Disposable{constructor(o,h,m,x){super(),this._terminal=o,this._coreBrowserService=m,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
75
|
+
`)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(o){for(let h=0;h<o;h++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
|
|
76
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,h){this._liveRegionDebouncer.refresh(o,h,this._terminal.rows)}_renderRows(o,h){const m=this._terminal.buffer,x=m.lines.length.toString();for(let y=o;y<=h;y++){const E=m.lines.get(m.ydisp+y),b=[],R=(E==null?void 0:E.translateToString(!0,void 0,void 0,b))||"",T=(m.ydisp+y+1).toString(),I=this._rowElements[y];I&&(R.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=R,this._rowColumns.set(I,b)),I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,h){const m=o.target,x=this._rowElements[h===0?1:this._rowElements.length-2];if(m.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==x)return;let y,E;if(h===0?(y=m,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(y=this._rowElements.shift(),E=m,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),h===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(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:o.anchorNode,offset:o.anchorOffset},m={node:o.focusNode,offset:o.focusOffset};if((h.node.compareDocumentPosition(m.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===m.node&&h.offset>m.offset)&&([h,m]=[m,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const x=this._rowElements.slice(-1)[0];if(m.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(m={node:x,offset:((R=x.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(m.node))return;const y=({node:T,offset:I})=>{const M=T instanceof Text?T.parentNode:T;let k=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(k))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(M);if(!U)return console.warn("columns is null. Race condition?"),null;let K=I<U.length?U[I]:U.slice(-1)[0]+1;return K>=this._terminal.cols&&(++k,K=0),{row:k,column:K}},E=y(h),b=y(m);if(E&&b){if(E.row>b.row||E.row===b.row&&E.column>=b.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(b.row-E.row)*this._terminal.cols-E.column+b.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_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 o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=c=d([v(1,f.IInstantiationService),v(2,w.ICoreBrowserService),v(3,w.IRenderService)],c)},3614:(H,s)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function d(p,S){return S?"\x1B[200~"+p+"\x1B[201~":p}function v(p,S,w,f){p=d(p=u(p),w.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),S.value=""}function a(p,S,w){const f=w.getBoundingClientRect(),n=p.clientX-f.left-10,c=p.clientY-f.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${n}px`,S.style.top=`${c}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=u,s.bracketTextForPaste=d,s.copyHandler=function(p,S){p.clipboardData&&p.clipboardData.setData("text/plain",S.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,S,w,f){p.stopPropagation(),p.clipboardData&&v(p.clipboardData.getData("text/plain"),S,w,f)},s.paste=v,s.moveTextAreaUnderMouseCursor=a,s.rightClickHandler=function(p,S,w,f,n){a(p,S,w),n&&f.rightClickSelect(p),S.value=f.selectionText,S.select()}},7239:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=u(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(v,a,p){this._css.set(v,a,p)}getCss(v,a){return this._css.get(v,a)}setColor(v,a,p){this._color.set(v,a,p)}getColor(v,a){return this._color.get(v,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(u,d,v,a){u.addEventListener(d,v,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,v,a))}}}},3551:function(H,s,u){var d=this&&this.__decorate||function(c,o,h,m){var x,y=arguments.length,E=y<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(c,o,h,m);else for(var b=c.length-1;b>=0;b--)(x=c[b])&&(E=(y<3?x(E):y>3?x(o,h,E):x(o,h))||E);return y>3&&E&&Object.defineProperty(o,h,E),E},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const a=u(3656),p=u(8460),S=u(844),w=u(2585),f=u(4725);let n=s.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(c,o,h,m,x){super(),this._element=c,this._mouseService=o,this._renderService=h,this._bufferService=m,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const h=c.composedPath();for(let m=0;m<h.length;m++){const x=h[m];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,o){var m,x;this._activeProviderReplies&&o||((m=this._activeProviderReplies)==null||m.forEach((y=>{y==null||y.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let h=!1;for(const[y,E]of this._linkProviderService.linkProviders.entries())o?(x=this._activeProviderReplies)!=null&&x.get(y)&&(h=this._checkLinkProviderResult(y,c,h)):E.provideLinks(c.y,(b=>{var T,I;if(this._isMouseOut)return;const R=b==null?void 0:b.map((M=>({link:M})));(T=this._activeProviderReplies)==null||T.set(y,R),h=this._checkLinkProviderResult(y,c,h),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,o){const h=new Set;for(let m=0;m<o.size;m++){const x=o.get(m);if(x)for(let y=0;y<x.length;y++){const E=x[y],b=E.link.range.start.y<c?0:E.link.range.start.x,R=E.link.range.end.y>c?this._bufferService.cols:E.link.range.end.x;for(let T=b;T<=R;T++){if(h.has(T)){x.splice(y--,1);break}h.add(T)}}}}_checkLinkProviderResult(c,o,h){var y;if(!this._activeProviderReplies)return h;const m=this._activeProviderReplies.get(c);let x=!1;for(let E=0;E<c;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(x=!0);if(!x&&m){const E=m.find((b=>this._linkAtPosition(b.link,o)));E&&(h=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let E=0;E<this._activeProviderReplies.size;E++){const b=(y=this._activeProviderReplies.get(E))==null?void 0:y.find((R=>this._linkAtPosition(R.link,o)));if(b){h=!0,this._handleNewLink(b);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,o){this._currentLink&&this._lastMouseEvent&&(!c||!o||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(c.link,o)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var h,m;return(m=(h=this._currentLink)==null?void 0:h.state)==null?void 0:m.decorations.pointerCursor},set:h=>{var m;(m=this._currentLink)!=null&&m.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,m;return(m=(h=this._currentLink)==null?void 0:h.state)==null?void 0:m.decorations.underline},set:h=>{var m,x,y;(m=this._currentLink)!=null&&m.state&&((y=(x=this._currentLink)==null?void 0:x.state)==null?void 0:y.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const m=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(m,x),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(c,o,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(h,o.text)}_fireUnderlineEvent(c,o){const h=c.range,m=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-m-1,h.end.x,h.end.y-m-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(c,o,h){var m;(m=this._currentLink)!=null&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(h,o.text)}_linkAtPosition(c,o){const h=c.range.start.y*this._bufferService.cols+c.range.start.x,m=c.range.end.y*this._bufferService.cols+c.range.end.x,x=o.y*this._bufferService.cols+o.x;return h<=x&&x<=m}_positionFromMouseEvent(c,o,h){const m=h.getCoords(c,o,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,o,h,m,x){return{x1:c,y1:o,x2:h,y2:m,cols:this._bufferService.cols,fg:x}}};s.Linkifier=n=d([v(1,f.IMouseService),v(2,f.IRenderService),v(3,w.IBufferService),v(4,f.ILinkProviderService)],n)},9042:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(H,s,u){var d=this&&this.__decorate||function(f,n,c,o){var h,m=arguments.length,x=m<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,c,o);else for(var y=f.length-1;y>=0;y--)(h=f[y])&&(x=(m<3?h(x):m>3?h(n,c,x):h(n,c))||x);return m>3&&x&&Object.defineProperty(n,c,x),x},v=this&&this.__param||function(f,n){return function(c,o){n(c,o,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const a=u(511),p=u(2585);let S=s.OscLinkProvider=class{constructor(f,n,c){this._bufferService=f,this._optionsService=n,this._oscLinkService=c}provideLinks(f,n){var R;const c=this._bufferService.buffer.lines.get(f-1);if(!c)return void n(void 0);const o=[],h=this._optionsService.rawOptions.linkHandler,m=new a.CellData,x=c.getTrimmedLength();let y=-1,E=-1,b=!1;for(let T=0;T<x;T++)if(E!==-1||c.hasContent(T)){if(c.loadCell(T,m),m.hasExtendedAttrs()&&m.extended.urlId){if(E===-1){E=T,y=m.extended.urlId;continue}b=m.extended.urlId!==y}else E!==-1&&(b=!0);if(b||E!==-1&&T===x-1){const I=(R=this._oscLinkService.getLinkData(y))==null?void 0:R.uri;if(I){const M={start:{x:E+1,y:f},end:{x:T+(b||T!==x-1?0:1),y:f}};let k=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const U=new URL(I);["http:","https:"].includes(U.protocol)||(k=!0)}catch{k=!0}k||o.push({text:I,range:M,activate:(U,K)=>h?h.activate(U,K,M):w(0,K),hover:(U,K)=>{var W;return(W=h==null?void 0:h.hover)==null?void 0:W.call(h,U,K,M)},leave:(U,K)=>{var W;return(W=h==null?void 0:h.leave)==null?void 0:W.call(h,U,K,M)}})}b=!1,m.hasExtendedAttrs()&&m.extended.urlId?(E=T,y=m.extended.urlId):(E=-1,y=-1)}}n(o)}};function w(f,n){if(confirm(`Do you want to navigate to ${n}?
|
|
77
|
+
|
|
78
|
+
WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=S=d([v(0,p.IBufferService),v(1,p.IOptionsService),v(2,p.IOscLinkService)],S)},6193:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,v){this._rowCount=v,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const d=u(3614),v=u(3656),a=u(3551),p=u(9042),S=u(3730),w=u(1680),f=u(3107),n=u(5744),c=u(2950),o=u(1296),h=u(428),m=u(4269),x=u(5114),y=u(8934),E=u(3230),b=u(9312),R=u(4725),T=u(6731),I=u(8055),M=u(8969),k=u(8460),U=u(844),K=u(6114),W=u(8437),$=u(2584),V=u(7399),O=u(5941),q=u(9074),B=u(2585),j=u(5435),Q=u(4567),J=u(779);class ue extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new k.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new k.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new k.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new k.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new k.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new k.EventEmitter),this._onBlur=this.register(new k.EventEmitter),this._onA11yCharEmitter=this.register(new k.EventEmitter),this._onA11yTabEmitter=this.register(new k.EventEmitter),this._onWillOpen=this.register(new k.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(q.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,ae)=>this.refresh(F,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),this.register((0,k.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,k.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((F=>this._afterResize(F.cols,F.rows)))),this.register((0,U.toDisposable)((()=>{var F,ae;this._customKeyEventHandler=void 0,(ae=(F=this.element)==null?void 0:F.parentNode)==null||ae.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const F of X){let ae,ie="";switch(F.index){case 256:ae="foreground",ie="10";break;case 257:ae="background",ie="11";break;case 258:ae="cursor",ie="12";break;default:ae="ansi",ie="4;"+F.index}switch(F.type){case 0:const _e=I.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${ie};${(0,O.toRgbString)(_e)}${$.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((fe=>fe.ansi[F.index]=I.channels.toColor(...F.color)));else{const fe=ae;this._themeService.modifyColors((ye=>ye[fe]=I.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(X);if(!F)return;const ae=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,_e=F.getWidth(ae),fe=this._renderService.dimensions.css.cell.width*_e,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,ge=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ge+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(F=>{this.hasSelection()&&(0,d.copyHandler)(F,this._selectionService)})));const X=F=>(0,d.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,v.addDisposableDomListener)(this.element,"paste",X)),K.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,d.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ae;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ae=this.element)==null?void 0:ae.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,v.addDisposableDomListener)(this.screenElement,"mousemove",(ie=>this.updateCursorStyle(ie)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ie=>this._handleTextAreaFocus(ie)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ie=>this._onRender.fire(ie)))),this.onResize((ie=>this._renderService.resize(ie.cols,ie.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(F);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ie=>this._renderService.handleSelectionChanged(ie.start,ie.end,ie.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ie=>{this.textarea.value=ie,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ie=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ie=>this._selectionService.handleMouseDown(ie)))),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",(ie=>this._handleScreenReaderModeOptionChange(ie)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ie=>{!this._overviewRulerRenderer&&ie&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.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,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,F=this.element;function ae(fe){const ye=X._mouseService.getMouseReportCoords(fe,X.screenElement);if(!ye)return!1;let ge,Te;switch(fe.overrideType||fe.type){case"mousemove":Te=32,fe.buttons===void 0?(ge=3,fe.button!==void 0&&(ge=fe.button<3?fe.button:3)):ge=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Te=0,ge=fe.button<3?fe.button:3;break;case"mousedown":Te=1,ge=fe.button<3?fe.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(fe)===!1||X.viewport.getLinesScrolled(fe)===0)return!1;Te=fe.deltaY<0?0:1,ge=4;break;default:return!1}return!(Te===void 0||ge===void 0||ge>4)&&X.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:ge,action:Te,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(ae(fe),fe.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(fe)),wheel:fe=>(ae(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ae(fe)},mousemove:fe=>{fe.buttons||ae(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&fe?ie.mousemove||(F.addEventListener("mousemove",_e.mousemove),ie.mousemove=_e.mousemove):(F.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&fe?ie.wheel||(F.addEventListener("wheel",_e.wheel,{passive:!1}),ie.wheel=_e.wheel):(F.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&fe?ie.mouseup||(ie.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&fe?ie.mousedrag||(ie.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(F,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ae(fe),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(fe)}))),this.register((0,v.addDisposableDomListener)(F,"wheel",(fe=>{if(!ie.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(fe);if(ye===0)return;const ge=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Te="";for(let Pe=0;Pe<Math.abs(ye);Pe++)Te+=ge;return this.coreService.triggerDataEvent(Te,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(F,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(F,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(X,F){var ae;(ae=this._renderService)==null||ae.refreshRows(X,F)}updateCursorStyle(X){var F;(F=this._selectionService)!=null&&F.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,F,ae=0){var ie;ae===1?(super.scrollLines(X,F,ae),this.refresh(0,this.rows-1)):(ie=this.viewport)==null||ie.scrollLines(X)}paste(X){(0,d.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,F,ae){this._selectionService.setSelection(X,F,ae)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,F){var ae;(ae=this._selectionService)==null||ae.selectLines(X,F)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!F&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,V.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ae.type===3||ae.type===2){const ie=this.rows-1;return this.scrollLines(ae.type===2?-ie:ie),this.cancel(X,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ae.cancel&&this.cancel(X,!0),!ae.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==$.C0.ETX&&ae.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,F){const ae=X.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||X.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||X.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?ae:ae&&(!F.keyCode||F.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)F=X.charCode;else if(X.which===null||X.which===void 0)F=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;F=X.which}return!(!F||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=X.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(X),!0}return!1}resize(X,F){X!==this.cols||F!==this.rows?super.resize(X,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,F){var ae,ie;(ae=this._charSizeService)==null||ae.measure(),(ie=this.viewport)==null||ie.syncScrollArea(!0)}clear(){var X;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let F=1;F<this.rows;F++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var F,ae;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(F=this._selectionService)==null||F.reset(),this._decorationService.reset(),(ae=this.viewport)==null||ae.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${ae};${F}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${_e};${ie}t`)}}cancel(X,F){if(this.options.cancelEvents||F)return X.preventDefault(),X.stopPropagation(),!1}}s.Terminal=ue},9924:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,v){this._rowCount=v,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=a-this._lastRefreshMs,S=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(H,s,u){var d=this&&this.__decorate||function(c,o,h,m){var x,y=arguments.length,E=y<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(c,o,h,m);else for(var b=c.length-1;b>=0;b--)(x=c[b])&&(E=(y<3?x(E):y>3?x(o,h,E):x(o,h))||E);return y>3&&E&&Object.defineProperty(o,h,E),E},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const a=u(3656),p=u(4725),S=u(8460),w=u(844),f=u(2585);let n=s.Viewport=class extends w.Disposable{constructor(c,o,h,m,x,y,E,b){super(),this._viewportElement=c,this._scrollArea=o,this._bufferService=h,this._optionsService=m,this._charSizeService=x,this._renderService=y,this._coreBrowserService=E,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,o){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&h<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const o=this._getPixelsScrolled(c);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(c,o))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=c*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:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(c,o){var b;let h,m="";const x=[],y=o??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let R=c;R<y;R++){const T=E.get(R);if(!T)continue;const I=(b=E.get(R+1))==null?void 0:b.isWrapped;if(m+=T.translateToString(!I),!I||R===E.length-1){const M=document.createElement("div");M.textContent=m,x.push(M),m.length>0&&(h=M),m=""}}return{bufferElements:x,cursorElement:h}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.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):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(c,o){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&o.altKey||h==="ctrl"&&o.ctrlKey||h==="shift"&&o.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const o=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}};s.Viewport=n=d([v(2,f.IBufferService),v(3,f.IOptionsService),v(4,p.ICharSizeService),v(5,p.IRenderService),v(6,p.ICoreBrowserService),v(7,p.IThemeService)],n)},3107:function(H,s,u){var d=this&&this.__decorate||function(f,n,c,o){var h,m=arguments.length,x=m<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,c,o);else for(var y=f.length-1;y>=0;y--)(h=f[y])&&(x=(m<3?h(x):m>3?h(n,c,x):h(n,c))||x);return m>3&&x&&Object.defineProperty(n,c,x),x},v=this&&this.__param||function(f,n){return function(c,o){n(c,o,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const a=u(4725),p=u(844),S=u(2585);let w=s.BufferDecorationRenderer=class extends p.Disposable{constructor(f,n,c,o,h){super(),this._screenElement=f,this._bufferService=n,this._coreBrowserService=c,this._decorationService=o,this._renderService=h,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((m=>this._removeDecoration(m)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=f==null?void 0:f.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=f.options.x??0;return c&&c>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(f,n),n}_refreshStyle(f){const n=f.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let c=this._decorationElements.get(f);c||(c=this._createElement(f),f.element=c,this._decorationElements.set(f,c),this._container.appendChild(c),f.onDispose((()=>{this._decorationElements.delete(f),c.remove()}))),c.style.top=n*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(c)}}_refreshXPosition(f,n=f.element){if(!n)return;const c=f.options.x??0;(f.options.anchor||"left")==="right"?n.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var n;(n=this._decorationElements.get(f))==null||n.remove(),this._decorationElements.delete(f),f.dispose()}};s.BufferDecorationRenderer=w=d([v(1,S.IBufferService),v(2,a.ICoreBrowserService),v(3,S.IDecorationService),v(4,a.IRenderService)],w)},5871:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,v){return d>=u.startBufferLine-this._linePadding[v||"full"]&&d<=u.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(H,s,u){var d=this&&this.__decorate||function(h,m,x,y){var E,b=arguments.length,R=b<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(h,m,x,y);else for(var T=h.length-1;T>=0;T--)(E=h[T])&&(R=(b<3?E(R):b>3?E(m,x,R):E(m,x))||R);return b>3&&R&&Object.defineProperty(m,x,R),R},v=this&&this.__param||function(h,m){return function(x,y){m(x,y,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const a=u(5871),p=u(4725),S=u(844),w=u(2585),f={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let o=s.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,m,x,y,E,b,R){var I;super(),this._viewportElement=h,this._screenElement=m,this._bufferService=x,this._decorationService=y,this._renderService=E,this._optionsService=b,this._coreBrowserService=R,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var M;(M=this._canvas)==null||M.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),m=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=h,n.center=m,n.right=h,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=n.left,c.right=n.left+n.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,m=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);f.left=m,f.center=m,f.right=m}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const m of this._decorationService.decorations)this._colorZoneStore.addDecoration(m);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const m of h)m.position!=="full"&&this._renderColorZone(m);for(const m of h)m.position==="full"&&this._renderColorZone(m);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(c[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-f[h.position||"full"]/2),n[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[h.position||"full"]))}_queueRefresh(h,m){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=m||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=o=d([v(2,w.IBufferService),v(3,w.IDecorationService),v(4,p.IRenderService),v(5,w.IOptionsService),v(6,p.ICoreBrowserService)],o)},2950:function(H,s,u){var d=this&&this.__decorate||function(f,n,c,o){var h,m=arguments.length,x=m<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,c,o);else for(var y=f.length-1;y>=0;y--)(h=f[y])&&(x=(m<3?h(x):m>3?h(n,c,x):h(n,c))||x);return m>3&&x&&Object.defineProperty(n,c,x),x},v=this&&this.__param||function(f,n){return function(c,o){n(c,o,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const a=u(4725),p=u(2585),S=u(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,n,c,o,h,m){this._textarea=f,this._compositionView=n,this._bufferService=c,this._optionsService=o,this._coreService=h,this._renderService=m,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,c=n.replace(f,"");this._dataAlreadySent=c,n.length>f.length?this._coreService.triggerDataEvent(c,!0):n.length<f.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):n.length===f.length&&n!==f&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const m=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}f||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=d([v(2,p.IBufferService),v(3,p.IOptionsService),v(4,p.ICoreService),v(5,a.IRenderService)],w)},9806:(H,s)=>{function u(d,v,a){const p=a.getBoundingClientRect(),S=d.getComputedStyle(a),w=parseInt(S.getPropertyValue("padding-left")),f=parseInt(S.getPropertyValue("padding-top"));return[v.clientX-p.left-w,v.clientY-p.top-f]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=u,s.getCoords=function(d,v,a,p,S,w,f,n,c){if(!w)return;const o=u(d,v,a);return o?(o[0]=Math.ceil((o[0]+(c?f/2:0))/f),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),p+(c?1:0)),o[1]=Math.min(Math.max(o[1],1),S),o):void 0}},9504:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const d=u(2584);function v(n,c,o,h){const m=n-a(n,o),x=c-a(c,o),y=Math.abs(m-x)-(function(E,b,R){let T=0;const I=E-a(E,R),M=b-a(b,R);for(let k=0;k<Math.abs(I-M);k++){const U=p(E,b)==="A"?-1:1,K=R.buffer.lines.get(I+U*k);K!=null&&K.isWrapped&&T++}return T})(n,c,o);return f(y,w(p(n,c),h))}function a(n,c){let o=0,h=c.buffer.lines.get(n),m=h==null?void 0:h.isWrapped;for(;m&&n>=0&&n<c.rows;)o++,h=c.buffer.lines.get(--n),m=h==null?void 0:h.isWrapped;return o}function p(n,c){return n>c?"A":"B"}function S(n,c,o,h,m,x){let y=n,E=c,b="";for(;y!==o||E!==h;)y+=m?1:-1,m&&y>x.cols-1?(b+=x.buffer.translateBufferLineToString(E,!1,n,y),y=0,n=0,E++):!m&&y<0&&(b+=x.buffer.translateBufferLineToString(E,!1,0,n+1),y=x.cols-1,n=y,E--);return b+x.buffer.translateBufferLineToString(E,!1,n,y)}function w(n,c){const o=c?"O":"[";return d.C0.ESC+o+n}function f(n,c){n=Math.floor(n);let o="";for(let h=0;h<n;h++)o+=c;return o}s.moveToCellSequence=function(n,c,o,h){const m=o.buffer.x,x=o.buffer.y;if(!o.buffer.hasScrollback)return(function(b,R,T,I,M,k){return v(R,I,M,k).length===0?"":f(S(b,R,b,R-a(R,M),!1,M).length,w("D",k))})(m,x,0,c,o,h)+v(x,c,o,h)+(function(b,R,T,I,M,k){let U;U=v(R,I,M,k).length>0?I-a(I,M):R;const K=I,W=(function($,V,O,q,B,j){let Q;return Q=v(O,q,B,j).length>0?q-a(q,B):V,$<O&&Q<=q||$>=O&&Q<q?"C":"D"})(b,R,T,I,M,k);return f(S(b,U,T,K,W==="C",M).length,w(W,k))})(m,x,n,c,o,h);let y;if(x===c)return y=m>n?"D":"C",f(Math.abs(m-n),w(y,h));y=x>c?"D":"C";const E=Math.abs(x-c);return f((function(b,R){return R.cols-b})(x>c?n:m,o)+(E-1)*o.cols+1+((x>c?m:n)-1),w(y,h))}},1296:function(H,s,u){var d=this&&this.__decorate||function(k,U,K,W){var $,V=arguments.length,O=V<3?U:W===null?W=Object.getOwnPropertyDescriptor(U,K):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,U,K,W);else for(var q=k.length-1;q>=0;q--)($=k[q])&&(O=(V<3?$(O):V>3?$(U,K,O):$(U,K))||O);return V>3&&O&&Object.defineProperty(U,K,O),O},v=this&&this.__param||function(k,U){return function(K,W){U(K,W,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const a=u(3787),p=u(2550),S=u(2223),w=u(6171),f=u(6052),n=u(4725),c=u(8055),o=u(8460),h=u(844),m=u(2585),x="xterm-dom-renderer-owner-",y="xterm-rows",E="xterm-fg-",b="xterm-bg-",R="xterm-focus",T="xterm-selection";let I=1,M=s.DomRenderer=class extends h.Disposable{constructor(k,U,K,W,$,V,O,q,B,j,Q,J,ue){super(),this._terminal=k,this._document=U,this._element=K,this._screenElement=W,this._viewportElement=$,this._helperContainer=V,this._linkifier2=O,this._charSizeService=B,this._optionsService=j,this._bufferService=Q,this._coreBrowserService=J,this._themeService=ue,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=q.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const k=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*k,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*k),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/k),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/k),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 K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,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(k){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${y} { color: ${k.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${y} .xterm-dim { color: ${c.color.multiplyOpacity(k.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;U+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${W} { 50% { box-shadow: none; }}`,U+=`@keyframes ${$} { 0% { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css}; } 50% { background-color: inherit; color: ${k.cursor.css}; }}`,U+=`${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${k.cursor.css} !important; color: ${k.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${k.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${k.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${k.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${k.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${k.selectionInactiveBackgroundOpaque.css};}`;for(const[V,O]of k.ansi.entries())U+=`${this._terminalSelector} .${E}${V} { color: ${O.css}; }${this._terminalSelector} .${E}${V}.xterm-dim { color: ${c.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${b}${V} { background-color: ${O.css}; }`;U+=`${this._terminalSelector} .${E}${S.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(k.background).css}; }${this._terminalSelector} .${E}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(k.background),.5).css}; }${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR} { background-color: ${k.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const k=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${k}px`,this._rowFactory.defaultSpacing=k}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(k,U){for(let K=this._rowElements.length;K<=U;K++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(k,U){this._refreshRowElements(k,U),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(k,U,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(k,U,K),this.renderRows(0,this._bufferService.rows-1),!k||!U)return;this._selectionRenderModel.update(this._terminal,k,U,K);const W=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,O=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||O<0)return;const q=this._document.createDocumentFragment();if(K){const B=k[0]>U[0];q.appendChild(this._createSelectionElement(V,B?U[0]:k[0],B?k[0]:U[0],O-V+1))}else{const B=W===V?k[0]:0,j=V===$?U[0]:this._bufferService.cols;q.appendChild(this._createSelectionElement(V,B,j));const Q=O-V-1;if(q.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,Q)),V!==O){const J=$===O?U[0]:this._bufferService.cols;q.appendChild(this._createSelectionElement(O,0,J))}}this._selectionContainer.appendChild(q)}_createSelectionElement(k,U,K,W=1){const $=this._document.createElement("div"),V=U*this.dimensions.css.cell.width;let O=this.dimensions.css.cell.width*(K-U);return V+O>this.dimensions.css.canvas.width&&(O=this.dimensions.css.canvas.width-V),$.style.height=W*this.dimensions.css.cell.height+"px",$.style.top=k*this.dimensions.css.cell.height+"px",$.style.left=`${V}px`,$.style.width=`${O}px`,$}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 k of this._rowElements)k.replaceChildren()}renderRows(k,U){const K=this._bufferService.buffer,W=K.ybase+K.y,$=Math.min(K.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,O=this._optionsService.rawOptions.cursorStyle,q=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=k;B<=U;B++){const j=B+K.ydisp,Q=this._rowElements[B],J=K.lines.get(j);if(!Q||!J)break;Q.replaceChildren(...this._rowFactory.createRow(J,j,j===W,O,q,$,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)}_handleLinkLeave(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)}_setCellUnderline(k,U,K,W,$,V){K<0&&(k=0),W<0&&(U=0);const O=this._bufferService.rows-1;K=Math.max(Math.min(K,O),0),W=Math.max(Math.min(W,O),0),$=Math.min($,this._bufferService.cols);const q=this._bufferService.buffer,B=q.ybase+q.y,j=Math.min(q.x,$-1),Q=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=K;he<=W;++he){const X=he+q.ydisp,F=this._rowElements[he],ae=q.lines.get(X);if(!F||!ae)break;F.replaceChildren(...this._rowFactory.createRow(ae,X,X===B,J,ue,j,Q,this.dimensions.css.cell.width,this._widthCache,V?he===K?k:0:-1,V?(he===W?U:$)-1:-1))}}};s.DomRenderer=M=d([v(7,m.IInstantiationService),v(8,n.ICharSizeService),v(9,m.IOptionsService),v(10,m.IBufferService),v(11,n.ICoreBrowserService),v(12,n.IThemeService)],M)},3787:function(H,s,u){var d=this&&this.__decorate||function(y,E,b,R){var T,I=arguments.length,M=I<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,E,b,R);else for(var k=y.length-1;k>=0;k--)(T=y[k])&&(M=(I<3?T(M):I>3?T(E,b,M):T(E,b))||M);return I>3&&M&&Object.defineProperty(E,b,M),M},v=this&&this.__param||function(y,E){return function(b,R){E(b,R,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const a=u(2223),p=u(643),S=u(511),w=u(2585),f=u(8055),n=u(4725),c=u(4269),o=u(6171),h=u(3734);let m=s.DomRendererRowFactory=class{constructor(y,E,b,R,T,I,M){this._document=y,this._characterJoinerService=E,this._optionsService=b,this._coreBrowserService=R,this._coreService=T,this._decorationService=I,this._themeService=M,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,E,b){this._selectionStart=y,this._selectionEnd=E,this._columnSelectMode=b}createRow(y,E,b,R,T,I,M,k,U,K,W){const $=[],V=this._characterJoinerService.getJoinedCharacters(E),O=this._themeService.colors;let q,B=y.getNoBgTrimmedLength();b&&B<I+1&&(B=I+1);let j=0,Q="",J=0,ue=0,he=0,X=!1,F=0,ae=!1,ie=0;const _e=[],fe=K!==-1&&W!==-1;for(let ye=0;ye<B;ye++){y.loadCell(ye,this._workCell);let ge=this._workCell.getWidth();if(ge===0)continue;let Te=!1,Pe=ye,Se=this._workCell;if(V.length>0&&ye===V[0][0]){Te=!0;const De=V.shift();Se=new c.JoinedCellData(this._workCell,y.translateToString(!0,De[0],De[1]),De[1]-De[0]),Pe=De[1]-1,ge=Se.getWidth()}const Ot=this._isCellInSelection(ye,E),zt=b&&ye===I,xe=fe&&ye>=K&&ye<=W;let Ee=!1;this._decorationService.forEachDecorationAtCell(ye,E,void 0,(De=>{Ee=!0}));let Ae=Se.getChars()||p.WHITESPACE_CELL_CHAR;if(Ae===" "&&(Se.isUnderline()||Se.isOverline())&&(Ae=" "),ie=ge*k-U.get(Ae,Se.isBold(),Se.isItalic()),q){if(j&&(Ot&&ae||!Ot&&!ae&&Se.bg===J)&&(Ot&&ae&&O.selectionForeground||Se.fg===ue)&&Se.extended.ext===he&&xe===X&&ie===F&&!zt&&!Te&&!Ee){Se.isInvisible()?Q+=p.WHITESPACE_CELL_CHAR:Q+=Ae,j++;continue}j&&(q.textContent=Q),q=this._document.createElement("span"),j=0,Q=""}else q=this._document.createElement("span");if(J=Se.bg,ue=Se.fg,he=Se.extended.ext,X=xe,F=ie,ae=Ot,Te&&I>=ye&&I<=Pe&&(I=ye),!this._coreService.isCursorHidden&&zt&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&_e.push("xterm-cursor-blink"),_e.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Se.isBold()&&_e.push("xterm-bold"),Se.isItalic()&&_e.push("xterm-italic"),Se.isDim()&&_e.push("xterm-dim"),Q=Se.isInvisible()?p.WHITESPACE_CELL_CHAR:Se.getChars()||p.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(_e.push(`xterm-underline-${Se.extended.underlineStyle}`),Q===" "&&(Q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())q.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let De=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&De<8&&(De+=8),q.style.textDecorationColor=O.ansi[De].css}Se.isOverline()&&(_e.push("xterm-overline"),Q===" "&&(Q=" ")),Se.isStrikethrough()&&_e.push("xterm-strikethrough"),xe&&(q.style.textDecoration="underline");let ve=Se.getFgColor(),we=Se.getFgColorMode(),Ke=Se.getBgColor(),qe=Se.getBgColorMode();const vt=!!Se.isInverse();if(vt){const De=ve;ve=Ke,Ke=De;const Yt=we;we=qe,qe=Yt}let Qe,ct,Ze,Oe=!1;switch(this._decorationService.forEachDecorationAtCell(ye,E,void 0,(De=>{De.options.layer!=="top"&&Oe||(De.backgroundColorRGB&&(qe=50331648,Ke=De.backgroundColorRGB.rgba>>8&16777215,Qe=De.backgroundColorRGB),De.foregroundColorRGB&&(we=50331648,ve=De.foregroundColorRGB.rgba>>8&16777215,ct=De.foregroundColorRGB),Oe=De.options.layer==="top")})),!Oe&&Ot&&(Qe=this._coreBrowserService.isFocused?O.selectionBackgroundOpaque:O.selectionInactiveBackgroundOpaque,Ke=Qe.rgba>>8&16777215,qe=50331648,Oe=!0,O.selectionForeground&&(we=50331648,ve=O.selectionForeground.rgba>>8&16777215,ct=O.selectionForeground)),Oe&&_e.push("xterm-decoration-top"),qe){case 16777216:case 33554432:Ze=O.ansi[Ke],_e.push(`xterm-bg-${Ke}`);break;case 50331648:Ze=f.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle(q,`background-color:#${x((Ke>>>0).toString(16),"0",6)}`);break;default:vt?(Ze=O.foreground,_e.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ze=O.background}switch(Qe||Se.isDim()&&(Qe=f.color.multiplyOpacity(Ze,.5)),we){case 16777216:case 33554432:Se.isBold()&&ve<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ve+=8),this._applyMinimumContrast(q,Ze,O.ansi[ve],Se,Qe,void 0)||_e.push(`xterm-fg-${ve}`);break;case 50331648:const De=f.channels.toColor(ve>>16&255,ve>>8&255,255&ve);this._applyMinimumContrast(q,Ze,De,Se,Qe,ct)||this._addStyle(q,`color:#${x(ve.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(q,Ze,O.foreground,Se,Qe,ct)||vt&&_e.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}_e.length&&(q.className=_e.join(" "),_e.length=0),zt||Te||Ee?q.textContent=Q:j++,ie!==this.defaultSpacing&&(q.style.letterSpacing=`${ie}px`),$.push(q),ye=Pe}return q&&j&&(q.textContent=Q),$}_applyMinimumContrast(y,E,b,R,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const M=this._getContrastCache(R);let k;if(T||I||(k=M.getColor(E.rgba,b.rgba)),k===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);k=f.color.ensureContrastRatio(T||E,I||b,U),M.setColor((T||E).rgba,(I||b).rgba,k??null)}return!!k&&(this._addStyle(y,`color:${k.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,E){y.setAttribute("style",`${y.getAttribute("style")||""}${E};`)}_isCellInSelection(y,E){const b=this._selectionStart,R=this._selectionEnd;return!(!b||!R)&&(this._columnSelectMode?b[0]<=R[0]?y>=b[0]&&E>=b[1]&&y<R[0]&&E<=R[1]:y<b[0]&&E>=b[1]&&y>=R[0]&&E<=R[1]:E>b[1]&&E<R[1]||b[1]===R[1]&&E===b[1]&&y>=b[0]&&y<R[0]||b[1]<R[1]&&E===R[1]&&y<R[0]||b[1]<R[1]&&E===b[1]&&y>=b[0])}};function x(y,E,b){for(;y.length<b;)y=E+y;return y}s.DomRendererRowFactory=m=d([v(1,n.ICharacterJoinerService),v(2,w.IOptionsService),v(3,n.ICoreBrowserService),v(4,w.ICoreService),v(5,w.IDecorationService),v(6,n.IThemeService)],m)},2550:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=u.createElement("span");v.classList.add("xterm-char-measure-element");const a=u.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[v,a,p,S],this._container.appendChild(v),this._container.appendChild(a),this._container.appendChild(p),this._container.appendChild(S),d.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,d,v,a){u===this._font&&d===this._fontSize&&v===this._weight&&a===this._weightBold||(this._font=u,this._fontSize=d,this._weight=v,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(u,d,v){let a=0;if(!d&&!v&&u.length===1&&(a=u.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const w=this._measure(u,0);return w>0&&(this._flat[a]=w),w}let p=u;d&&(p+="B"),v&&(p+="I");let S=this._holey.get(p);if(S===void 0){let w=0;d&&(w|=1),v&&(w|=2),S=this._measure(u,w),S>0&&this._holey.set(p,S)}return S}_measure(u,d){const v=this._measureElements[d];return v.textContent=u.repeat(32),v.offsetWidth/32}}},2223:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(H,s)=>{function u(v){return 57508<=v&&v<=57558}function d(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},s.isPowerlineGlyph=u,s.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},s.isEmoji=d,s.allowRescaling=function(v,a,p,S){return a===1&&p>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!d(v)&&!u(v)&&!(function(w){return 57344<=w&&w<=63743})(v)},s.treatGlyphAsBackgroundColor=function(v){return u(v)||(function(a){return 9472<=a&&a<=9631})(v)},s.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}}}},s.computeNextVariantOffset=function(v,a,p=0){return(v-(2*Math.round(a)-p))%(2*Math.round(a))}},6052:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,a,p,S=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const w=v.buffers.active.ydisp,f=a[1]-w,n=p[1]-w,c=Math.max(f,0),o=Math.min(n,v.rows-1);c>=v.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=n,this.viewportCappedStartRow=c,this.viewportCappedEndRow=o,this.startCol=a[0],this.endCol=p[0])}isCellSelected(v,a,p){return!!this.hasSelection&&(p-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}s.createSelectionRenderModel=function(){return new u}},456:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(H,s,u){var d=this&&this.__decorate||function(o,h,m,x){var y,E=arguments.length,b=E<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,h,m,x);else for(var R=o.length-1;R>=0;R--)(y=o[R])&&(b=(E<3?y(b):E>3?y(h,m,b):y(h,m))||b);return E>3&&b&&Object.defineProperty(h,m,b),b},v=this&&this.__param||function(o,h){return function(m,x){h(m,x,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const a=u(2585),p=u(8460),S=u(844);let w=s.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,h,m){super(),this._optionsService=m,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=d([v(2,a.IOptionsService)],w);class f extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,m){h!==void 0&&h>0&&m!==void 0&&m>0&&(this._result.width=h,this._result.height=m)}}class n extends f{constructor(h,m,x){super(),this._document=h,this._parentElement=m,this._optionsService=x,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class c extends f{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const m=this._ctx.measureText("W");if(!("width"in m&&"fontBoundingBoxAscent"in m&&"fontBoundingBoxDescent"in m))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(H,s,u){var d=this&&this.__decorate||function(c,o,h,m){var x,y=arguments.length,E=y<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(c,o,h,m);else for(var b=c.length-1;b>=0;b--)(x=c[b])&&(E=(y<3?x(E):y>3?x(o,h,E):x(o,h))||E);return y>3&&E&&Object.defineProperty(o,h,E),E},v=this&&this.__param||function(c,o){return function(h,m){o(h,m,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const a=u(3734),p=u(643),S=u(511),w=u(2585);class f extends a.AttributeData{constructor(o,h,m){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=h,this._width=m}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()]}}s.JoinedCellData=f;let n=s.CharacterJoinerService=class fv{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(o){const h={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(h),h.id}deregister(o){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===o)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(o);if(!h||h.length===0)return[];const m=[],x=h.translateToString(!0);let y=0,E=0,b=0,R=h.getFg(0),T=h.getBg(0);for(let I=0;I<h.getTrimmedLength();I++)if(h.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==T){if(I-y>1){const M=this._getJoinedRanges(x,b,E,h,y);for(let k=0;k<M.length;k++)m.push(M[k])}y=I,b=E,R=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const I=this._getJoinedRanges(x,b,E,h,y);for(let M=0;M<I.length;M++)m.push(I[M])}return m}_getJoinedRanges(o,h,m,x,y){const E=o.substring(h,m);let b=[];try{b=this._characterJoiners[0].handler(E)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const T=this._characterJoiners[R].handler(E);for(let I=0;I<T.length;I++)fv._mergeRanges(b,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(b,x,y),b}_stringRangesToCellRanges(o,h,m){let x=0,y=!1,E=0,b=o[x];if(b){for(let R=m;R<this._bufferService.cols;R++){const T=h.getWidth(R),I=h.getString(R).length||p.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&b[0]<=E&&(b[0]=R,y=!0),b[1]<=E){if(b[1]=R,b=o[++x],!b)break;b[0]<=E?(b[0]=R,y=!0):y=!1}E+=I}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(o,h){let m=!1;for(let x=0;x<o.length;x++){const y=o[x];if(m){if(h[1]<=y[0])return o[x-1][1]=h[1],o;if(h[1]<=y[1])return o[x-1][1]=Math.max(h[1],y[1]),o.splice(x,1),o;o.splice(x,1),x--}else{if(h[1]<=y[0])return o.splice(x,0,h),o;if(h[1]<=y[1])return y[0]=Math.min(h[0],y[0]),o;h[0]<y[1]&&(y[0]=Math.min(h[0],y[0]),m=!0)}}return m?o[o.length-1][1]=h[1]:o.push(h),o}};s.CharacterJoinerService=n=d([v(0,w.IBufferService)],n)},5114:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const d=u(844),v=u(8460),a=u(3656);class p extends d.Disposable{constructor(f,n,c){super(),this._textarea=f,this._window=n,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((o=>this._screenDprMonitor.setWindow(o)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(f){this._window!==f&&(this._window=f,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=p;class S extends d.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const d=u(844);class v extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const S=this.linkProviders.indexOf(p);S!==-1&&this.linkProviders.splice(S,1)}}}}s.LinkProviderService=v},8934:function(H,s,u){var d=this&&this.__decorate||function(w,f,n,c){var o,h=arguments.length,m=h<3?f:c===null?c=Object.getOwnPropertyDescriptor(f,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(w,f,n,c);else for(var x=w.length-1;x>=0;x--)(o=w[x])&&(m=(h<3?o(m):h>3?o(f,n,m):o(f,n))||m);return h>3&&m&&Object.defineProperty(f,n,m),m},v=this&&this.__param||function(w,f){return function(n,c){f(n,c,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const a=u(4725),p=u(9806);let S=s.MouseService=class{constructor(w,f){this._renderService=w,this._charSizeService=f}getCoords(w,f,n,c,o){return(0,p.getCoords)(window,w,f,n,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(w,f){const n=(0,p.getCoordsRelativeToElement)(window,w,f);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};s.MouseService=S=d([v(0,a.IRenderService),v(1,a.ICharSizeService)],S)},3230:function(H,s,u){var d=this&&this.__decorate||function(o,h,m,x){var y,E=arguments.length,b=E<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,h,m,x);else for(var R=o.length-1;R>=0;R--)(y=o[R])&&(b=(E<3?y(b):E>3?y(h,m,b):y(h,m))||b);return E>3&&b&&Object.defineProperty(h,m,b),b},v=this&&this.__param||function(o,h){return function(m,x){h(m,x,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const a=u(6193),p=u(4725),S=u(8460),w=u(844),f=u(7226),n=u(2585);let c=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,h,m,x,y,E,b,R){super(),this._rowCount=o,this._charSizeService=x,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new 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 a.RenderDebouncer(((T,I)=>this._renderRows(T,I)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(m.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(m.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(m.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,h),this.register(b.onWindowChange((T=>this._registerIntersectionObserver(T,h))))}_registerIntersectionObserver(o,h){if("IntersectionObserver"in o){const m=new o.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});m.observe(h),this._observerDisposable.value=(0,w.toDisposable)((()=>m.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,h,m=!1){this._isPaused?this._needsFullRefresh=!0:(m||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,h,this._rowCount))}_renderRows(o,h){this._renderer.value&&(o=Math.min(o,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(o,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:h}),this._onRender.fire({start:o,end:h}),this._isNextRenderRedrawOnly=!0)}resize(o,h){this._rowCount=h,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(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,h;this._renderer.value&&((h=(o=this._renderer.value).clearTextureAtlas)==null||h.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var m;return(m=this._renderer.value)==null?void 0:m.handleResize(o,h)})):this._renderer.value.handleResize(o,h),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,h,m){var x;this._selectionState.start=o,this._selectionState.end=h,this._selectionState.columnSelectMode=m,(x=this._renderer.value)==null||x.handleSelectionChanged(o,h,m)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};s.RenderService=c=d([v(2,n.IOptionsService),v(3,p.ICharSizeService),v(4,n.IDecorationService),v(5,n.IBufferService),v(6,p.ICoreBrowserService),v(7,p.IThemeService)],c)},9312:function(H,s,u){var d=this&&this.__decorate||function(b,R,T,I){var M,k=arguments.length,U=k<3?R:I===null?I=Object.getOwnPropertyDescriptor(R,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(b,R,T,I);else for(var K=b.length-1;K>=0;K--)(M=b[K])&&(U=(k<3?M(U):k>3?M(R,T,U):M(R,T))||U);return k>3&&U&&Object.defineProperty(R,T,U),U},v=this&&this.__param||function(b,R){return function(T,I){R(T,I,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const a=u(9806),p=u(9504),S=u(456),w=u(4725),f=u(8460),n=u(844),c=u(6114),o=u(4841),h=u(511),m=u(2585),x=" ",y=new RegExp(x,"g");let E=s.SelectionService=class extends n.Disposable{constructor(b,R,T,I,M,k,U,K,W){super(),this._element=b,this._screenElement=R,this._linkifier=T,this._bufferService=I,this._coreService=M,this._mouseService=k,this._optionsService=U,this._renderService=K,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 b=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!b||!R||b[0]===R[0]&&b[1]===R[1])}get selectionText(){const b=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!b||!R)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(b[0]===R[0])return"";const M=b[0]<R[0]?b[0]:R[0],k=b[0]<R[0]?R[0]:b[0];for(let U=b[1];U<=R[1];U++){const K=T.translateBufferLineToString(U,!0,M,k);I.push(K)}}else{const M=b[1]===R[1]?R[0]:void 0;I.push(T.translateBufferLineToString(b[1],!0,b[0],M));for(let k=b[1]+1;k<=R[1]-1;k++){const U=T.lines.get(k),K=T.translateBufferLineToString(k,!0);U!=null&&U.isWrapped?I[I.length-1]+=K:I.push(K)}if(b[1]!==R[1]){const k=T.lines.get(R[1]),U=T.translateBufferLineToString(R[1],!0,0,R[0]);k&&k.isWrapped?I[I.length-1]+=U:I.push(U)}}return I.map((M=>M.replace(y," "))).join(c.isWindows?`\r
|
|
79
|
+
`:`
|
|
80
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&b&&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(b){const R=this._getMouseBufferCoords(b),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&R)&&this._areCoordsInSelection(R,T,I)}isCellInSelection(b,R){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([b,R],T,I)}_areCoordsInSelection(b,R,T){return b[1]>R[1]&&b[1]<T[1]||R[1]===T[1]&&b[1]===R[1]&&b[0]>=R[0]&&b[0]<T[0]||R[1]<T[1]&&b[1]===T[1]&&b[0]<T[0]||R[1]<T[1]&&b[1]===R[1]&&b[0]>=R[0]}_selectWordAtCursor(b,R){var M,k;const T=(k=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:k.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(b);return!!I&&(this._selectWordAt(I,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,R){this._model.clearSelection(),b=Math.max(b,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const R=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(b){let R=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=T?0:(R>T&&(R-=T),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(b){return c.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const R=this._getMouseBufferCoords(b);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(b){return b.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const R=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const I=(0,p.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,T=!(!b||!R||b[0]===R[0]&&b[1]===R[1]);T?b&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,R,T)):this._oldHasSelection&&this._fireOnSelectionChange(b,R,T)}_fireOnSelectionChange(b,R,T){this._oldSelectionStart=b,this._oldSelectionEnd=R,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(b,R){let T=R;for(let I=0;R>=I;I++){const M=b.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:M>1&&R!==I&&(T+=M-1)}return T}setSelection(b,R,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,R],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,R,T=!0,I=!0){if(b[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,k=M.lines.get(b[1]);if(!k)return;const U=M.translateBufferLineToString(b[1],!1);let K=this._convertViewportColToCharacterIndex(k,b[0]),W=K;const $=b[0]-K;let V=0,O=0,q=0,B=0;if(U.charAt(K)===" "){for(;K>0&&U.charAt(K-1)===" ";)K--;for(;W<U.length&&U.charAt(W+1)===" ";)W++}else{let J=b[0],ue=b[0];k.getWidth(J)===0&&(V++,J--),k.getWidth(ue)===2&&(O++,ue++);const he=k.getString(ue).length;for(he>1&&(B+=he-1,W+=he-1);J>0&&K>0&&!this._isCharWordSeparator(k.loadCell(J-1,this._workCell));){k.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,J--):X>1&&(q+=X-1,K-=X-1),K--,J--}for(;ue<k.length&&W+1<U.length&&!this._isCharWordSeparator(k.loadCell(ue+1,this._workCell));){k.loadCell(ue+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(O++,ue++):X>1&&(B+=X-1,W+=X-1),W++,ue++}}W++;let j=K+$-V+q,Q=Math.min(this._bufferService.cols,W-K+V+O-q-B);if(R||U.slice(K,W).trim()!==""){if(T&&j===0&&k.getCodePoint(0)!==32){const J=M.lines.get(b[1]-1);if(J&&k.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(ue){const he=this._bufferService.cols-ue.start;j-=he,Q+=he}}}if(I&&j+Q===this._bufferService.cols&&k.getCodePoint(this._bufferService.cols-1)!==32){const J=M.lines.get(b[1]+1);if(J!=null&&J.isWrapped&&J.getCodePoint(0)!==32){const ue=this._getWordAt([0,b[1]+1],!1,!1,!0);ue&&(Q+=ue.length)}}return{start:j,length:Q}}}_selectWordAt(b,R){const T=this._getWordAt(b,R);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[T.start,b[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(b){const R=this._getWordAt(b,!0);if(R){let T=b[1];for(;R.start<0;)R.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,T]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const R=this._bufferService.buffer.getWrappedRangeForLine(b),T={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(T,this._bufferService.cols)}};s.SelectionService=E=d([v(3,m.IBufferService),v(4,m.ICoreService),v(5,w.IMouseService),v(6,m.IOptionsService),v(7,w.IRenderService),v(8,w.ICoreBrowserService)],E)},4725:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const d=u(8343);s.ICharSizeService=(0,d.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),s.IMouseService=(0,d.createDecorator)("MouseService"),s.IRenderService=(0,d.createDecorator)("RenderService"),s.ISelectionService=(0,d.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,d.createDecorator)("ThemeService"),s.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(H,s,u){var d=this&&this.__decorate||function(E,b,R,T){var I,M=arguments.length,k=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(E,b,R,T);else for(var U=E.length-1;U>=0;U--)(I=E[U])&&(k=(M<3?I(k):M>3?I(b,R,k):I(b,R))||k);return M>3&&k&&Object.defineProperty(b,R,k),k},v=this&&this.__param||function(E,b){return function(R,T){b(R,T,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const a=u(7239),p=u(8055),S=u(8460),w=u(844),f=u(2585),n=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),o=p.css.toColor("#ffffff"),h=p.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let R=0;R<216;R++){const T=b[R/36%6|0],I=b[R/6%6|0],M=b[R%6];E.push({css:p.channels.toCss(T,I,M),rgba:p.channels.toRgba(T,I,M)})}for(let R=0;R<24;R++){const T=8+10*R;E.push({css:p.channels.toCss(T,T,T),rgba:p.channels.toRgba(T,T,T)})}return E})());let x=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:c,cursor:o,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:p.color.blend(c,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:p.color.blend(c,m),ansi:s.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(E={}){const b=this._colors;if(b.foreground=y(E.foreground,n),b.background=y(E.background,c),b.cursor=y(E.cursor,o),b.cursorAccent=y(E.cursorAccent,h),b.selectionBackgroundTransparent=y(E.selectionBackground,m),b.selectionBackgroundOpaque=p.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=y(E.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=p.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=E.selectionForeground?y(E.selectionForeground,p.NULL_COLOR):void 0,b.selectionForeground===p.NULL_COLOR&&(b.selectionForeground=void 0),p.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=p.color.opacity(b.selectionBackgroundTransparent,.3)),p.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=p.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=s.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=y(E.black,s.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=y(E.red,s.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=y(E.green,s.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=y(E.yellow,s.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=y(E.blue,s.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=y(E.magenta,s.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=y(E.cyan,s.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=y(E.white,s.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=y(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=y(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=y(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=y(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=y(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=y(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=y(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=y(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const R=Math.min(b.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<R;T++)b.ansi[T+16]=y(E.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){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[E]=this._restoreColors.ansi[E]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(E){E(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 y(E,b){if(E!==void 0)try{return p.css.toColor(E)}catch{}return b}s.ThemeService=x=d([v(0,f.IOptionsService)],x)},6349:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const d=u(8460),v=u(844);class a extends v.Disposable{constructor(S){super(),this._maxLength=S,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(S){if(this._maxLength===S)return;const w=new Array(S);for(let f=0;f<Math.min(S,this.length);f++)w[f]=this._array[this._getCyclicIndex(f)];this._array=w,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let w=this._length;w<S;w++)this._array[w]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,w){this._array[this._getCyclicIndex(S)]=w}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,w,...f){if(w){for(let n=S;n<this._length-w;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let n=this._length-1;n>=S;n--)this._array[this._getCyclicIndex(n+f.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<f.length;n++)this._array[this._getCyclicIndex(S+n)]=f[n];if(f.length&&this.onInsertEmitter.fire({index:S,amount:f.length}),this._length+f.length>this._maxLength){const n=this._length+f.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=f.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,f){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let c=w-1;c>=0;c--)this.set(S+c+f,this.get(S+c));const n=S+w+f-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<w;n++)this.set(S+n+f,this.get(S+n))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}s.CircularList=a},1439:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function u(d,v=5){if(typeof d!="object")return d;const a=Array.isArray(d)?[]:{};for(const p in d)a[p]=v<=1?d[p]:d[p]&&u(d[p],v-1);return a}},8055:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let u=0,d=0,v=0,a=0;var p,S,w,f,n;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function o(h,m){return h<m?(m+.05)/(h+.05):(h+.05)/(m+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(m,x,y,E){return E!==void 0?`#${c(m)}${c(x)}${c(y)}${c(E)}`:`#${c(m)}${c(x)}${c(y)}`},h.toRgba=function(m,x,y,E=255){return(m<<24|x<<16|y<<8|E)>>>0},h.toColor=function(m,x,y,E){return{css:h.toCss(m,x,y,E),rgba:h.toRgba(m,x,y,E)}}})(p||(s.channels=p={})),(function(h){function m(x,y){return a=Math.round(255*y),[u,d,v]=n.toChannels(x.rgba),{css:p.toCss(u,d,v,a),rgba:p.toRgba(u,d,v,a)}}h.blend=function(x,y){if(a=(255&y.rgba)/255,a===1)return{css:y.css,rgba:y.rgba};const E=y.rgba>>24&255,b=y.rgba>>16&255,R=y.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,M=x.rgba>>8&255;return u=T+Math.round((E-T)*a),d=I+Math.round((b-I)*a),v=M+Math.round((R-M)*a),{css:p.toCss(u,d,v),rgba:p.toRgba(u,d,v)}},h.isOpaque=function(x){return(255&x.rgba)==255},h.ensureContrastRatio=function(x,y,E){const b=n.ensureContrastRatio(x.rgba,y.rgba,E);if(b)return p.toColor(b>>24&255,b>>16&255,b>>8&255)},h.opaque=function(x){const y=(255|x.rgba)>>>0;return[u,d,v]=n.toChannels(y),{css:p.toCss(u,d,v),rgba:y}},h.opacity=m,h.multiplyOpacity=function(x,y){return a=255&x.rgba,m(x,a*y/255)},h.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(S||(s.color=S={})),(function(h){let m,x;try{const y=document.createElement("canvas");y.width=1,y.height=1;const E=y.getContext("2d",{willReadFrequently:!0});E&&(m=E,m.globalCompositeOperation="copy",x=m.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),p.toColor(u,d,v);case 5:return u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),a=parseInt(y.slice(4,5).repeat(2),16),p.toColor(u,d,v,a);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const E=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),d=parseInt(E[2]),v=parseInt(E[3]),a=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,d,v,a);if(!m||!x)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=x,m.fillStyle=y,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[u,d,v,a]=m.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,v,a),css:y}}})(w||(s.css=w={})),(function(h){function m(x,y,E){const b=x/255,R=y/255,T=E/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}h.relativeLuminance=function(x){return m(x>>16&255,x>>8&255,255&x)},h.relativeLuminance2=m})(f||(s.rgb=f={})),(function(h){function m(y,E,b){const R=y>>24&255,T=y>>16&255,I=y>>8&255;let M=E>>24&255,k=E>>16&255,U=E>>8&255,K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));for(;K<b&&(M>0||k>0||U>0);)M-=Math.max(0,Math.ceil(.1*M)),k-=Math.max(0,Math.ceil(.1*k)),U-=Math.max(0,Math.ceil(.1*U)),K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));return(M<<24|k<<16|U<<8|255)>>>0}function x(y,E,b){const R=y>>24&255,T=y>>16&255,I=y>>8&255;let M=E>>24&255,k=E>>16&255,U=E>>8&255,K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));for(;K<b&&(M<255||k<255||U<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),k=Math.min(255,k+Math.ceil(.1*(255-k))),U=Math.min(255,U+Math.ceil(.1*(255-U))),K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));return(M<<24|k<<16|U<<8|255)>>>0}h.blend=function(y,E){if(a=(255&E)/255,a===1)return E;const b=E>>24&255,R=E>>16&255,T=E>>8&255,I=y>>24&255,M=y>>16&255,k=y>>8&255;return u=I+Math.round((b-I)*a),d=M+Math.round((R-M)*a),v=k+Math.round((T-k)*a),p.toRgba(u,d,v)},h.ensureContrastRatio=function(y,E,b){const R=f.relativeLuminance(y>>8),T=f.relativeLuminance(E>>8);if(o(R,T)<b){if(T<R){const k=m(y,E,b),U=o(R,f.relativeLuminance(k>>8));if(U<b){const K=x(y,E,b);return U>o(R,f.relativeLuminance(K>>8))?k:K}return k}const I=x(y,E,b),M=o(R,f.relativeLuminance(I>>8));if(M<b){const k=m(y,E,b);return M>o(R,f.relativeLuminance(k>>8))?I:k}return I}},h.reduceLuminance=m,h.increaseLuminance=x,h.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(s.rgba=n={})),s.toPaddedHex=c,s.contrastRatio=o},8969:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const d=u(844),v=u(2585),a=u(4348),p=u(7866),S=u(744),w=u(7302),f=u(6975),n=u(8460),c=u(1753),o=u(1480),h=u(7994),m=u(9282),x=u(5435),y=u(5981),E=u(2660);let b=!1;class R extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((I=>{var M;(M=this._onScrollApi)==null||M.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const M in I)this.optionsService.options[M]=I[M]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new w.OptionsService(I)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.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((M=>{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((M=>{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 y.WriteBuffer(((M,k)=>this._inputHandler.parse(M,k)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,M){this._writeBuffer.write(I,M)}writeSync(I,M){this._logService.logLevel<=v.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(I,M)}input(I,M=!0){this.coreService.triggerDataEvent(I,M)}resize(I,M){isNaN(I)||isNaN(M)||(I=Math.max(I,S.MINIMUM_COLS),M=Math.max(M,S.MINIMUM_ROWS),this._bufferService.resize(I,M))}scroll(I,M=!1){this._bufferService.scroll(I,M)}scrollLines(I,M,k){this._bufferService.scrollLines(I,M,k)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const M=I-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(I,M){return this._inputHandler.registerEscHandler(I,M)}registerDcsHandler(I,M){return this._inputHandler.registerDcsHandler(I,M)}registerCsiHandler(I,M){return this._inputHandler.registerCsiHandler(I,M)}registerOscHandler(I,M){return this._inputHandler.registerOscHandler(I,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?I=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const M of I)M.dispose()}))}}}s.CoreTerminal=R},8460:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let a=0;a<this._listeners.length;a++)v.push(this._listeners[a]);for(let a=0;a<v.length;a++)v[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,d){return u((v=>d.fire(v)))},s.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},5435:function(H,s,u){var d=this&&this.__decorate||function(V,O,q,B){var j,Q=arguments.length,J=Q<3?O:B===null?B=Object.getOwnPropertyDescriptor(O,q):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(V,O,q,B);else for(var ue=V.length-1;ue>=0;ue--)(j=V[ue])&&(J=(Q<3?j(J):Q>3?j(O,q,J):j(O,q))||J);return Q>3&&J&&Object.defineProperty(O,q,J),J},v=this&&this.__param||function(V,O){return function(q,B){O(q,B,V)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const a=u(2584),p=u(7116),S=u(2015),w=u(844),f=u(482),n=u(8437),c=u(8460),o=u(643),h=u(511),m=u(3734),x=u(2585),y=u(1480),E=u(6242),b=u(6351),R=u(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function M(V,O){if(V>24)return O.setWinLines||!1;switch(V){case 1:return!!O.restoreWin;case 2:return!!O.minimizeWin;case 3:return!!O.setWinPosition;case 4:return!!O.setWinSizePixels;case 5:return!!O.raiseWin;case 6:return!!O.lowerWin;case 7:return!!O.refreshWin;case 8:return!!O.setWinSizeChars;case 9:return!!O.maximizeWin;case 10:return!!O.fullscreenWin;case 11:return!!O.getWinState;case 13:return!!O.getWinPosition;case 14:return!!O.getWinSizePixels;case 15:return!!O.getScreenSizePixels;case 16:return!!O.getCellSizePixels;case 18:return!!O.getWinSizeChars;case 19:return!!O.getScreenSizeChars;case 20:return!!O.getIconTitle;case 21:return!!O.getWinTitle;case 22:return!!O.pushTitle;case 23:return!!O.popTitle;case 24:return!!O.setWinLines}return!1}var k;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(k||(s.WindowsOptionsReportType=k={}));let U=0;class K extends w.Disposable{getAttrData(){return this._curAttrData}constructor(O,q,B,j,Q,J,ue,he,X=new S.EscapeSequenceParser){super(),this._bufferService=O,this._charsetService=q,this._coreService=B,this._logService=j,this._optionsService=Q,this._oscLinkService=J,this._coreMouseService=ue,this._unicodeService=he,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.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((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:ae.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,ae,ie)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:ae,data:ie})})),this._parser.setDcsHandlerFallback(((F,ae,ie)=>{ae==="HOOK"&&(ie=ie.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:ae,payload:ie})})),this._parser.setPrintHandler(((F,ae,ie)=>this.print(F,ae,ie))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new E.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new E.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new E.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new E.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new E.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new E.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new E.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new E.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new E.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new E.OscHandler((F=>this.restoreCursorColor(F)))),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 F in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((F,ae)=>this.requestStatusString(F,ae))))}_preserveStack(O,q,B,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=O,this._parseStack.cursorStartY=q,this._parseStack.decodedLength=B,this._parseStack.position=j}_logSlowResolvingAsync(O){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([O,new Promise(((q,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((q=>{if(q!=="#SLOW_TIMEOUT")throw q;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(O,q){let B,j=this._activeBuffer.x,Q=this._activeBuffer.y,J=0;const ue=this._parseStack.paused;if(ue){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,q))return this._logSlowResolvingAsync(B),B;j=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,O.length>I&&(J=this._parseStack.position+I)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof O=="string"?` "${O}"`:` "${Array.prototype.map.call(O,(F=>String.fromCharCode(F))).join("")}"`),typeof O=="string"?O.split("").map((F=>F.charCodeAt(0))):O),this._parseBuffer.length<O.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(O.length,I))),ue||this._dirtyRowTracker.clearRange(),O.length>I)for(let F=J;F<O.length;F+=I){const ae=F+I<O.length?F+I:O.length,ie=typeof O=="string"?this._stringDecoder.decode(O.substring(F,ae),this._parseBuffer):this._utf8Decoder.decode(O.subarray(F,ae),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,ie))return this._preserveStack(j,Q,ie,F),this._logSlowResolvingAsync(B),B}else if(!ue){const F=typeof O=="string"?this._stringDecoder.decode(O,this._parseBuffer):this._utf8Decoder.decode(O,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,F))return this._preserveStack(j,Q,F,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===j&&this._activeBuffer.y===Q||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(O,q,B){let j,Q;const J=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,F=this._coreService.modes.insertMode,ae=this._curAttrData;let ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-q>0&&ie.getWidth(this._activeBuffer.x-1)===2&&ie.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let _e=this._parser.precedingJoinState;for(let fe=q;fe<B;++fe){if(j=O[fe],j<127&&J){const Pe=J[String.fromCharCode(j)];Pe&&(j=Pe.charCodeAt(0))}const ye=this._unicodeService.charProperties(j,_e);Q=y.UnicodeService.extractWidth(ye);const ge=y.UnicodeService.extractShouldJoin(ye),Te=ge?y.UnicodeService.extractWidth(_e):0;if(_e=ye,ue&&this._onA11yChar.fire((0,f.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-Te>he){if(X){const Pe=ie;let Se=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,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),ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&ie instanceof n.BufferLine&&ie.copyCellsFrom(Pe,Se,0,Te,!1);Se<he;)Pe.setCellFromCodepoint(Se++,0,1,ae)}else if(this._activeBuffer.x=he-1,Q===2)continue}if(ge&&this._activeBuffer.x){const Pe=ie.getWidth(this._activeBuffer.x-1)?1:2;ie.addCodepointToCell(this._activeBuffer.x-Pe,j,Q);for(let Se=Q-Te;--Se>=0;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(F&&(ie.insertCells(this._activeBuffer.x,Q-Te,this._activeBuffer.getNullCell(ae)),ie.getWidth(he-1)===2&&ie.setCellFromCodepoint(he-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ae)),ie.setCellFromCodepoint(this._activeBuffer.x++,j,Q,ae),Q>0)for(;--Q;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=_e,this._activeBuffer.x<he&&B-q>0&&ie.getWidth(this._activeBuffer.x)===0&&!ie.hasContent(this._activeBuffer.x)&&ie.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(O,q){return O.final!=="t"||O.prefix||O.intermediates?this._parser.registerCsiHandler(O,q):this._parser.registerCsiHandler(O,(B=>!M(B.params[0],this._optionsService.rawOptions.windowOptions)||q(B)))}registerDcsHandler(O,q){return this._parser.registerDcsHandler(O,new b.DcsHandler(q))}registerEscHandler(O,q){return this._parser.registerEscHandler(O,q)}registerOscHandler(O,q){return this._parser.registerOscHandler(O,new E.OscHandler(q))}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 O;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&&((O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&O.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);q.hasWidth(this._activeBuffer.x)&&!q.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const O=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-O),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(O=this._bufferService.cols-1){this._activeBuffer.x=Math.min(O,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(O,q){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=O,this._activeBuffer.y=this._activeBuffer.scrollTop+q):(this._activeBuffer.x=O,this._activeBuffer.y=q),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(O,q){this._restrictCursor(),this._setCursor(this._activeBuffer.x+O,this._activeBuffer.y+q)}cursorUp(O){const q=this._activeBuffer.y-this._activeBuffer.scrollTop;return q>=0?this._moveCursor(0,-Math.min(q,O.params[0]||1)):this._moveCursor(0,-(O.params[0]||1)),!0}cursorDown(O){const q=this._activeBuffer.scrollBottom-this._activeBuffer.y;return q>=0?this._moveCursor(0,Math.min(q,O.params[0]||1)):this._moveCursor(0,O.params[0]||1),!0}cursorForward(O){return this._moveCursor(O.params[0]||1,0),!0}cursorBackward(O){return this._moveCursor(-(O.params[0]||1),0),!0}cursorNextLine(O){return this.cursorDown(O),this._activeBuffer.x=0,!0}cursorPrecedingLine(O){return this.cursorUp(O),this._activeBuffer.x=0,!0}cursorCharAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(O){return this._setCursor(O.length>=2?(O.params[1]||1)-1:0,(O.params[0]||1)-1),!0}charPosAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(O){return this._moveCursor(O.params[0]||1,0),!0}linePosAbsolute(O){return this._setCursor(this._activeBuffer.x,(O.params[0]||1)-1),!0}vPositionRelative(O){return this._moveCursor(0,O.params[0]||1),!0}hVPosition(O){return this.cursorPosition(O),!0}tabClear(O){const q=O.params[0];return q===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:q===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let q=O.params[0]||1;for(;q--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let q=O.params[0]||1;for(;q--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(O){const q=O.params[0];return q===1&&(this._curAttrData.bg|=536870912),q!==2&&q!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(O,q,B,j=!1,Q=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);J.replaceCells(q,B,this._activeBuffer.getNullCell(this._eraseAttrData()),Q),j&&(J.isWrapped=!1)}_resetBufferLine(O,q=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),q),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+O),B.isWrapped=!1)}eraseInDisplay(O,q=!1){let B;switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,q);B<this._bufferService.rows;B++)this._resetBufferLine(B,q);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,q),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,q);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,q);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(O,q=!1){switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,q);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,q);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,q)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(O){this._restrictCursor();let q=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;q--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(O){this._restrictCursor();let q=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;q--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(O){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.insertCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(O){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.deleteCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(O){let q=O.params[0]||1;for(;q--;)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(O){let q=O.params[0]||1;for(;q--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=O.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);j.deleteCells(0,q,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=O.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);j.insertCells(0,q,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=O.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);j.insertCells(this._activeBuffer.x,q,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=O.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);j.deleteCells(this._activeBuffer.x,q,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(O){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(O.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(O){const q=this._parser.precedingJoinState;if(!q)return!0;const B=O.params[0]||1,j=y.UnicodeService.extractWidth(q),Q=this._activeBuffer.x-j,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),ue=new Uint32Array(J.length*B);let he=0;for(let F=0;F<J.length;){const ae=J.codePointAt(F)||0;ue[he++]=ae,F+=ae>65535?2:1}let X=he;for(let F=1;F<B;++F)ue.copyWithin(X,0,he),X+=he;return this.print(ue,0,X),!0}sendDeviceAttributesPrimary(O){return O.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(O){return O.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(O.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(O){return(this._optionsService.rawOptions.termName+"").indexOf(O)===0}setMode(O){for(let q=0;q<O.length;q++)switch(O.params[q]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(O){for(let q=0;q<O.length;q++)switch(O.params[q]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(O){for(let q=0;q<O.length;q++)switch(O.params[q]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(O){for(let q=0;q<O.length;q++)switch(O.params[q]){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(),O.params[q]===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(O,q){const B=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:Q}=this._coreMouseService,J=this._coreService,{buffers:ue,cols:he}=this._bufferService,{active:X,alt:F}=ue,ae=this._optionsService.rawOptions,ie=ge=>ge?1:2,_e=O.params[0];return fe=_e,ye=q?_e===2?4:_e===4?ie(J.modes.insertMode):_e===12?3:_e===20?ie(ae.convertEol):0:_e===1?ie(B.applicationCursorKeys):_e===3?ae.windowOptions.setWinLines?he===80?2:he===132?1:0:0:_e===6?ie(B.origin):_e===7?ie(B.wraparound):_e===8?3:_e===9?ie(j==="X10"):_e===12?ie(ae.cursorBlink):_e===25?ie(!J.isCursorHidden):_e===45?ie(B.reverseWraparound):_e===66?ie(B.applicationKeypad):_e===67?4:_e===1e3?ie(j==="VT200"):_e===1002?ie(j==="DRAG"):_e===1003?ie(j==="ANY"):_e===1004?ie(B.sendFocus):_e===1005?4:_e===1006?ie(Q==="SGR"):_e===1015?4:_e===1016?ie(Q==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?ie(X===F):_e===2004?ie(B.bracketedPasteMode):0,J.triggerDataEvent(`${a.C0.ESC}[${q?"":"?"}${fe};${ye}$y`),!0;var fe,ye}_updateAttrColor(O,q,B,j,Q){return q===2?(O|=50331648,O&=-16777216,O|=m.AttributeData.fromColorRGB([B,j,Q])):q===5&&(O&=-50331904,O|=33554432|255&B),O}_extractColor(O,q,B){const j=[0,0,-1,0,0,0];let Q=0,J=0;do{if(j[J+Q]=O.params[q+J],O.hasSubParams(q+J)){const ue=O.getSubParams(q+J);let he=0;do j[1]===5&&(Q=1),j[J+he+1+Q]=ue[he];while(++he<ue.length&&he+J+1+Q<j.length);break}if(j[1]===5&&J+Q>=2||j[1]===2&&J+Q>=5)break;j[1]&&(Q=1)}while(++J+q<O.length&&J+Q<j.length);for(let ue=2;ue<j.length;++ue)j[ue]===-1&&(j[ue]=0);switch(j[0]){case 38:B.fg=this._updateAttrColor(B.fg,j[1],j[3],j[4],j[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,j[1],j[3],j[4],j[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,j[1],j[3],j[4],j[5])}return J}_processUnderline(O,q){q.extended=q.extended.clone(),(!~O||O>5)&&(O=1),q.extended.underlineStyle=O,q.fg|=268435456,O===0&&(q.fg&=-268435457),q.updateExtended()}_processSGR0(O){O.fg=n.DEFAULT_ATTR_DATA.fg,O.bg=n.DEFAULT_ATTR_DATA.bg,O.extended=O.extended.clone(),O.extended.underlineStyle=0,O.extended.underlineColor&=-67108864,O.updateExtended()}charAttributes(O){if(O.length===1&&O.params[0]===0)return this._processSGR0(this._curAttrData),!0;const q=O.length;let B;const j=this._curAttrData;for(let Q=0;Q<q;Q++)B=O.params[Q],B>=30&&B<=37?(j.fg&=-50331904,j.fg|=16777216|B-30):B>=40&&B<=47?(j.bg&=-50331904,j.bg|=16777216|B-40):B>=90&&B<=97?(j.fg&=-50331904,j.fg|=16777224|B-90):B>=100&&B<=107?(j.bg&=-50331904,j.bg|=16777224|B-100):B===0?this._processSGR0(j):B===1?j.fg|=134217728:B===3?j.bg|=67108864:B===4?(j.fg|=268435456,this._processUnderline(O.hasSubParams(Q)?O.getSubParams(Q)[0]:1,j)):B===5?j.fg|=536870912:B===7?j.fg|=67108864:B===8?j.fg|=1073741824:B===9?j.fg|=2147483648:B===2?j.bg|=134217728:B===21?this._processUnderline(2,j):B===22?(j.fg&=-134217729,j.bg&=-134217729):B===23?j.bg&=-67108865:B===24?(j.fg&=-268435457,this._processUnderline(0,j)):B===25?j.fg&=-536870913:B===27?j.fg&=-67108865:B===28?j.fg&=-1073741825:B===29?j.fg&=2147483647:B===39?(j.fg&=-67108864,j.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):B===49?(j.bg&=-67108864,j.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?Q+=this._extractColor(O,Q,j):B===53?j.bg|=1073741824:B===55?j.bg&=-1073741825:B===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):B===100?(j.fg&=-67108864,j.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(O){switch(O.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const q=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${q};${B}R`)}return!0}deviceStatusPrivate(O){if(O.params[0]===6){const q=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${q};${B}R`)}return!0}softReset(O){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(O){const q=O.params[0]||1;switch(q){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 B=q%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(O){const q=O.params[0]||1;let B;return(O.length<2||(B=O.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>q&&(this._activeBuffer.scrollTop=q-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(O){if(!M(O.params[0],this._optionsService.rawOptions.windowOptions))return!0;const q=O.length>1?O.params[1]:0;switch(O.params[0]){case 14:q!==2&&this._onRequestWindowsOptionsReport.fire(k.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(k.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:q!==0&&q!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),q!==0&&q!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:q!==0&&q!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),q!==0&&q!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(O){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(O){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(O){return this._windowTitle=O,this._onTitleChange.fire(O),!0}setIconName(O){return this._iconName=O,!0}setOrReportIndexedColor(O){const q=[],B=O.split(";");for(;B.length>1;){const j=B.shift(),Q=B.shift();if(/^\d+$/.exec(j)){const J=parseInt(j);if($(J))if(Q==="?")q.push({type:0,index:J});else{const ue=(0,R.parseColor)(Q);ue&&q.push({type:1,index:J,color:ue})}}}return q.length&&this._onColor.fire(q),!0}setHyperlink(O){const q=O.split(";");return!(q.length<2)&&(q[1]?this._createHyperlink(q[0],q[1]):!q[0]&&this._finishHyperlink())}_createHyperlink(O,q){this._getCurrentLinkId()&&this._finishHyperlink();const B=O.split(":");let j;const Q=B.findIndex((J=>J.startsWith("id=")));return Q!==-1&&(j=B[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:q}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(O,q){const B=O.split(";");for(let j=0;j<B.length&&!(q>=this._specialColors.length);++j,++q)if(B[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[q]}]);else{const Q=(0,R.parseColor)(B[j]);Q&&this._onColor.fire([{type:1,index:this._specialColors[q],color:Q}])}return!0}setOrReportFgColor(O){return this._setOrReportSpecialColor(O,0)}setOrReportBgColor(O){return this._setOrReportSpecialColor(O,1)}setOrReportCursorColor(O){return this._setOrReportSpecialColor(O,2)}restoreIndexedColor(O){if(!O)return this._onColor.fire([{type:2}]),!0;const q=[],B=O.split(";");for(let j=0;j<B.length;++j)if(/^\d+$/.exec(B[j])){const Q=parseInt(B[j]);$(Q)&&q.push({type:2,index:Q})}return q.length&&this._onColor.fire(q),!0}restoreFgColor(O){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(O){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(O){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(O){return O.length!==2?(this.selectDefaultCharset(),!0):(O[0]==="/"||this._charsetService.setgCharset(T[O[0]],p.CHARSETS[O[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const O=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,O,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(O){return this._charsetService.setgLevel(O),!0}screenAlignmentPattern(){const O=new h.CellData;O.content=4194373,O.fg=this._curAttrData.fg,O.bg=this._curAttrData.bg,this._setCursor(0,0);for(let q=0;q<this._bufferService.rows;++q){const B=this._activeBuffer.ybase+this._activeBuffer.y+q,j=this._activeBuffer.lines.get(B);j&&(j.fill(O),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(O,q){const B=this._bufferService.buffer,j=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${Q}${a.C0.ESC}\\`),!0))(O==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:O==='"p'?'P1$r61;1"p':O==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:O==="m"?"P1$r0m":O===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(O,q){this._dirtyRowTracker.markRangeDirty(O,q)}}s.InputHandler=K;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,O){V>O&&(U=V,V=O,O=U),V<this.start&&(this.start=V),O>this.end&&(this.end=O)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(V){return 0<=V&&V<256}W=d([v(0,x.IBufferService)],W)},844:(H,s)=>{function u(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.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 v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)==null||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=u,s.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,a,p){this._data[v]||(this._data[v]={}),this._data[v][a]=p}get(v,a){return this._data[v]?this._data[v][a]:void 0}clear(){this._data={}}}s.TwoKeyMap=u,s.FourKeyMap=class{constructor(){this._data=new u}set(d,v,a,p,S){this._data.get(d,v)||this._data.set(d,v,new u),this._data.get(d,v).set(a,p,S)}get(d,v,a,p){var S;return(S=this._data.get(d,v))==null?void 0:S.get(a,p)}clear(){this._data.clear()}}},6114:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const u=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=u.includes("Firefox"),s.isLegacyEdge=u.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(u),s.getSafariVersion=function(){if(!s.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(u)},6106:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let u=0;s.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const v=this._getKey(d);if(v===void 0||(u=this._search(v),u===-1)||this._getKey(this._array[u])!==v)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===v);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,v){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do v(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let v=0,a=this._array.length-1;for(;a>=v;){let p=v+a>>1;const S=this._getKey(this._array[p]);if(S>d)a=p-1;else{if(!(S<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}v=p+1}}return v}}},7226:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=u(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let w=0,f=0,n=S.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),f=Math.max(w,f),c=S.timeRemaining(),1.5*f>c)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=c}this.clear()}}class a extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=a,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const d=u(643);s.updateWindowsModeWrappedState=function(v){const a=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),p=a==null?void 0:a.get(v.cols-1),S=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);S&&p&&(S.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},9092:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const d=u(6349),v=u(7226),a=u(3734),p=u(8437),S=u(4634),w=u(511),f=u(643),n=u(4863),c=u(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(o,h,m){this._hasScrollback=o,this._optionsService=h,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.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 a.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 a.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,h){return new p.BufferLine(this._bufferService.cols,this.getNullCell(o),h)}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 h=o+this._optionsService.rawOptions.scrollback;return h>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:h}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=p.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)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,h){const m=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=0;const y=this._getCorrectBufferLength(h);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<o)for(let b=0;b<this.lines.length;b++)x+=+this.lines.get(b).resize(o,m);let E=0;if(this._rows<h)for(let b=this._rows;b<h;b++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(o,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(o,m)));else for(let b=this._rows;b>h;b--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const b=this.lines.length-y;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=y}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,h-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(o,h),this._cols>o))for(let E=0;E<this.lines.length;E++)x+=+this.lines.get(E).resize(o,m);this._cols=o,this._rows=h,this._memoryCleanupQueue.clear(),x>.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 h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>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,h){this._cols!==o&&(o>this._cols?this._reflowLarger(o,h):this._reflowSmaller(o,h))}_reflowLarger(o,h){const m=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(m.length>0){const x=(0,S.reflowLargerCreateNewLayout)(this.lines,m);(0,S.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(o,h,x.countRemoved)}}_reflowLargerAdjustViewport(o,h,m){const x=this.getNullCell(p.DEFAULT_ATTR_DATA);let y=m;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new p.BufferLine(o,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(o,h){const m=this.getNullCell(p.DEFAULT_ATTR_DATA),x=[];let y=0;for(let E=this.lines.length-1;E>=0;E--){let b=this.lines.get(E);if(!b||!b.isWrapped&&b.getTrimmedLength()<=o)continue;const R=[b];for(;b.isWrapped&&E>0;)b=this.lines.get(--E),R.unshift(b);const T=this.ybase+this.y;if(T>=E&&T<E+R.length)continue;const I=R[R.length-1].getTrimmedLength(),M=(0,S.reflowSmallerGetNewLineLengths)(R,this._cols,o),k=M.length-R.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+k):Math.max(0,this.lines.length-this.lines.maxLength+k);const K=[];for(let B=0;B<k;B++){const j=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);K.push(j)}K.length>0&&(x.push({start:E+R.length+y,newLines:K}),y+=K.length),R.push(...K);let W=M.length-1,$=M[W];$===0&&(W--,$=M[W]);let V=R.length-k-1,O=I;for(;V>=0;){const B=Math.min(O,$);if(R[W]===void 0)break;if(R[W].copyCellsFrom(R[V],O-B,$-B,B,!0),$-=B,$===0&&(W--,$=M[W]),O-=B,O===0){V--;const j=Math.max(V,0);O=(0,S.getWrappedLineTrimmedLength)(R,j,this._cols)}}for(let B=0;B<R.length;B++)M[B]<o&&R[B].setCell(M[B],m);let q=k-U;for(;q-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+k,this.ybase+h-1)}if(x.length>0){const E=[],b=[];for(let W=0;W<this.lines.length;W++)b.push(this.lines.get(W));const R=this.lines.length;let T=R-1,I=0,M=x[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let k=0;for(let W=Math.min(this.lines.maxLength-1,R+y-1);W>=0;W--)if(M&&M.start>T+k){for(let $=M.newLines.length-1;$>=0;$--)this.lines.set(W--,M.newLines[$]);W++,E.push({index:T+1,amount:M.newLines.length}),k+=M.newLines.length,M=x[++I]}else this.lines.set(W,b[T--]);let U=0;for(let W=E.length-1;W>=0;W--)E[W].index+=U,this.lines.onInsertEmitter.fire(E[W]),U+=E[W].amount;const K=Math.max(0,R+y-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(o,h,m=0,x){const y=this.lines.get(o);return y?y.translateToString(h,m,x):""}getWrappedRangeForLine(o){let h=o,m=o;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:h,last:m}}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 h=0;h<this.markers.length;h++)this.markers[h].line===o&&(this.markers[h].dispose(),this.markers.splice(h--,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 h=new n.Marker(o);return this.markers.push(h),h.register(this.lines.onTrim((m=>{h.line-=m,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((m=>{h.line>=m.index&&(h.line+=m.amount)}))),h.register(this.lines.onDelete((m=>{h.line>=m.index&&h.line<m.index+m.amount&&h.dispose(),h.line>m.index&&(h.line-=m.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const d=u(3734),v=u(511),a=u(643),p=u(482);s.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class w{constructor(n,c,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const h=c||v.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let m=0;m<n;++m)this.setCell(m,h);this.length=n}get(n){const c=this._data[3*n+0],o=2097151&c;return[this._data[3*n+1],2097152&c?this._combined[n]:o?(0,p.stringFromCodePoint)(o):"",c>>22,2097152&c?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,c){this._data[3*n+1]=c[a.CHAR_DATA_ATTR_INDEX],c[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=c[1],this._data[3*n+0]=2097152|n|c[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=c[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const c=this._data[3*n+0];return 2097152&c?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&c}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const c=this._data[3*n+0];return 2097152&c?this._combined[n]:2097151&c?(0,p.stringFromCodePoint)(2097151&c):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,c){return S=3*n,c.content=this._data[S+0],c.fg=this._data[S+1],c.bg=this._data[S+2],2097152&c.content&&(c.combinedData=this._combined[n]),268435456&c.bg&&(c.extended=this._extendedAttrs[n]),c}setCell(n,c){2097152&c.content&&(this._combined[n]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=c.content,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}setCellFromCodepoint(n,c,o,h){268435456&h.bg&&(this._extendedAttrs[n]=h.extended),this._data[3*n+0]=c|o<<22,this._data[3*n+1]=h.fg,this._data[3*n+2]=h.bg}addCodepointToCell(n,c,o){let h=this._data[3*n+0];2097152&h?this._combined[n]+=(0,p.stringFromCodePoint)(c):2097151&h?(this._combined[n]=(0,p.stringFromCodePoint)(2097151&h)+(0,p.stringFromCodePoint)(c),h&=-2097152,h|=2097152):h=c|4194304,o&&(h&=-12582913,h|=o<<22),this._data[3*n+0]=h}insertCells(n,c,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length-n){const h=new v.CellData;for(let m=this.length-n-c-1;m>=0;--m)this.setCell(n+c+m,this.loadCell(n+m,h));for(let m=0;m<c;++m)this.setCell(n+m,o)}else for(let h=n;h<this.length;++h)this.setCell(h,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,c,o){if(n%=this.length,c<this.length-n){const h=new v.CellData;for(let m=0;m<this.length-n-c;++m)this.setCell(n+m,this.loadCell(n+c+m,h));for(let m=this.length-c;m<this.length;++m)this.setCell(m,o)}else for(let h=n;h<this.length;++h)this.setCell(h,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,c,o,h=!1){if(h)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,o);n<c&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,o);n<c&&n<this.length;)this.setCell(n++,o)}resize(n,c){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const h=new Uint32Array(o);h.set(this._data),this._data=h}for(let h=this.length;h<n;++h)this.setCell(h,c)}else{this._data=this._data.subarray(0,o);const h=Object.keys(this._combined);for(let x=0;x<h.length;x++){const y=parseInt(h[x],10);y>=n&&delete this._combined[y]}const m=Object.keys(this._extendedAttrs);for(let x=0;x<m.length;x++){const y=parseInt(m[x],10);y>=n&&delete this._extendedAttrs[y]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,c=!1){if(c)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const c in n._combined)this._combined[c]=n._combined[c];this._extendedAttrs={};for(const c in n._extendedAttrs)this._extendedAttrs[c]=n._extendedAttrs[c];this.isWrapped=n.isWrapped}clone(){const n=new w(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const c in this._combined)n._combined[c]=this._combined[c];for(const c in this._extendedAttrs)n._extendedAttrs[c]=this._extendedAttrs[c];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,c,o,h,m){const x=n._data;if(m)for(let E=h-1;E>=0;E--){for(let b=0;b<3;b++)this._data[3*(o+E)+b]=x[3*(c+E)+b];268435456&x[3*(c+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[c+E])}else for(let E=0;E<h;E++){for(let b=0;b<3;b++)this._data[3*(o+E)+b]=x[3*(c+E)+b];268435456&x[3*(c+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[c+E])}const y=Object.keys(n._combined);for(let E=0;E<y.length;E++){const b=parseInt(y[E],10);b>=c&&(this._combined[b-c+o]=n._combined[b])}}translateToString(n,c,o,h){c=c??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),h&&(h.length=0);let m="";for(;c<o;){const x=this._data[3*c+0],y=2097151&x,E=2097152&x?this._combined[c]:y?(0,p.stringFromCodePoint)(y):a.WHITESPACE_CELL_CHAR;if(m+=E,h)for(let b=0;b<E.length;++b)h.push(c);c+=x>>22||1}return h&&h.push(c),m}}s.BufferLine=w},4841:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(H,s)=>{function u(d,v,a){if(v===d.length-1)return d[v].getTrimmedLength();const p=!d[v].hasContent(a-1)&&d[v].getWidth(a-1)===1,S=d[v+1].getWidth(0)===2;return p&&S?a-1:a}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(d,v,a,p,S){const w=[];for(let f=0;f<d.length-1;f++){let n=f,c=d.get(++n);if(!c.isWrapped)continue;const o=[d.get(f)];for(;n<d.length&&c.isWrapped;)o.push(c),c=d.get(++n);if(p>=f&&p<n){f+=o.length-1;continue}let h=0,m=u(o,h,v),x=1,y=0;for(;x<o.length;){const b=u(o,x,v),R=b-y,T=a-m,I=Math.min(R,T);o[h].copyCellsFrom(o[x],y,m,I,!1),m+=I,m===a&&(h++,m=0),y+=I,y===b&&(x++,y=0),m===0&&h!==0&&o[h-1].getWidth(a-1)===2&&(o[h].copyCellsFrom(o[h-1],a-1,m++,1,!1),o[h-1].setCell(a-1,S))}o[h].replaceCells(m,a,S);let E=0;for(let b=o.length-1;b>0&&(b>h||o[b].getTrimmedLength()===0);b--)E++;E>0&&(w.push(f+o.length-E),w.push(E)),f+=o.length-1}return w},s.reflowLargerCreateNewLayout=function(d,v){const a=[];let p=0,S=v[p],w=0;for(let f=0;f<d.length;f++)if(S===f){const n=v[++p];d.onDeleteEmitter.fire({index:f-w,amount:n}),f+=n-1,w+=n,S=v[++p]}else a.push(f);return{layout:a,countRemoved:w}},s.reflowLargerApplyNewLayout=function(d,v){const a=[];for(let p=0;p<v.length;p++)a.push(d.get(v[p]));for(let p=0;p<a.length;p++)d.set(p,a[p]);d.length=v.length},s.reflowSmallerGetNewLineLengths=function(d,v,a){const p=[],S=d.map(((c,o)=>u(d,o,v))).reduce(((c,o)=>c+o));let w=0,f=0,n=0;for(;n<S;){if(S-n<a){p.push(S-n);break}w+=a;const c=u(d,f,v);w>c&&(w-=c,f++);const o=d[f].getWidth(w-1)===2;o&&w--;const h=o?a-1:a;p.push(h),n+=h}return p},s.getWrappedLineTrimmedLength=u},5295:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const d=u(8460),v=u(844),a=u(9092);class p extends v.Disposable{constructor(w,f){super(),this._optionsService=w,this._bufferService=f,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,f){this._normal.resize(w,f),this._alt.resize(w,f),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=p},511:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=u(482),v=u(643),a=u(3734);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const f=new p;return f.setFromCharData(w),f}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(w){this.fg=w[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(w[v.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(w[v.CHAR_DATA_CHAR_INDEX].length===2){const n=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const c=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(n-55296)+c-56320+65536|w[v.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[v.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=w[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const d=u(8460),v=u(844);class a{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}s.Marker=a,a._nextId=1},7116:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(H,s)=>{var u,d,v;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
|
|
81
|
+
`,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(u||(s.C0=u={})),(function(a){a.PAD="",a.HOP="",a.BPH="",a.NBH="",a.IND="",a.NEL="
",a.SSA="",a.ESA="",a.HTS="",a.HTJ="",a.VTS="",a.PLD="",a.PLU="",a.RI="",a.SS2="",a.SS3="",a.DCS="",a.PU1="",a.PU2="",a.STS="",a.CCH="",a.MW="",a.SPA="",a.EPA="",a.SOS="",a.SGCI="",a.SCI="",a.CSI="",a.ST="",a.OSC="",a.PM="",a.APC=""})(d||(s.C1=d={})),(function(a){a.ST=`${u.ESC}\\`})(v||(s.C1_ESCAPED=v={}))},7399:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const d=u(2584),v={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:["'",'"']};s.evaluateKeyboardEvent=function(a,p,S,w){const f={type:0,cancel:!1,key:void 0},n=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?f.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?f.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?f.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(f.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:f.key=a.ctrlKey?"\b":d.C0.DEL,a.altKey&&(f.key=d.C0.ESC+f.key);break;case 9:if(a.shiftKey){f.key=d.C0.ESC+"[Z";break}f.key=d.C0.HT,f.cancel=!0;break;case 13:f.key=a.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,f.cancel=!0;break;case 27:f.key=d.C0.ESC,a.altKey&&(f.key=d.C0.ESC+d.C0.ESC),f.cancel=!0;break;case 37:if(a.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"D",f.key===d.C0.ESC+"[1;3D"&&(f.key=d.C0.ESC+(S?"b":"[1;5D"))):f.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(a.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"C",f.key===d.C0.ESC+"[1;3C"&&(f.key=d.C0.ESC+(S?"f":"[1;5C"))):f.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(a.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"A",S||f.key!==d.C0.ESC+"[1;3A"||(f.key=d.C0.ESC+"[1;5A")):f.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(a.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"B",S||f.key!==d.C0.ESC+"[1;3B"||(f.key=d.C0.ESC+"[1;5B")):f.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(f.key=d.C0.ESC+"[2~");break;case 46:f.key=n?d.C0.ESC+"[3;"+(n+1)+"~":d.C0.ESC+"[3~";break;case 36:f.key=n?d.C0.ESC+"[1;"+(n+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:f.key=n?d.C0.ESC+"[1;"+(n+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:a.shiftKey?f.type=2:a.ctrlKey?f.key=d.C0.ESC+"[5;"+(n+1)+"~":f.key=d.C0.ESC+"[5~";break;case 34:a.shiftKey?f.type=3:a.ctrlKey?f.key=d.C0.ESC+"[6;"+(n+1)+"~":f.key=d.C0.ESC+"[6~";break;case 112:f.key=n?d.C0.ESC+"[1;"+(n+1)+"P":d.C0.ESC+"OP";break;case 113:f.key=n?d.C0.ESC+"[1;"+(n+1)+"Q":d.C0.ESC+"OQ";break;case 114:f.key=n?d.C0.ESC+"[1;"+(n+1)+"R":d.C0.ESC+"OR";break;case 115:f.key=n?d.C0.ESC+"[1;"+(n+1)+"S":d.C0.ESC+"OS";break;case 116:f.key=n?d.C0.ESC+"[15;"+(n+1)+"~":d.C0.ESC+"[15~";break;case 117:f.key=n?d.C0.ESC+"[17;"+(n+1)+"~":d.C0.ESC+"[17~";break;case 118:f.key=n?d.C0.ESC+"[18;"+(n+1)+"~":d.C0.ESC+"[18~";break;case 119:f.key=n?d.C0.ESC+"[19;"+(n+1)+"~":d.C0.ESC+"[19~";break;case 120:f.key=n?d.C0.ESC+"[20;"+(n+1)+"~":d.C0.ESC+"[20~";break;case 121:f.key=n?d.C0.ESC+"[21;"+(n+1)+"~":d.C0.ESC+"[21~";break;case 122:f.key=n?d.C0.ESC+"[23;"+(n+1)+"~":d.C0.ESC+"[23~";break;case 123:f.key=n?d.C0.ESC+"[24;"+(n+1)+"~":d.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(S&&!w||!a.altKey||a.metaKey)!S||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?f.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(f.key=d.C0.US),a.key==="@"&&(f.key=d.C0.NUL)):a.keyCode===65&&(f.type=1);else{const c=v[a.keyCode],o=c==null?void 0:c[a.shiftKey?1:0];if(o)f.key=d.C0.ESC+o;else if(a.keyCode>=65&&a.keyCode<=90){const h=a.ctrlKey?a.keyCode-64:a.keyCode+32;let m=String.fromCharCode(h);a.shiftKey&&(m=m.toUpperCase()),f.key=d.C0.ESC+m}else if(a.keyCode===32)f.key=d.C0.ESC+(a.ctrlKey?d.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let h=a.code.slice(3,4);a.shiftKey||(h=h.toLowerCase()),f.key=d.C0.ESC+h,f.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?f.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?f.key=d.C0.NUL:a.keyCode>=51&&a.keyCode<=55?f.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?f.key=d.C0.DEL:a.keyCode===219?f.key=d.C0.ESC:a.keyCode===220?f.key=d.C0.FS:a.keyCode===221&&(f.key=d.C0.GS)}return f}},482:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},s.utf32ToString=function(u,d=0,v=u.length){let a="";for(let p=d;p<v;++p){let S=u[p];S>65535?(S-=65536,a+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):a+=String.fromCharCode(S)}return a},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const v=u.length;if(!v)return 0;let a=0,p=0;if(this._interim){const S=u.charCodeAt(p++);56320<=S&&S<=57343?d[a++]=1024*(this._interim-55296)+S-56320+65536:(d[a++]=this._interim,d[a++]=S),this._interim=0}for(let S=p;S<v;++S){const w=u.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=v)return this._interim=w,a;const f=u.charCodeAt(S);56320<=f&&f<=57343?d[a++]=1024*(w-55296)+f-56320+65536:(d[a++]=w,d[a++]=f)}else w!==65279&&(d[a++]=w)}return a}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const v=u.length;if(!v)return 0;let a,p,S,w,f=0,n=0,c=0;if(this.interim[0]){let m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let y,E=0;for(;(y=63&this.interim[++E])&&E<4;)x<<=6,x|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=b-E;for(;c<R;){if(c>=v)return 0;if(y=u[c++],(192&y)!=128){c--,m=!0;break}this.interim[E++]=y,x<<=6,x|=63&y}m||(b===2?x<128?c--:d[f++]=x:b===3?x<2048||x>=55296&&x<=57343||x===65279||(d[f++]=x):x<65536||x>1114111||(d[f++]=x)),this.interim.fill(0)}const o=v-4;let h=c;for(;h<v;){for(;!(!(h<o)||128&(a=u[h])||128&(p=u[h+1])||128&(S=u[h+2])||128&(w=u[h+3]));)d[f++]=a,d[f++]=p,d[f++]=S,d[f++]=w,h+=4;if(a=u[h++],a<128)d[f++]=a;else if((224&a)==192){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(n=(31&a)<<6|63&p,n<128){h--;continue}d[f++]=n}else if((240&a)==224){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,f;if(S=u[h++],(192&S)!=128){h--;continue}if(n=(15&a)<<12|(63&p)<<6|63&S,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&a)==240){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,f;if(S=u[h++],(192&S)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=S,f;if(w=u[h++],(192&w)!=128){h--;continue}if(n=(7&a)<<18|(63&p)<<12|(63&S)<<6|63&w,n<65536||n>1114111)continue;d[f++]=n}}return f}}},225:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const d=u(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<v.length;++S)p.fill(0,v[S][0],v[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:(function(w,f){let n,c=0,o=f.length-1;if(w<f[0][0]||w>f[o][1])return!1;for(;o>=c;)if(n=c+o>>1,w>f[n][1])c=n+1;else{if(!(w<f[n][0]))return!0;o=n-1}return!1})(S,a)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let f=this.wcwidth(S),n=f===0&&w!==0;if(n){const c=d.UnicodeService.extractWidth(w);c===0?n=!1:c>f&&(f=c)}return d.UnicodeService.createPropertyValue(0,f,n)}}},5981:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const d=u(8460),v=u(844);class a extends v.Disposable{constructor(S){super(),this._action=S,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(S,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,w){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w)}_innerWrite(S=0,w=!0){const f=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],c=this._action(n,w);if(c){const h=m=>Date.now()-f>=12?setTimeout((()=>this._innerWrite(0,m))):this._innerWrite(f,m);return void c.catch((m=>(queueMicrotask((()=>{throw m})),Promise.resolve(!1)))).then(h)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-f>=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()}}s.WriteBuffer=a},5941:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function v(a,p){const S=a.toString(16),w=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(a){if(!a)return;let p=a.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=u.exec(p);if(S){const w=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/w*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/w*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,w=[0,0,0];for(let f=0;f<3;++f){const n=parseInt(p.slice(S*f,S*f+S),16);w[f]=S===1?n<<4:S===2?n:S===3?n>>4:n>>8}return w}},s.toRgbString=function(a,p=16){const[S,w,f]=a;return`rgb:${v(S,p)}/${v(w,p)}/${v(f,p)}`}},5770:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const d=u(482),v=u(8742),a=u(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,f){this._handlers[w]===void 0&&(this._handlers[w]=[]);const n=this._handlers[w];return n.push(f),{dispose:()=>{const c=n.indexOf(f);c!==-1&&n.splice(c,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,f){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(w,f,n){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(w,f,n);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,f,n))}unhook(w,f=!0){if(this._active.length){let n=!1,c=this._active.length-1,o=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,n=f,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;c>=0&&(n=this._active[c].unhook(w),n!==!0);c--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,n;c--}for(;c>=0;c--)if(n=this._active[c].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const S=new v.Params;S.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=S,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():S,this._data="",this._hitLimit=!1}put(w,f,n){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,f,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let f=!1;if(this._hitLimit)f=!1;else if(w&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then((n=>(this._params=S,this._data="",this._hitLimit=!1,n)));return this._params=S,this._data="",this._hitLimit=!1,f}}},2015:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const d=u(844),v=u(8742),a=u(6242),p=u(6351);class S{constructor(c){this.table=new Uint8Array(c)}setDefault(c,o){this.table.fill(c<<4|o)}add(c,o,h,m){this.table[o<<8|c]=h<<4|m}addMany(c,o,h,m){for(let x=0;x<c.length;x++)this.table[o<<8|c[x]]=h<<4|m}}s.TransitionTable=S;const w=160;s.VT500_TRANSITION_TABLE=(function(){const n=new S(4095),c=Array.apply(null,Array(256)).map(((E,b)=>b)),o=(E,b)=>c.slice(E,b),h=o(32,127),m=o(0,24);m.push(25),m.push.apply(m,o(28,32));const x=o(0,14);let y;for(y in n.setDefault(1,0),n.addMany(h,0,2,0),x)n.addMany([24,26,153,154],y,3,0),n.addMany(o(128,144),y,3,0),n.addMany(o(144,152),y,3,0),n.add(156,y,0,0),n.add(27,y,11,1),n.add(157,y,4,8),n.addMany([152,158,159],y,0,7),n.add(155,y,11,3),n.add(144,y,11,9);return n.addMany(m,0,3,0),n.addMany(m,1,3,1),n.add(127,1,0,1),n.addMany(m,8,0,8),n.addMany(m,3,3,3),n.add(127,3,0,3),n.addMany(m,4,3,4),n.add(127,4,0,4),n.addMany(m,6,3,6),n.addMany(m,5,3,5),n.add(127,5,0,5),n.addMany(m,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(h,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(h,7,0,7),n.addMany(m,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(m,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(m,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(m,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(m,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(m,13,13,13),n.addMany(h,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(w,0,2,0),n.add(w,8,5,8),n.add(w,6,0,6),n.add(w,11,0,11),n.add(w,13,13,13),n})();class f extends d.Disposable{constructor(c=s.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(o,h,m)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,h)=>{},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 a.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,o=[64,126]){let h=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=c.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<c.intermediates.length;++x){const y=c.intermediates.charCodeAt(x);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=y}}if(c.final.length!==1)throw new Error("final must be a single byte");const m=c.final.charCodeAt(0);if(o[0]>m||m>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return h<<=8,h|=m,h}identToString(c){const o=[];for(;c;)o.push(String.fromCharCode(255&c)),c>>=8;return o.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,o){const h=this._identifier(c,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const m=this._escHandlers[h];return m.push(o),{dispose:()=>{const x=m.indexOf(o);x!==-1&&m.splice(x,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,o){this._executeHandlers[c.charCodeAt(0)]=o}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,o){const h=this._identifier(c);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const m=this._csiHandlers[h];return m.push(o),{dispose:()=>{const x=m.indexOf(o);x!==-1&&m.splice(x,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,o){return this._dcsParser.registerHandler(this._identifier(c),o)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,o){return this._oscParser.registerHandler(c,o)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(c,o,h,m,x){this._parseStack.state=c,this._parseStack.handlers=o,this._parseStack.handlerPos=h,this._parseStack.transition=m,this._parseStack.chunkPos=x}parse(c,o,h){let m,x=0,y=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&R>-1){for(;R>=0&&(m=b[R](this._params),m!==!0);R--)if(m instanceof Promise)return this._parseStack.handlerPos=R,m}this._parseStack.handlers=[];break;case 4:if(h===!1&&R>-1){for(;R>=0&&(m=b[R](),m!==!0);R--)if(m instanceof Promise)return this._parseStack.handlerPos=R,m}this._parseStack.handlers=[];break;case 6:if(x=c[this._parseStack.chunkPos],m=this._dcsParser.unhook(x!==24&&x!==26,h),m)return m;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=c[this._parseStack.chunkPos],m=this._oscParser.end(x!==24&&x!==26,h),m)return m;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=E;b<o;++b){switch(x=c[b],y=this._transitions.table[this.currentState<<8|(x<160?x:w)],y>>4){case 2:for(let k=b+1;;++k){if(k>=o||(x=c[k])<32||x>126&&x<w){this._printHandler(c,b,k),b=k-1;break}if(++k>=o||(x=c[k])<32||x>126&&x<w){this._printHandler(c,b,k),b=k-1;break}if(++k>=o||(x=c[k])<32||x>126&&x<w){this._printHandler(c,b,k),b=k-1;break}if(++k>=o||(x=c[k])<32||x>126&&x<w){this._printHandler(c,b,k),b=k-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|x];let T=R?R.length-1:-1;for(;T>=0&&(m=R[T](this._params),m!==!0);T--)if(m instanceof Promise)return this._preserveStack(3,R,T,y,b),m;T<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++b<o&&(x=c[b])>47&&x<60);b--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const I=this._escHandlers[this._collect<<8|x];let M=I?I.length-1:-1;for(;M>=0&&(m=I[M](),m!==!0);M--)if(m instanceof Promise)return this._preserveStack(4,I,M,y,b),m;M<0&&this._escHandlerFb(this._collect<<8|x),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|x,this._params);break;case 13:for(let k=b+1;;++k)if(k>=o||(x=c[k])===24||x===26||x===27||x>127&&x<w){this._dcsParser.put(c,b,k),b=k-1;break}break;case 14:if(m=this._dcsParser.unhook(x!==24&&x!==26),m)return this._preserveStack(6,[],0,y,b),m;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let k=b+1;;k++)if(k>=o||(x=c[k])<32||x>127&&x<w){this._oscParser.put(c,b,k),b=k-1;break}break;case 6:if(m=this._oscParser.end(x!==24&&x!==26),m)return this._preserveStack(5,[],0,y,b),m;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}s.EscapeSequenceParser=f},6242:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const d=u(5770),v=u(482),a=[];s.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(S),{dispose:()=>{const f=w.indexOf(S);f!==-1&&w.splice(f,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,w){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(p,S,w);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(p,S,w))}start(){this.reset(),this._state=1}put(p,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const f=p[S++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&w-S>0&&this._put(p,S,w)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,f=this._active.length-1,n=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,w=S,n=this._stack.fallThrough,this._stack.paused=!1),!n&&w===!1){for(;f>=0&&(w=this._active[f].end(p),w!==!0);f--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,w;f--}for(;f>=0;f--)if(w=this._active[f].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=a,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,w){this._hitLimit||(this._data+=(0,v.utf32ToString)(p,S,w),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(S=this._handler(this._data),S instanceof Promise))return S.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,S}}},8742:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const u=2147483647;class d{static fromArray(a){const p=new d;if(!a.length)return p;for(let S=Array.isArray(a[0])?1:0;S<a.length;++S){const w=a[S];if(Array.isArray(w))for(let f=0;f<w.length;++f)p.addSubParam(w[f]);else p.addParam(w)}return p}constructor(a=32,p=32){if(this.maxLength=a,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new d(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let p=0;p<this.length;++p){a.push(this.params[p]);const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&a.push(Array.prototype.slice.call(this._subParams,S,w))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>u?u:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>u?u:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const p=this._subParamsIdx[a]>>8,S=255&this._subParamsIdx[a];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const a={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&(a[p]=this._subParams.slice(S,w))}return a}addDigit(a){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[p-1];S[p-1]=~w?Math.min(10*w+a,u):a}}s.Params=d},5741:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const v={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(v),d.dispose=()=>this._wrappedAddonDispose(v),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===u){d=v;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const d=u(3785),v=u(511);s.BufferApiView=class{constructor(a,p){this._buffer=a,this.type=p}init(a){return this._buffer=a,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(a){const p=this._buffer.lines.get(a);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new v.CellData}}},3785:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const d=u(511);s.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,a){if(!(v<0||v>=this._line.length))return a?(this._line.loadCell(v,a),a):this._line.loadCell(v,new d.CellData)}translateToString(v,a,p){return this._line.translateToString(v,a,p)}}},8285:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const d=u(8771),v=u(8460),a=u(844);class p extends a.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new v.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)}}s.BufferNamespaceApi=p},7975:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(v=>d(v.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((v,a)=>d(v,a.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(H,s,u){var d=this&&this.__decorate||function(n,c,o,h){var m,x=arguments.length,y=x<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,c,o,h);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(y=(x<3?m(y):x>3?m(c,o,y):m(c,o))||y);return x>3&&y&&Object.defineProperty(c,o,y),y},v=this&&this.__param||function(n,c){return function(o,h){c(o,h,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const a=u(8460),p=u(844),S=u(5295),w=u(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let f=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(n,this))}resize(n,c){this.cols=n,this.rows=c,this.buffers.resize(n,c),this._onResize.fire({cols:n,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,c=!1){const o=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===n.fg&&h.getBg(0)===n.bg||(h=o.getBlankLine(n,c),this._cachedBlankLine=h),h.isWrapped=c;const m=o.ybase+o.scrollTop,x=o.ybase+o.scrollBottom;if(o.scrollTop===0){const y=o.lines.isFull;x===o.lines.length-1?y?o.lines.recycle().copyFrom(h):o.lines.push(h.clone()):o.lines.splice(x+1,0,h.clone()),y?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const y=x-m+1;o.lines.shiftElements(m+1,y-1,-1),o.lines.set(x,h.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,c,o){const h=this.buffer;if(n<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else n+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const m=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+n,h.ybase),0),m!==h.ydisp&&(c||this._onScroll.fire(h.ydisp))}};s.BufferService=f=d([v(0,w.IOptionsService)],f)},7994:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(H,s,u){var d=this&&this.__decorate||function(h,m,x,y){var E,b=arguments.length,R=b<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(h,m,x,y);else for(var T=h.length-1;T>=0;T--)(E=h[T])&&(R=(b<3?E(R):b>3?E(m,x,R):E(m,x))||R);return b>3&&R&&Object.defineProperty(m,x,R),R},v=this&&this.__param||function(h,m){return function(x,y){m(x,y,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const a=u(2585),p=u(8460),S=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function f(h,m){let x=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(x|=64,x|=h.action):(x|=3&h.button,4&h.button&&(x|=64),8&h.button&&(x|=128),h.action===32?x|=32:h.action!==0||m||(x|=3)),x}const n=String.fromCharCode,c={DEFAULT:h=>{const m=[f(h,!1)+32,h.col+32,h.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${n(m[0])}${n(m[1])}${n(m[2])}`},SGR:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${f(h,!0)};${h.col};${h.row}${m}`},SGR_PIXELS:h=>{const m=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${f(h,!0)};${h.x};${h.y}${m}`}};let o=s.CoreMouseService=class extends S.Disposable{constructor(h,m){super(),this._bufferService=h,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(w))this.addProtocol(x,w[x]);for(const x of Object.keys(c))this.addEncoding(x,c[x]);this.reset()}addProtocol(h,m){this._protocols[h]=m}addEncoding(h,m){this._encodings[h]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const m=this._encodings[this._activeEncoding](h);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,m,x){if(x){if(h.x!==m.x||h.y!==m.y)return!1}else if(h.col!==m.col||h.row!==m.row)return!1;return h.button===m.button&&h.action===m.action&&h.ctrl===m.ctrl&&h.alt===m.alt&&h.shift===m.shift}};s.CoreMouseService=o=d([v(0,a.IBufferService),v(1,a.ICoreService)],o)},6975:function(H,s,u){var d=this&&this.__decorate||function(o,h,m,x){var y,E=arguments.length,b=E<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,h,m,x);else for(var R=o.length-1;R>=0;R--)(y=o[R])&&(b=(E<3?y(b):E>3?y(h,m,b):y(h,m))||b);return E>3&&b&&Object.defineProperty(h,m,b),b},v=this&&this.__param||function(o,h){return function(m,x){h(m,x,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const a=u(1439),p=u(8460),S=u(844),w=u(2585),f=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=s.CoreService=class extends S.Disposable{constructor(o,h,m){super(),this._bufferService=o,this._logService=h,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(f),this.decPrivateModes=(0,a.clone)(n)}reset(){this.modes=(0,a.clone)(f),this.decPrivateModes=(0,a.clone)(n)}triggerDataEvent(o,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(o))}};s.CoreService=c=d([v(0,w.IBufferService),v(1,w.ILogService),v(2,w.IOptionsService)],c)},9074:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const d=u(8055),v=u(8460),a=u(844),p=u(6106);let S=0,w=0;class f extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((o=>o==null?void 0:o.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const h=new n(o);if(h){const m=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),m.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,h,m){let x=0,y=0;for(const E of this._decorations.getKeyIterator(h))x=E.options.x??0,y=x+(E.options.width??1),o>=x&&o<y&&(!m||(E.options.layer??"bottom")===m)&&(yield E)}forEachDecorationAtCell(o,h,m,x){this._decorations.forEachByKey(h,(y=>{S=y.options.x??0,w=S+(y.options.width??1),o>=S&&o<w&&(!m||(y.options.layer??"bottom")===m)&&x(y)}))}}s.DecorationService=f;class n extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.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:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const d=u(2585),v=u(8343);class a{constructor(...S){this._entries=new Map;for(const[w,f]of S)this.set(w,f)}set(S,w){const f=this._entries.get(S);return this._entries.set(S,w),f}forEach(S){for(const[w,f]of this._entries.entries())S(w,f)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}s.ServiceCollection=a,s.InstantiationService=class{constructor(){this._services=new a,this._services.set(d.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const w=(0,v.getServiceDependencies)(p).sort(((c,o)=>c.index-o.index)),f=[];for(const c of w){const o=this._services.get(c.id);if(!o)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${c.id}.`);f.push(o)}const n=w.length>0?w[0].index:S.length;if(S.length!==n)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${n+1} conflicts with ${S.length} static arguments`);return new p(...S,...f)}}},7866:function(H,s,u){var d=this&&this.__decorate||function(n,c,o,h){var m,x=arguments.length,y=x<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,c,o,h);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(y=(x<3?m(y):x>3?m(c,o,y):m(c,o))||y);return x>3&&y&&Object.defineProperty(c,o,y),y},v=this&&this.__param||function(n,c){return function(o,h){c(o,h,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const a=u(844),p=u(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,f=s.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let c=0;c<n.length;c++)typeof n[c]=="function"&&(n[c]=n[c]())}_log(n,c,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(n,...c){var o;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,c)}debug(n,...c){var o;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,c)}info(n,...c){var o;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,c)}warn(n,...c){var o;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,c)}error(n,...c){var o;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,c)}};s.LogService=f=d([v(0,p.IOptionsService)],f),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,c,o){if(typeof o.value!="function")throw new Error("not supported");const h=o.value;o.value=function(...m){if(w.logLevel!==p.LogLevelEnum.TRACE)return h.apply(this,m);w.trace(`GlyphRenderer#${h.name}(${m.map((y=>JSON.stringify(y))).join(", ")})`);const x=h.apply(this,m);return w.trace(`GlyphRenderer#${h.name} return`,x),x}}},7302:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const d=u(8460),v=u(844),a=u(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends v.Disposable{constructor(f){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...s.DEFAULT_OPTIONS};for(const c in f)if(c in n)try{const o=f[c];n[c]=this._sanitizeAndValidateOption(c,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(f,n){return this.onOptionChange((c=>{c===f&&n(this.rawOptions[f])}))}onMultipleOptionChange(f,n){return this.onOptionChange((c=>{f.indexOf(c)!==-1&&n()}))}_setupOptions(){const f=c=>{if(!(c in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},n=(c,o)=>{if(!(c in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);o=this._sanitizeAndValidateOption(c,o),this.rawOptions[c]!==o&&(this.rawOptions[c]=o,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const o={get:f.bind(this,c),set:n.bind(this,c)};Object.defineProperty(this.options,c,o)}}_sanitizeAndValidateOption(f,n){switch(f){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[f]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${f}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=p.includes(n)?n:s.DEFAULT_OPTIONS[f];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${f} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${f} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=S},2660:function(H,s,u){var d=this&&this.__decorate||function(S,w,f,n){var c,o=arguments.length,h=o<3?w:n===null?n=Object.getOwnPropertyDescriptor(w,f):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(S,w,f,n);else for(var m=S.length-1;m>=0;m--)(c=S[m])&&(h=(o<3?c(h):o>3?c(w,f,h):c(w,f))||h);return o>3&&h&&Object.defineProperty(w,f,h),h},v=this&&this.__param||function(S,w){return function(f,n){w(f,n,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const a=u(2585);let p=s.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const w=this._bufferService.buffer;if(S.id===void 0){const m=w.addMarker(w.ybase+w.y),x={data:S,id:this._nextId++,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(x,m))),this._dataByLinkId.set(x.id,x),x.id}const f=S,n=this._getEntryIdKey(f),c=this._entriesWithId.get(n);if(c)return this.addLineToLink(c.id,w.ybase+w.y),c.id;const o=w.addMarker(w.ybase+w.y),h={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(h,o))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(S,w){const f=this._dataByLinkId.get(S);if(f&&f.lines.every((n=>n.line!==w))){const n=this._bufferService.buffer.addMarker(w);f.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(f,n)))}}getLinkData(S){var w;return(w=this._dataByLinkId.get(S))==null?void 0:w.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,w){const f=S.lines.indexOf(w);f!==-1&&(S.lines.splice(f,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};s.OscLinkService=p=d([v(0,a.IBufferService)],p)},8343:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const u="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(v){return v[d]||[]},s.createDecorator=function(v){if(s.serviceRegistry.has(v))return s.serviceRegistry.get(v);const a=function(p,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,c){n[u]===n?n[d].push({id:f,index:c}):(n[d]=[{id:f,index:c}],n[u]=n)})(a,p,w)};return a.toString=()=>v,s.serviceRegistry.set(v,a),a}},2585:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=u(8343);var v;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(v||(s.LogLevelEnum=v={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=u(8460),v=u(225);class a{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,f=!1){return(16777215&S)<<3|(3&w)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new v.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,f=0;const n=S.length;for(let c=0;c<n;++c){let o=S.charCodeAt(c);if(55296<=o&&o<=56319){if(++c>=n)return w+this.wcwidth(o);const x=S.charCodeAt(c);56320<=x&&x<=57343?o=1024*(o-55296)+x-56320+65536:w+=this.wcwidth(x)}const h=this.charProperties(o,f);let m=a.extractWidth(h);a.extractShouldJoin(h)&&(m-=a.extractWidth(f)),w+=m,f=h}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}s.UnicodeService=a}},A={};function z(H){var s=A[H];if(s!==void 0)return s.exports;var u=A[H]={exports:{}};return D[H].call(u.exports,u,u.exports,z),u.exports}var P={};return(()=>{var H=P;Object.defineProperty(H,"__esModule",{value:!0}),H.Terminal=void 0;const s=z(9042),u=z(3236),d=z(844),v=z(5741),a=z(8285),p=z(7975),S=z(7090),w=["cols","rows"];class f extends d.Disposable{constructor(c){super(),this._core=this.register(new u.Terminal(c)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const o=m=>this._core.options[m],h=(m,x)=>{this._checkReadonlyOptions(m),this._core.options[m]=x};for(const m in this._core.options){const x={get:o.bind(this,m),set:h.bind(this,m)};Object.defineProperty(this._publicOptions,m,x)}}_checkReadonlyOptions(c){if(w.includes(c))throw new Error(`Option "${c}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=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:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const o in c)this._publicOptions[o]=c[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,o=!0){this._core.input(c,o)}resize(c,o){this._verifyIntegers(c,o),this._core.resize(c,o)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,o,h){this._verifyIntegers(c,o,h),this._core.select(c,o,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,o){this._verifyIntegers(c,o),this._core.selectLines(c,o)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,o){this._core.write(c,o)}writeln(c,o){this._core.write(c),this._core.write(`\r
|
|
82
|
+
`,o)}paste(c){this._core.paste(c)}refresh(c,o){this._verifyIntegers(c,o),this._core.refresh(c,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return s}_verifyIntegers(...c){for(const o of c)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const o of c)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}H.Terminal=f})(),P})()))})(Tc)),Tc.exports}var nm=sm(),Mc={exports:{}},C_;function am(){return C_||(C_=1,(function(_,C){(function(D,A){_.exports=A()})(self,(()=>(()=>{var D={};return(()=>{var A=D;Object.defineProperty(A,"__esModule",{value:!0}),A.FitAddon=void 0,A.FitAddon=class{activate(z){this._terminal=z}dispose(){}fit(){const z=this.proposeDimensions();if(!z||!this._terminal||isNaN(z.cols)||isNaN(z.rows))return;const P=this._terminal._core;this._terminal.rows===z.rows&&this._terminal.cols===z.cols||(P._renderService.clear(),this._terminal.resize(z.cols,z.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const z=this._terminal._core,P=z._renderService.dimensions;if(P.css.cell.width===0||P.css.cell.height===0)return;const H=this._terminal.options.scrollback===0?0:z.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(s.getPropertyValue("height")),d=Math.max(0,parseInt(s.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),a=u-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),p=d-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-H;return{cols:Math.max(2,Math.floor(p/P.css.cell.width)),rows:Math.max(1,Math.floor(a/P.css.cell.height))}}}})(),D})()))})(Mc)),Mc.exports}var om=am(),Oc={exports:{}},w_;function lm(){return w_||(w_=1,(function(_,C){(function(D,A){_.exports=A()})(self,(()=>(()=>{var D={965:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const d=u(374),v=u(509),a=u(855),p=u(859),S=u(381),w=11,f=w*Float32Array.BYTES_PER_ELEMENT;let n,c=0,o=0,h=0;class m extends p.Disposable{constructor(y,E,b,R){super(),this._terminal=y,this._gl=E,this._dimensions=b,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const T=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,S.createProgram)(T,`#version 300 es
|
|
83
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
84
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
85
|
+
layout (location = 2) in vec2 a_offset;
|
|
86
|
+
layout (location = 3) in vec2 a_size;
|
|
87
|
+
layout (location = 4) in float a_texpage;
|
|
88
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
89
|
+
layout (location = 6) in vec2 a_texsize;
|
|
90
|
+
|
|
91
|
+
uniform mat4 u_projection;
|
|
92
|
+
uniform vec2 u_resolution;
|
|
93
|
+
|
|
94
|
+
out vec2 v_texcoord;
|
|
95
|
+
flat out int v_texpage;
|
|
96
|
+
|
|
97
|
+
void main() {
|
|
98
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
99
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
100
|
+
v_texpage = int(a_texpage);
|
|
101
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
102
|
+
}`,(function(W){let $="";for(let V=1;V<W;V++)$+=` else if (v_texpage == ${V}) { outColor = texture(u_texture[${V}], v_texcoord); }`;return`#version 300 es
|
|
103
|
+
precision lowp float;
|
|
104
|
+
|
|
105
|
+
in vec2 v_texcoord;
|
|
106
|
+
flat in int v_texpage;
|
|
107
|
+
|
|
108
|
+
uniform sampler2D u_texture[${W}];
|
|
109
|
+
|
|
110
|
+
out vec4 outColor;
|
|
111
|
+
|
|
112
|
+
void main() {
|
|
113
|
+
if (v_texpage == 0) {
|
|
114
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
115
|
+
} ${$}
|
|
116
|
+
}`})(v.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>T.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),M=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer(M)))),T.bindBuffer(T.ARRAY_BUFFER,M),T.bufferData(T.ARRAY_BUFFER,I,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const k=new Uint8Array([0,1,2,3]),U=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer(U)))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,U),T.bufferData(T.ELEMENT_ARRAY_BUFFER,k,T.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(T.createBuffer()),this.register((0,p.toDisposable)((()=>T.deleteBuffer(this._attributesBuffer)))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,f,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);const K=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let W=0;W<v.TextureAtlas.maxAtlasPages;W++)K[W]=W;T.uniform1iv(this._textureLocation,K),T.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),this._atlasTextures=[];for(let W=0;W<v.TextureAtlas.maxAtlasPages;W++){const $=new S.GLTexture((0,d.throwIfFalsy)(T.createTexture()));this.register((0,p.toDisposable)((()=>T.deleteTexture($.texture)))),T.activeTexture(T.TEXTURE0+W),T.bindTexture(T.TEXTURE_2D,$.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[W]=$}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(y,E,b,R,T,I,M,k,U){this._updateCell(this._vertices.attributes,y,E,b,R,T,I,M,k,U)}_updateCell(y,E,b,R,T,I,M,k,U,K){c=(b*this._terminal.cols+E)*w,R!==a.NULL_CELL_CODE&&R!==void 0?this._atlas&&(n=k&&k.length>1?this._atlas.getRasterizedGlyphCombinedChar(k,T,I,M,!1):this._atlas.getRasterizedGlyph(R,T,I,M,!1),o=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==K&&n.offset.x>o?(h=n.offset.x-o,y[c]=-(n.offset.x-h)+this._dimensions.device.char.left,y[c+1]=-n.offset.y+this._dimensions.device.char.top,y[c+2]=(n.size.x-h)/this._dimensions.device.canvas.width,y[c+3]=n.size.y/this._dimensions.device.canvas.height,y[c+4]=n.texturePage,y[c+5]=n.texturePositionClipSpace.x+h/this._atlas.pages[n.texturePage].canvas.width,y[c+6]=n.texturePositionClipSpace.y,y[c+7]=n.sizeClipSpace.x-h/this._atlas.pages[n.texturePage].canvas.width,y[c+8]=n.sizeClipSpace.y):(y[c]=-n.offset.x+this._dimensions.device.char.left,y[c+1]=-n.offset.y+this._dimensions.device.char.top,y[c+2]=n.size.x/this._dimensions.device.canvas.width,y[c+3]=n.size.y/this._dimensions.device.canvas.height,y[c+4]=n.texturePage,y[c+5]=n.texturePositionClipSpace.x,y[c+6]=n.texturePositionClipSpace.y,y[c+7]=n.sizeClipSpace.x,y[c+8]=n.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(R,U,n.size.x,this._dimensions.device.cell.width)&&(y[c+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):y.fill(0,c,c+w-1-2)}clear(){const y=this._terminal,E=y.cols*y.rows*w;this._vertices.count!==E?this._vertices.attributes=new Float32Array(E):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==E?this._vertices.attributesBuffers[b]=new Float32Array(E):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=E,b=0;for(let R=0;R<y.rows;R++)for(let T=0;T<y.cols;T++)this._vertices.attributes[b+9]=T/y.cols,this._vertices.attributes[b+10]=R/y.rows,b+=w}handleResize(){const y=this._gl;y.useProgram(this._program),y.viewport(0,0,y.canvas.width,y.canvas.height),y.uniform2f(this._resolutionLocation,y.canvas.width,y.canvas.height),this.clear()}render(y){if(!this._atlas)return;const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let T=0;T<y.lineLengths.length;T++){const I=T*this._terminal.cols*w,M=this._vertices.attributes.subarray(I,I+y.lineLengths[T]*w);b.set(M,R),R+=M.length}E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,b.subarray(0,R),E.STREAM_DRAW);for(let T=0;T<this._atlas.pages.length;T++)this._atlas.pages[T].version!==this._atlasTextures[T].version&&this._bindAtlasPageTexture(E,this._atlas,T);E.drawElementsInstanced(E.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,R/w)}setAtlas(y){this._atlas=y;for(const E of this._atlasTextures)E.version=-1}_bindAtlasPageTexture(y,E,b){y.activeTexture(y.TEXTURE0+b),y.bindTexture(y.TEXTURE_2D,this._atlasTextures[b].texture),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,E.pages[b].canvas),y.generateMipmap(y.TEXTURE_2D),this._atlasTextures[b].version=E.pages[b].version}setDimensions(y){this._dimensions=y}}s.GlyphRenderer=m},742:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const d=u(374),v=u(859),a=u(310),p=u(381),S=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,n=0,c=0,o=0,h=0,m=0,x=0;class y extends v.Disposable{constructor(b,R,T,I){super(),this._terminal=b,this._gl=R,this._dimensions=T,this._themeService=I,this._vertices=new w,this._verticesCursor=new w;const M=this._gl;this._program=(0,d.throwIfFalsy)((0,p.createProgram)(M,`#version 300 es
|
|
117
|
+
layout (location = 0) in vec2 a_position;
|
|
118
|
+
layout (location = 1) in vec2 a_size;
|
|
119
|
+
layout (location = 2) in vec4 a_color;
|
|
120
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
121
|
+
|
|
122
|
+
uniform mat4 u_projection;
|
|
123
|
+
|
|
124
|
+
out vec4 v_color;
|
|
125
|
+
|
|
126
|
+
void main() {
|
|
127
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
128
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
129
|
+
v_color = a_color;
|
|
130
|
+
}`,`#version 300 es
|
|
131
|
+
precision lowp float;
|
|
132
|
+
|
|
133
|
+
in vec4 v_color;
|
|
134
|
+
|
|
135
|
+
out vec4 outColor;
|
|
136
|
+
|
|
137
|
+
void main() {
|
|
138
|
+
outColor = v_color;
|
|
139
|
+
}`)),this.register((0,v.toDisposable)((()=>M.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const k=new Float32Array([0,0,1,0,0,1,1,1]),U=M.createBuffer();this.register((0,v.toDisposable)((()=>M.deleteBuffer(U)))),M.bindBuffer(M.ARRAY_BUFFER,U),M.bufferData(M.ARRAY_BUFFER,k,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const K=new Uint8Array([0,1,2,3]),W=M.createBuffer();this.register((0,v.toDisposable)((()=>M.deleteBuffer(W)))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,W),M.bufferData(M.ELEMENT_ARRAY_BUFFER,K,M.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(M.createBuffer()),this.register((0,v.toDisposable)((()=>M.deleteBuffer(this._attributesBuffer)))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,S,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,S,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,S,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors(($=>{this._updateCachedColors($),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,b.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(b){const R=this._terminal,T=this._vertices;let I,M,k,U,K,W,$,V,O,q,B,j=1;for(I=0;I<R.rows;I++){for(k=-1,U=0,K=0,W=!1,M=0;M<R.cols;M++)$=(I*R.cols+M)*a.RENDER_MODEL_INDICIES_PER_CELL,V=b.cells[$+a.RENDER_MODEL_BG_OFFSET],O=b.cells[$+a.RENDER_MODEL_FG_OFFSET],q=!!(67108864&O),(V!==U||O!==K&&(W||q))&&((U!==0||W&&K!==0)&&(B=8*j++,this._updateRectangle(T,B,K,U,k,M,I)),k=M,U=V,K=O,W=q);(U!==0||W&&K!==0)&&(B=8*j++,this._updateRectangle(T,B,K,U,k,R.cols,I))}T.count=j}updateCursor(b){const R=this._verticesCursor,T=b.cursor;if(!T||T.style==="block")return void(R.count=0);let I,M=0;T.style!=="bar"&&T.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.style==="bar"?T.dpr*T.cursorWidth:T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.style!=="underline"&&T.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,(T.y+1)*this._dimensions.device.cell.height-T.dpr,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat)),T.style==="outline"&&(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat),I=8*M++,this._addRectangleFloat(R.attributes,I,(T.x+T.width)*this._dimensions.device.cell.width-T.dpr,T.y*this._dimensions.device.cell.height,T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=M}_updateRectangle(b,R,T,I,M,k,U){if(67108864&T)switch(50331648&T){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&T].rgba;break;case 50331648:f=(16777215&T)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:f=(16777215&I)<<8;break;default:f=this._themeService.colors.background.rgba}b.attributes.length<R+4&&(b.attributes=(0,p.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),n=M*this._dimensions.device.cell.width,c=U*this._dimensions.device.cell.height,o=(f>>24&255)/255,h=(f>>16&255)/255,m=(f>>8&255)/255,x=1,this._addRectangle(b.attributes,R,n,c,(k-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,o,h,m,x)}_addRectangle(b,R,T,I,M,k,U,K,W,$){b[R]=T/this._dimensions.device.canvas.width,b[R+1]=I/this._dimensions.device.canvas.height,b[R+2]=M/this._dimensions.device.canvas.width,b[R+3]=k/this._dimensions.device.canvas.height,b[R+4]=U,b[R+5]=K,b[R+6]=W,b[R+7]=$}_addRectangleFloat(b,R,T,I,M,k,U){b[R]=T/this._dimensions.device.canvas.width,b[R+1]=I/this._dimensions.device.canvas.height,b[R+2]=M/this._dimensions.device.canvas.width,b[R+3]=k/this._dimensions.device.canvas.height,b[R+4]=U[0],b[R+5]=U[1],b[R+6]=U[2],b[R+7]=U[3]}_colorToFloat32Array(b){return new Float32Array([(b.rgba>>24&255)/255,(b.rgba>>16&255)/255,(b.rgba>>8&255)/255,(255&b.rgba)/255])}}s.RectangleRenderer=y},310:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(v,a){const p=v*a*s.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const d=u(820),v=u(274),a=u(627),p=u(457),S=u(56),w=u(374),f=u(345),n=u(859),c=u(147),o=u(782),h=u(855),m=u(965),x=u(742),y=u(310),E=u(733);class b extends n.Disposable{constructor(M,k,U,K,W,$,V,O,q){super(),this._terminal=M,this._characterJoinerService=k,this._charSizeService=U,this._coreBrowserService=K,this._coreService=W,this._decorationService=$,this._optionsService=V,this._themeService=O,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this.register(new n.MutableDisposable),this._observerDisposable=this.register(new n.MutableDisposable),this._model=new y.RenderModel,this._workCell=new o.CellData,this._workCell2=new o.CellData,this._rectangleRenderer=this.register(new n.MutableDisposable),this._glyphRenderer=this.register(new n.MutableDisposable),this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new f.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new f.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new E.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,V,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(V.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const B={antialias:!1,depth:!1,preserveDrawingBuffer:q};if(this._gl=this._canvas.getContext("webgl2",B),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(j=>{console.log("webglcontextlost event received"),j.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(j)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(j=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,a.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((j,Q)=>this._setCanvasDevicePixelDimensions(j,Q))),this.register(this._coreBrowserService.onWindowChange((j=>{this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,j,((Q,J)=>this._setCanvasDevicePixelDimensions(Q,J)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,n.toDisposable)((()=>{var j;for(const Q of this._renderLayers)Q.dispose();(j=this._canvas.parentElement)==null||j.removeChild(this._canvas),(0,a.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,k){var U,K,W,$;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(U=this._rectangleRenderer.value)==null||U.setDimensions(this.dimensions),(K=this._rectangleRenderer.value)==null||K.handleResize(),(W=this._glyphRenderer.value)==null||W.setDimensions(this.dimensions),($=this._glyphRenderer.value)==null||$.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const k of this._renderLayers)k.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const k of this._renderLayers)k.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,k,U){for(const K of this._renderLayers)K.handleSelectionChanged(this._terminal,M,k,U);this._model.selection.update(this._core,M,k,U),this._requestRedrawViewport()}handleCursorMove(){var M;for(const k of this._renderLayers)k.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new m.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var k;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,a.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,n.getDisposeArrayDisposable)([(0,f.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,f.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(k=this._glyphRenderer.value)==null||k.setAtlas(this._charAtlas)}_clearModel(M){var k;this._model.clear(),M&&((k=this._glyphRenderer.value)==null||k.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const k of this._renderLayers)k.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,k){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,M,k);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,k),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,k){const U=this._core;let K,W,$,V,O,q,B,j,Q,J,ue,he,X,F,ae=this._workCell;M=T(M,U.rows-1,0),k=T(k,U.rows-1,0);const ie=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=ie-U.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let ye=-1;const ge=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Te=!1;for(W=M;W<=k;W++)for($=W+U.buffer.ydisp,V=U.buffer.lines.get($),this._model.lineLengths[W]=0,O=this._characterJoinerService.getJoinedCharacters($),X=0;X<U.cols;X++)if(K=this._cellColorResolver.result.bg,V.loadCell(X,ae),X===0&&(K=this._cellColorResolver.result.bg),q=!1,B=X,O.length>0&&X===O[0][0]&&(q=!0,j=O.shift(),ae=new R(ae,V.translateToString(!0,j[0],j[1]),j[1]-j[0]),B=j[1]-1),Q=ae.getChars(),J=ae.getCode(),he=(W*U.cols+X)*y.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ae,X,$,this.dimensions.device.cell.width),ge&&$===ie&&(X===fe&&(this._model.cursor={x:fe,y:_e,width:ae.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},ye=fe+ae.getWidth()-1),X>=fe&&X<=ye&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),J!==h.NULL_CELL_CODE&&(this._model.lineLengths[W]=X+1),(this._model.cells[he]!==J||this._model.cells[he+y.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[he+y.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[he+y.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Te=!0,Q.length>1&&(J|=y.COMBINED_CHAR_BIT_MASK),this._model.cells[he]=J,this._model.cells[he+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[he+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[he+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ue=ae.getWidth(),this._glyphRenderer.value.updateCell(X,W,J,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Q,ue,K),q))for(ae=this._workCell,X++;X<B;X++)F=(W*U.cols+X)*y.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(X,W,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[F]=h.NULL_CELL_CODE,this._model.cells[F+y.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[F+y.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[F+y.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Te&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,k){this._canvas.width===M&&this._canvas.height===k||(this._canvas.width=M,this._canvas.height=k,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}s.WebglRenderer=b;class R extends c.AttributeData{constructor(M,k,U){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=k,this._width=U}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function T(I,M,k=0){return Math.max(Math.min(I,M),k)}s.JoinedCellData=R},381:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const d=u(374);function v(a,p,S){const w=(0,d.throwIfFalsy)(a.createShader(p));if(a.shaderSource(w,S),a.compileShader(w),a.getShaderParameter(w,a.COMPILE_STATUS))return w;console.error(a.getShaderInfoLog(w)),a.deleteShader(w)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(a,p,S){const w=(0,d.throwIfFalsy)(a.createProgram());if(a.attachShader(w,(0,d.throwIfFalsy)(v(a,a.VERTEX_SHADER,p))),a.attachShader(w,(0,d.throwIfFalsy)(v(a,a.FRAGMENT_SHADER,S))),a.linkProgram(w),a.getProgramParameter(w,a.LINK_STATUS))return w;console.error(a.getProgramInfoLog(w)),a.deleteProgram(w)},s.createShader=v,s.expandFloat32Array=function(a,p){const S=Math.min(2*a.length,p),w=new Float32Array(S);for(let f=0;f<a.length;f++)w[f]=a[f];return w},s.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const d=u(627),v=u(237),a=u(374),p=u(859);class S extends p.Disposable{constructor(f,n,c,o,h,m,x,y){super(),this._container=n,this._alpha=h,this._coreBrowserService=m,this._optionsService=x,this._themeService=y,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${c}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((E=>{this._refreshCharAtlas(f,E),this.reset(f)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,c){}handleSelectionChanged(f,n,c,o=!1){}_setTransparency(f,n){if(n===this._alpha)return;const c=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,c=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,c*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,n,c,o){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,c*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,c*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(f,n,c,o){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(c,o,n.getWidth()),this._ctx.fillText(n.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,c){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,c*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,c){return`${c?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}s.BaseRenderLayer=S},733:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const d=u(197),v=u(237),a=u(592);class p extends a.BaseRenderLayer{constructor(w,f,n,c,o,h,m){super(n,w,"link",f,!0,o,h,m),this.register(c.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(c.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(w,f){super.resize(w,f),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,d.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let f=w.y1+1;f<w.y2;f++)this._fillBottomLineAtCells(0,f,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}s.LinkRenderLayer=p},820:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(u,d,v,a){u.addEventListener(d,v,a);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,v,a))}}}},274:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const d=u(855),v=u(160),a=u(374);let p,S=0,w=0,f=!1,n=!1,c=!1,o=0;s.CellColorResolver=class{constructor(h,m,x,y,E,b){this._terminal=h,this._optionService=m,this._selectionRenderModel=x,this._decorationService=y,this._coreBrowserService=E,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(h,m,x,y){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,w=0,S=0,n=!1,f=!1,c=!1,p=this._themeService.colors,o=0,h.getCode()!==d.NULL_CELL_CODE&&h.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));o=m*y%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(m,x,"bottom",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(S=E.foregroundColorRGB.rgba>>8&16777215,f=!0)})),c=this._selectionRenderModel.isCellSelected(this._terminal,m,x),c){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=v.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,p.selectionForeground&&(S=p.selectionForeground.rgba>>8&16777215,f=!0),(0,a.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)S=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}S=v.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}f=!0}}this._decorationService.forEachDecorationAtCell(m,x,"top",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(S=E.foregroundColorRGB.rgba>>8&16777215,f=!0)})),n&&(w=c?-16777216&h.bg&-134217729|w|50331648:-16777216&h.bg|w|50331648),f&&(S=-16777216&h.fg&-67108865|S|50331648),67108864&this.result.fg&&(n&&!f&&(S=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,f=!0),!n&&f&&(w=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),p=void 0,this.result.bg=n?w:this.result.bg,this.result.fg=f?S:this.result.fg,this.result.ext&=536870911,this.result.ext|=o<<29&3758096384}}},627:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const d=u(509),v=u(197),a=[];s.acquireTextureAtlas=function(p,S,w,f,n,c,o,h){const m=(0,v.generateConfig)(f,n,c,o,S,w,h);for(let E=0;E<a.length;E++){const b=a[E],R=b.ownedBy.indexOf(p);if(R>=0){if((0,v.configEquals)(b.config,m))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),a.splice(E,1)):b.ownedBy.splice(R,1);break}}for(let E=0;E<a.length;E++){const b=a[E];if((0,v.configEquals)(b.config,m))return b.ownedBy.push(p),b.atlas}const x=p._core,y={atlas:new d.TextureAtlas(document,m,x.unicodeService),config:m,ownedBy:[p]};return a.push(y),y.atlas},s.removeTerminalFromCache=function(p){for(let S=0;S<a.length;S++){const w=a[S].ownedBy.indexOf(p);if(w!==-1){a[S].ownedBy.length===1?(a[S].atlas.dispose(),a.splice(S,1)):a[S].ownedBy.splice(w,1);break}}}},197:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const d=u(160);s.generateConfig=function(v,a,p,S,w,f,n){const c={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:n,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:v,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:S,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:c}},s.configEquals=function(v,a){for(let p=0;p<v.colors.ansi.length;p++)if(v.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return v.devicePixelRatio===a.devicePixelRatio&&v.customGlyphs===a.customGlyphs&&v.lineHeight===a.lineHeight&&v.letterSpacing===a.letterSpacing&&v.fontFamily===a.fontFamily&&v.fontSize===a.fontSize&&v.fontWeight===a.fontWeight&&v.fontWeightBold===a.fontWeightBold&&v.allowTransparency===a.allowTransparency&&v.deviceCharWidth===a.deviceCharWidth&&v.deviceCharHeight===a.deviceCharHeight&&v.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&v.minimumContrastRatio===a.minimumContrastRatio&&v.colors.foreground.rgba===a.colors.foreground.rgba&&v.colors.background.rgba===a.colors.background.rgba},s.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const d=u(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(f,n,c,o,h,m,x,y){const E=s.blockElementDefinitions[n];if(E)return(function(I,M,k,U,K,W){for(let $=0;$<M.length;$++){const V=M[$],O=K/8,q=W/8;I.fillRect(k+V.x*O,U+V.y*q,V.w*O,V.h*q)}})(f,E,c,o,h,m),!0;const b=v[n];if(b)return(function(I,M,k,U,K,W){let $=a.get(M);$||($=new Map,a.set(M,$));const V=I.fillStyle;if(typeof V!="string")throw new Error(`Unexpected fillStyle type "${V}"`);let O=$.get(V);if(!O){const q=M[0].length,B=M.length,j=I.canvas.ownerDocument.createElement("canvas");j.width=q,j.height=B;const Q=(0,d.throwIfFalsy)(j.getContext("2d")),J=new ImageData(q,B);let ue,he,X,F;if(V.startsWith("#"))ue=parseInt(V.slice(1,3),16),he=parseInt(V.slice(3,5),16),X=parseInt(V.slice(5,7),16),F=V.length>7&&parseInt(V.slice(7,9),16)||1;else{if(!V.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${V}" when drawing pattern glyph`);[ue,he,X,F]=V.substring(5,V.length-1).split(",").map((ae=>parseFloat(ae)))}for(let ae=0;ae<B;ae++)for(let ie=0;ie<q;ie++)J.data[4*(ae*q+ie)]=ue,J.data[4*(ae*q+ie)+1]=he,J.data[4*(ae*q+ie)+2]=X,J.data[4*(ae*q+ie)+3]=M[ae][ie]*(255*F);Q.putImageData(J,0,0),O=(0,d.throwIfFalsy)(I.createPattern(j,null)),$.set(V,O)}I.fillStyle=O,I.fillRect(k,U,K,W)})(f,b,c,o,h,m),!0;const R=s.boxDrawingDefinitions[n];if(R)return(function(I,M,k,U,K,W,$){I.strokeStyle=I.fillStyle;for(const[V,O]of Object.entries(M)){let q;I.beginPath(),I.lineWidth=$*Number.parseInt(V),q=typeof O=="function"?O(.15,.15/W*K):O;for(const B of q.split(" ")){const j=B[0],Q=S[j];if(!Q){console.error(`Could not find drawing instructions for "${j}"`);continue}const J=B.substring(1).split(",");J[0]&&J[1]&&Q(I,w(J,K,W,k,U,!0,$))}I.stroke(),I.closePath()}})(f,R,c,o,h,m,y),!0;const T=s.powerlineDefinitions[n];return!!T&&((function(I,M,k,U,K,W,$,V){const O=new Path2D;O.rect(k,U,K,W),I.clip(O),I.beginPath();const q=$/12;I.lineWidth=V*q;for(const B of M.d.split(" ")){const j=B[0],Q=S[j];if(!Q){console.error(`Could not find drawing instructions for "${j}"`);continue}const J=B.substring(1).split(",");J[0]&&J[1]&&Q(I,w(J,K,W,k,U,!1,V,(M.leftPadding??0)*(q/2),(M.rightPadding??0)*(q/2)))}M.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(f,T,c,o,h,m,x,y),!0)};const a=new Map;function p(f,n,c=0){return Math.max(Math.min(f,n),c)}const S={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function w(f,n,c,o,h,m,x,y=0,E=0){const b=f.map((R=>parseFloat(R)||parseInt(R)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<b.length;R+=2)b[R]*=n-y*x-E*x,m&&b[R]!==0&&(b[R]=p(Math.round(b[R]+.5)-.5,n,0)),b[R]+=o+y*x;for(let R=1;R<b.length;R+=2)b[R]*=c,m&&b[R]!==0&&(b[R]=p(Math.round(b[R]+.5)-.5,c,0)),b[R]+=h;return b}},56:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const d=u(859);s.observeDevicePixelDimensions=function(v,a,p){let S=new a.ResizeObserver((w=>{const f=w.find((o=>o.target===v));if(!f)return;if(!("devicePixelContentBoxSize"in f))return S==null||S.disconnect(),void(S=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;n>0&&c>0&&p(n,c)}));try{S.observe(v,{box:["device-pixel-content-box"]})}catch{S.disconnect(),S=void 0}return(0,d.toDisposable)((()=>S==null?void 0:S.disconnect()))}},374:(H,s)=>{function u(v){return 57508<=v&&v<=57558}function d(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},s.isPowerlineGlyph=u,s.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},s.isEmoji=d,s.allowRescaling=function(v,a,p,S){return a===1&&p>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!d(v)&&!u(v)&&!(function(w){return 57344<=w&&w<=63743})(v)},s.treatGlyphAsBackgroundColor=function(v){return u(v)||(function(a){return 9472<=a&&a<=9631})(v)},s.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}}}},s.computeNextVariantOffset=function(v,a,p=0){return(v-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,a,p,S=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const w=v.buffers.active.ydisp,f=a[1]-w,n=p[1]-w,c=Math.max(f,0),o=Math.min(n,v.rows-1);c>=v.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=n,this.viewportCappedStartRow=c,this.viewportCappedEndRow=o,this.startCol=a[0],this.endCol=p[0])}isCellSelected(v,a,p){return!!this.hasSelection&&(p-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}s.createSelectionRenderModel=function(){return new u}},509:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const d=u(237),v=u(860),a=u(374),p=u(160),S=u(345),w=u(485),f=u(385),n=u(147),c=u(855),o={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let h;class m{get pages(){return this._pages}constructor(R,T,I){this._document=R,this._config=T,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new f.IdleTaskQueue;for(let T=33;T<126;T++)R.enqueue((()=>{if(!this._cacheMap.get(T,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT)){const I=this._drawToCache(T,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT);this._cacheMap.set(T,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(m.maxAtlasPages&&this._pages.length>=Math.max(4,m.maxAtlasPages)){const T=this._pages.filter(($=>2*$.canvas.width<=(m.maxTextureSize||4096))).sort((($,V)=>V.canvas.width!==$.canvas.width?V.canvas.width-$.canvas.width:V.percentageUsed-$.percentageUsed));let I=-1,M=0;for(let $=0;$<T.length;$++)if(T[$].canvas.width!==M)I=$,M=T[$].canvas.width;else if($-I==3)break;const k=T.slice(I,I+4),U=k.map(($=>$.glyphs[0].texturePage)).sort((($,V)=>$>V?1:-1)),K=this.pages.length-k.length,W=this._mergePages(k,K);W.version++;for(let $=U.length-1;$>=0;$--)this._deletePage(U[$]);this.pages.push(W),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(W.canvas)}const R=new x(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,T){const I=2*R[0].canvas.width,M=new x(this._document,I,R);for(const[k,U]of R.entries()){const K=k*U.canvas.width%I,W=Math.floor(k/2)*U.canvas.height;M.ctx.drawImage(U.canvas,K,W);for(const V of U.glyphs)V.texturePage=T,V.sizeClipSpace.x=V.size.x/I,V.sizeClipSpace.y=V.size.y/I,V.texturePosition.x+=K,V.texturePosition.y+=W,V.texturePositionClipSpace.x=V.texturePosition.x/I,V.texturePositionClipSpace.y=V.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const $=this._activePages.indexOf(U);$!==-1&&this._activePages.splice($,1)}return M}_deletePage(R){this._pages.splice(R,1);for(let T=R;T<this._pages.length;T++){const I=this._pages[T];for(const M of I.glyphs)M.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(R,T,I,M,k){return this._getFromCacheMap(this._cacheMapCombined,R,T,I,M,k)}getRasterizedGlyph(R,T,I,M,k){return this._getFromCacheMap(this._cacheMap,R,T,I,M,k)}_getFromCacheMap(R,T,I,M,k,U=!1){return h=R.get(T,I,M,k),h||(h=this._drawToCache(T,I,M,k,U),R.set(T,I,M,k,h)),h}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,T,I,M){if(this._config.allowTransparency)return p.NULL_COLOR;let k;switch(R){case 16777216:case 33554432:k=this._getColorFromAnsiIndex(T);break;case 50331648:const U=n.AttributeData.toColorRGB(T);k=p.channels.toColor(U[0],U[1],U[2]);break;default:k=I?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return k}_getForegroundColor(R,T,I,M,k,U,K,W,$,V){const O=this._getMinimumContrastColor(R,T,I,M,k,U,K,$,W,V);if(O)return O;let q;switch(k){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&$&&U<8&&(U+=8),q=this._getColorFromAnsiIndex(U);break;case 50331648:const B=n.AttributeData.toColorRGB(U);q=p.channels.toColor(B[0],B[1],B[2]);break;default:q=K?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(q=p.color.opaque(q)),W&&(q=p.color.multiplyOpacity(q,d.DIM_OPACITY)),q}_resolveBackgroundRgba(R,T,I){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,T,I,M){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&T<8&&(T+=8),this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,T,I,M,k,U,K,W,$,V){if(this._config.minimumContrastRatio===1||V)return;const O=this._getContrastCache($),q=O.getColor(R,M);if(q!==void 0)return q||void 0;const B=this._resolveBackgroundRgba(T,I,K),j=this._resolveForegroundRgba(k,U,K,W),Q=p.rgba.ensureContrastRatio(B,j,this._config.minimumContrastRatio/($?2:1));if(!Q)return void O.setColor(R,M,null);const J=p.channels.toColor(Q>>24&255,Q>>16&255,Q>>8&255);return O.setColor(R,M,J),J}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,T,I,M,k=!1){const U=typeof R=="number"?String.fromCharCode(R):R,K=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width<K&&(this._tmpCanvas.width=K);const W=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<W&&(this._tmpCanvas.height=W),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=T,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return o;const $=!!this._workAttributeData.isBold(),V=!!this._workAttributeData.isInverse(),O=!!this._workAttributeData.isDim(),q=!!this._workAttributeData.isItalic(),B=!!this._workAttributeData.isUnderline(),j=!!this._workAttributeData.isStrikethrough(),Q=!!this._workAttributeData.isOverline();let J=this._workAttributeData.getFgColor(),ue=this._workAttributeData.getFgColorMode(),he=this._workAttributeData.getBgColor(),X=this._workAttributeData.getBgColorMode();if(V){const ve=J;J=he,he=ve;const we=ue;ue=X,X=we}const F=this._getBackgroundColor(X,he,V,O);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ae=$?this._config.fontWeightBold:this._config.fontWeight,ie=q?"italic":"";this._tmpCtx.font=`${ie} ${ae} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const _e=U.length===1&&(0,a.isPowerlineGlyph)(U.charCodeAt(0)),fe=U.length===1&&(0,a.isRestrictedPowerlineGlyph)(U.charCodeAt(0)),ye=this._getForegroundColor(T,X,he,I,ue,J,V,O,$,(0,a.treatGlyphAsBackgroundColor)(U.charCodeAt(0)));this._tmpCtx.fillStyle=ye.css;const ge=fe?0:4;let Te=!1;this._config.customGlyphs!==!1&&(Te=(0,v.tryDrawCustomChar)(this._tmpCtx,U,ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Pe,Se=!_e;if(Pe=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),B){this._tmpCtx.save();const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ve%2==1?.5:0;if(this._tmpCtx.lineWidth=ve,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let Ze=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ze<8&&(Ze+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ze).css}this._tmpCtx.beginPath();const Ke=ge,qe=Math.ceil(ge+this._config.deviceCharHeight)-we-(k?2*ve:0),vt=qe+ve,Qe=qe+2*ve;let ct=this._workAttributeData.getUnderlineVariantOffset();for(let Ze=0;Ze<Pe;Ze++){this._tmpCtx.save();const Oe=Ke+Ze*this._config.deviceCellWidth,De=Ke+(Ze+1)*this._config.deviceCellWidth,Yt=Oe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Oe,qe),this._tmpCtx.lineTo(De,qe),this._tmpCtx.moveTo(Oe,Qe),this._tmpCtx.lineTo(De,Qe);break;case 3:const ut=ve<=1?Qe:Math.ceil(ge+this._config.deviceCharHeight-ve/2)-we,Rt=ve<=1?qe:Math.ceil(ge+this._config.deviceCharHeight+ve/2)-we,gt=new Path2D;gt.rect(Oe,qe,this._config.deviceCellWidth,Qe-qe),this._tmpCtx.clip(gt),this._tmpCtx.moveTo(Oe-this._config.deviceCellWidth/2,vt),this._tmpCtx.bezierCurveTo(Oe-this._config.deviceCellWidth/2,Rt,Oe,Rt,Oe,vt),this._tmpCtx.bezierCurveTo(Oe,ut,Yt,ut,Yt,vt),this._tmpCtx.bezierCurveTo(Yt,Rt,De,Rt,De,vt),this._tmpCtx.bezierCurveTo(De,ut,De+this._config.deviceCellWidth/2,ut,De+this._config.deviceCellWidth/2,vt);break;case 4:const Qi=ct===0?0:ct>=ve?2*ve-ct:ve-ct;ct>=ve||Qi===0?(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(Oe+Qi,qe),this._tmpCtx.lineTo(De,qe)):(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(Oe,qe),this._tmpCtx.lineTo(Oe+Qi,qe),this._tmpCtx.moveTo(Oe+Qi+ve,qe),this._tmpCtx.lineTo(De,qe)),ct=(0,a.computeNextVariantOffset)(De-Oe,ve,ct);break;case 5:const Pr=.6,Ms=.3,xi=De-Oe,Ti=Math.floor(Pr*xi),tt=Math.floor(Ms*xi),rt=xi-Ti-tt;this._tmpCtx.setLineDash([Ti,tt,rt]),this._tmpCtx.moveTo(Oe,qe),this._tmpCtx.lineTo(De,qe);break;default:this._tmpCtx.moveTo(Oe,qe),this._tmpCtx.lineTo(De,qe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Te&&this._config.fontSize>=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ze=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ze&&Ze.actualBoundingBoxDescent>0){this._tmpCtx.save();const Oe=new Path2D;Oe.rect(Ke,qe-Math.ceil(ve/2),this._config.deviceCellWidth*Pe,Qe-qe+Math.ceil(ve/2)),this._tmpCtx.clip(Oe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=F.css,this._tmpCtx.strokeText(U,ge,ge+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Q){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ve%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ge,ge+we),this._tmpCtx.lineTo(ge+this._config.deviceCharWidth*Pe,ge+we),this._tmpCtx.stroke()}if(Te||this._tmpCtx.fillText(U,ge,ge+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let ve=y(this._tmpCtx.getImageData(ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ye,Se);if(ve)for(let we=1;we<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,ge,ge+this._config.deviceCharHeight-we),ve=y(this._tmpCtx.getImageData(ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ye,Se),ve);we++);}if(j){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),we=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ge,ge+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.lineTo(ge+this._config.deviceCharWidth*Pe,ge+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ot=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let zt;if(zt=this._config.allowTransparency?(function(ve){for(let we=0;we<ve.data.length;we+=4)if(ve.data[we+3]>0)return!1;return!0})(Ot):y(Ot,F,ye,Se),zt)return o;const xe=this._findGlyphBoundingBox(Ot,this._workBoundingBox,K,fe,Te,ge);let Ee,Ae;for(;;){if(this._activePages.length===0){const ve=this._createNewPage();Ee=ve,Ae=ve.currentRow,Ae.height=xe.size.y;break}Ee=this._activePages[this._activePages.length-1],Ae=Ee.currentRow;for(const ve of this._activePages)xe.size.y<=ve.currentRow.height&&(Ee=ve,Ae=ve.currentRow);for(let ve=this._activePages.length-1;ve>=0;ve--)for(const we of this._activePages[ve].fixedRows)we.height<=Ae.height&&xe.size.y<=we.height&&(Ee=this._activePages[ve],Ae=we);if(Ae.y+xe.size.y>=Ee.canvas.height||Ae.height>xe.size.y+2){let ve=!1;if(Ee.currentRow.y+Ee.currentRow.height+xe.size.y>=Ee.canvas.height){let we;for(const Ke of this._activePages)if(Ke.currentRow.y+Ke.currentRow.height+xe.size.y<Ke.canvas.height){we=Ke;break}if(we)Ee=we;else if(m.maxAtlasPages&&this._pages.length>=m.maxAtlasPages&&Ae.y+xe.size.y<=Ee.canvas.height&&Ae.height>=xe.size.y&&Ae.x+xe.size.x<=Ee.canvas.width)ve=!0;else{const Ke=this._createNewPage();Ee=Ke,Ae=Ke.currentRow,Ae.height=xe.size.y,ve=!0}}ve||(Ee.currentRow.height>0&&Ee.fixedRows.push(Ee.currentRow),Ae={x:0,y:Ee.currentRow.y+Ee.currentRow.height,height:xe.size.y},Ee.fixedRows.push(Ae),Ee.currentRow={x:0,y:Ae.y+Ae.height,height:0})}if(Ae.x+xe.size.x<=Ee.canvas.width)break;Ae===Ee.currentRow?(Ae.x=0,Ae.y+=Ae.height,Ae.height=0):Ee.fixedRows.splice(Ee.fixedRows.indexOf(Ae),1)}return xe.texturePage=this._pages.indexOf(Ee),xe.texturePosition.x=Ae.x,xe.texturePosition.y=Ae.y,xe.texturePositionClipSpace.x=Ae.x/Ee.canvas.width,xe.texturePositionClipSpace.y=Ae.y/Ee.canvas.height,xe.sizeClipSpace.x/=Ee.canvas.width,xe.sizeClipSpace.y/=Ee.canvas.height,Ae.height=Math.max(Ae.height,xe.size.y),Ae.x+=xe.size.x,Ee.ctx.putImageData(Ot,xe.texturePosition.x-this._workBoundingBox.left,xe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,xe.size.x,xe.size.y),Ee.addGlyph(xe),Ee.version++,xe}_findGlyphBoundingBox(R,T,I,M,k,U){T.top=0;const K=M?this._config.deviceCellHeight:this._tmpCanvas.height,W=M?this._config.deviceCellWidth:I;let $=!1;for(let V=0;V<K;V++){for(let O=0;O<W;O++){const q=V*this._tmpCanvas.width*4+4*O+3;if(R.data[q]!==0){T.top=V,$=!0;break}}if($)break}T.left=0,$=!1;for(let V=0;V<U+W;V++){for(let O=0;O<K;O++){const q=O*this._tmpCanvas.width*4+4*V+3;if(R.data[q]!==0){T.left=V,$=!0;break}}if($)break}T.right=W,$=!1;for(let V=U+W-1;V>=U;V--){for(let O=0;O<K;O++){const q=O*this._tmpCanvas.width*4+4*V+3;if(R.data[q]!==0){T.right=V,$=!0;break}}if($)break}T.bottom=K,$=!1;for(let V=K-1;V>=0;V--){for(let O=0;O<W;O++){const q=V*this._tmpCanvas.width*4+4*O+3;if(R.data[q]!==0){T.bottom=V,$=!0;break}}if($)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:T.right-T.left+1,y:T.bottom-T.top+1},sizeClipSpace:{x:T.right-T.left+1,y:T.bottom-T.top+1},offset:{x:-T.left+U+(M||k?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-T.top+U+(M||k?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=m;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,T,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const M of I)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=E(R,T,T),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function y(b,R,T,I){const M=R.rgba>>>24,k=R.rgba>>>16&255,U=R.rgba>>>8&255,K=T.rgba>>>24,W=T.rgba>>>16&255,$=T.rgba>>>8&255,V=Math.floor((Math.abs(M-K)+Math.abs(k-W)+Math.abs(U-$))/12);let O=!0;for(let q=0;q<b.data.length;q+=4)b.data[q]===M&&b.data[q+1]===k&&b.data[q+2]===U||I&&Math.abs(b.data[q]-M)+Math.abs(b.data[q+1]-k)+Math.abs(b.data[q+2]-U)<V?b.data[q+3]=0:O=!1;return O}function E(b,R,T){const I=b.createElement("canvas");return I.width=R,I.height=T,I}},160:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let u=0,d=0,v=0,a=0;var p,S,w,f,n;function c(h){const m=h.toString(16);return m.length<2?"0"+m:m}function o(h,m){return h<m?(m+.05)/(h+.05):(h+.05)/(m+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(m,x,y,E){return E!==void 0?`#${c(m)}${c(x)}${c(y)}${c(E)}`:`#${c(m)}${c(x)}${c(y)}`},h.toRgba=function(m,x,y,E=255){return(m<<24|x<<16|y<<8|E)>>>0},h.toColor=function(m,x,y,E){return{css:h.toCss(m,x,y,E),rgba:h.toRgba(m,x,y,E)}}})(p||(s.channels=p={})),(function(h){function m(x,y){return a=Math.round(255*y),[u,d,v]=n.toChannels(x.rgba),{css:p.toCss(u,d,v,a),rgba:p.toRgba(u,d,v,a)}}h.blend=function(x,y){if(a=(255&y.rgba)/255,a===1)return{css:y.css,rgba:y.rgba};const E=y.rgba>>24&255,b=y.rgba>>16&255,R=y.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,M=x.rgba>>8&255;return u=T+Math.round((E-T)*a),d=I+Math.round((b-I)*a),v=M+Math.round((R-M)*a),{css:p.toCss(u,d,v),rgba:p.toRgba(u,d,v)}},h.isOpaque=function(x){return(255&x.rgba)==255},h.ensureContrastRatio=function(x,y,E){const b=n.ensureContrastRatio(x.rgba,y.rgba,E);if(b)return p.toColor(b>>24&255,b>>16&255,b>>8&255)},h.opaque=function(x){const y=(255|x.rgba)>>>0;return[u,d,v]=n.toChannels(y),{css:p.toCss(u,d,v),rgba:y}},h.opacity=m,h.multiplyOpacity=function(x,y){return a=255&x.rgba,m(x,a*y/255)},h.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(S||(s.color=S={})),(function(h){let m,x;try{const y=document.createElement("canvas");y.width=1,y.height=1;const E=y.getContext("2d",{willReadFrequently:!0});E&&(m=E,m.globalCompositeOperation="copy",x=m.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),p.toColor(u,d,v);case 5:return u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),v=parseInt(y.slice(3,4).repeat(2),16),a=parseInt(y.slice(4,5).repeat(2),16),p.toColor(u,d,v,a);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const E=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),d=parseInt(E[2]),v=parseInt(E[3]),a=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,d,v,a);if(!m||!x)throw new Error("css.toColor: Unsupported css format");if(m.fillStyle=x,m.fillStyle=y,typeof m.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(m.fillRect(0,0,1,1),[u,d,v,a]=m.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,v,a),css:y}}})(w||(s.css=w={})),(function(h){function m(x,y,E){const b=x/255,R=y/255,T=E/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}h.relativeLuminance=function(x){return m(x>>16&255,x>>8&255,255&x)},h.relativeLuminance2=m})(f||(s.rgb=f={})),(function(h){function m(y,E,b){const R=y>>24&255,T=y>>16&255,I=y>>8&255;let M=E>>24&255,k=E>>16&255,U=E>>8&255,K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));for(;K<b&&(M>0||k>0||U>0);)M-=Math.max(0,Math.ceil(.1*M)),k-=Math.max(0,Math.ceil(.1*k)),U-=Math.max(0,Math.ceil(.1*U)),K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));return(M<<24|k<<16|U<<8|255)>>>0}function x(y,E,b){const R=y>>24&255,T=y>>16&255,I=y>>8&255;let M=E>>24&255,k=E>>16&255,U=E>>8&255,K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));for(;K<b&&(M<255||k<255||U<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),k=Math.min(255,k+Math.ceil(.1*(255-k))),U=Math.min(255,U+Math.ceil(.1*(255-U))),K=o(f.relativeLuminance2(M,k,U),f.relativeLuminance2(R,T,I));return(M<<24|k<<16|U<<8|255)>>>0}h.blend=function(y,E){if(a=(255&E)/255,a===1)return E;const b=E>>24&255,R=E>>16&255,T=E>>8&255,I=y>>24&255,M=y>>16&255,k=y>>8&255;return u=I+Math.round((b-I)*a),d=M+Math.round((R-M)*a),v=k+Math.round((T-k)*a),p.toRgba(u,d,v)},h.ensureContrastRatio=function(y,E,b){const R=f.relativeLuminance(y>>8),T=f.relativeLuminance(E>>8);if(o(R,T)<b){if(T<R){const k=m(y,E,b),U=o(R,f.relativeLuminance(k>>8));if(U<b){const K=x(y,E,b);return U>o(R,f.relativeLuminance(K>>8))?k:K}return k}const I=x(y,E,b),M=o(R,f.relativeLuminance(I>>8));if(M<b){const k=m(y,E,b);return M>o(R,f.relativeLuminance(k>>8))?I:k}return I}},h.reduceLuminance=m,h.increaseLuminance=x,h.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(s.rgba=n={})),s.toPaddedHex=c,s.contrastRatio=o},345:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let a=0;a<this._listeners.length;a++)v.push(this._listeners[a]);for(let a=0;a<v.length;a++)v[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,d){return u((v=>d.fire(v)))},s.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},859:(H,s)=>{function u(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.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 v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)==null||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=u,s.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,a,p){this._data[v]||(this._data[v]={}),this._data[v][a]=p}get(v,a){return this._data[v]?this._data[v][a]:void 0}clear(){this._data={}}}s.TwoKeyMap=u,s.FourKeyMap=class{constructor(){this._data=new u}set(d,v,a,p,S){this._data.get(d,v)||this._data.set(d,v,new u),this._data.get(d,v).set(a,p,S)}get(d,v,a,p){var S;return(S=this._data.get(d,v))==null?void 0:S.get(a,p)}clear(){this._data.clear()}}},399:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const u=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=u.includes("Firefox"),s.isLegacyEdge=u.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(u),s.getSafariVersion=function(){if(!s.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(u)},385:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=u(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let w=0,f=0,n=S.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),f=Math.max(w,f),c=S.timeRemaining(),1.5*f>c)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=c}this.clear()}}class a extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=a,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},782:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=u(133),v=u(855),a=u(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const f=new p;return f.setFromCharData(w),f}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(w){this.fg=w[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(w[v.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(w[v.CHAR_DATA_CHAR_INDEX].length===2){const n=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const c=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(n-55296)+c-56320+65536|w[v.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[v.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=w[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},s.utf32ToString=function(u,d=0,v=u.length){let a="";for(let p=d;p<v;++p){let S=u[p];S>65535?(S-=65536,a+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):a+=String.fromCharCode(S)}return a},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const v=u.length;if(!v)return 0;let a=0,p=0;if(this._interim){const S=u.charCodeAt(p++);56320<=S&&S<=57343?d[a++]=1024*(this._interim-55296)+S-56320+65536:(d[a++]=this._interim,d[a++]=S),this._interim=0}for(let S=p;S<v;++S){const w=u.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=v)return this._interim=w,a;const f=u.charCodeAt(S);56320<=f&&f<=57343?d[a++]=1024*(w-55296)+f-56320+65536:(d[a++]=w,d[a++]=f)}else w!==65279&&(d[a++]=w)}return a}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const v=u.length;if(!v)return 0;let a,p,S,w,f=0,n=0,c=0;if(this.interim[0]){let m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let y,E=0;for(;(y=63&this.interim[++E])&&E<4;)x<<=6,x|=y;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=b-E;for(;c<R;){if(c>=v)return 0;if(y=u[c++],(192&y)!=128){c--,m=!0;break}this.interim[E++]=y,x<<=6,x|=63&y}m||(b===2?x<128?c--:d[f++]=x:b===3?x<2048||x>=55296&&x<=57343||x===65279||(d[f++]=x):x<65536||x>1114111||(d[f++]=x)),this.interim.fill(0)}const o=v-4;let h=c;for(;h<v;){for(;!(!(h<o)||128&(a=u[h])||128&(p=u[h+1])||128&(S=u[h+2])||128&(w=u[h+3]));)d[f++]=a,d[f++]=p,d[f++]=S,d[f++]=w,h+=4;if(a=u[h++],a<128)d[f++]=a;else if((224&a)==192){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(n=(31&a)<<6|63&p,n<128){h--;continue}d[f++]=n}else if((240&a)==224){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,f;if(S=u[h++],(192&S)!=128){h--;continue}if(n=(15&a)<<12|(63&p)<<6|63&S,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&a)==240){if(h>=v)return this.interim[0]=a,f;if(p=u[h++],(192&p)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,f;if(S=u[h++],(192&S)!=128){h--;continue}if(h>=v)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=S,f;if(w=u[h++],(192&w)!=128){h--;continue}if(n=(7&a)<<18|(63&p)<<12|(63&S)<<6|63&w,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(H,s,u){var d=this&&this.__decorate||function(n,c,o,h){var m,x=arguments.length,y=x<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,c,o,h);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(y=(x<3?m(y):x>3?m(c,o,y):m(c,o))||y);return x>3&&y&&Object.defineProperty(c,o,y),y},v=this&&this.__param||function(n,c){return function(o,h){c(o,h,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const a=u(859),p=u(97),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,f=s.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let c=0;c<n.length;c++)typeof n[c]=="function"&&(n[c]=n[c]())}_log(n,c,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(n,...c){var o;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,c)}debug(n,...c){var o;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,c)}info(n,...c){var o;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,c)}warn(n,...c){var o;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,c)}error(n,...c){var o;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,c)}};s.LogService=f=d([v(0,p.IOptionsService)],f),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,c,o){if(typeof o.value!="function")throw new Error("not supported");const h=o.value;o.value=function(...m){if(w.logLevel!==p.LogLevelEnum.TRACE)return h.apply(this,m);w.trace(`GlyphRenderer#${h.name}(${m.map((y=>JSON.stringify(y))).join(", ")})`);const x=h.apply(this,m);return w.trace(`GlyphRenderer#${h.name} return`,x),x}}},726:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const u="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(v){return v[d]||[]},s.createDecorator=function(v){if(s.serviceRegistry.has(v))return s.serviceRegistry.get(v);const a=function(p,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,c){n[u]===n?n[d].push({id:f,index:c}):(n[d]=[{id:f,index:c}],n[u]=n)})(a,p,w)};return a.toString=()=>v,s.serviceRegistry.set(v,a),a}},97:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=u(726);var v;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(v||(s.LogLevelEnum=v={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")}},A={};function z(H){var s=A[H];if(s!==void 0)return s.exports;var u=A[H]={exports:{}};return D[H].call(u.exports,u,u.exports,z),u.exports}var P={};return(()=>{var H=P;Object.defineProperty(H,"__esModule",{value:!0}),H.WebglAddon=void 0;const s=z(345),u=z(859),d=z(399),v=z(666),a=z(776);class p extends u.Disposable{constructor(w){if(d.isSafari&&(0,d.getSafariVersion)()<16){const f={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",f))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const f=w._core;if(!w.element)return void this.register(f.onWillOpen((()=>this.activate(w))));this._terminal=w;const n=f.coreService,c=f.optionsService,o=f,h=o._renderService,m=o._characterJoinerService,x=o._charSizeService,y=o._coreBrowserService,E=o._decorationService,b=o._logService,R=o._themeService;(0,a.setTraceLogger)(b),this._renderer=this.register(new v.WebglRenderer(w,m,x,y,n,E,c,R,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const T=this._terminal._core._renderService;T.setRenderer(this._terminal._core._createRenderer()),T.handleResize(w.cols,w.rows)})))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}H.WebglAddon=p})(),P})()))})(Oc)),Oc.exports}var cm=lm(),Za={exports:{}},um=Za.exports,x_;function hm(){return x_||(x_=1,(function(_,C){(function(D,A){_.exports=A()})(um,(()=>(()=>{var D={433:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const d=u(938),v=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],a=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],p=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],S=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function f(n,c){let o,h=0,m=c.length-1;if(n<c[0][0]||n>c[m][1])return!1;for(;m>=h;)if(o=h+m>>1,n>c[o][1])h=o+1;else{if(!(n<c[o][0]))return!0;m=o-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let n=0;n<v.length;++n)w.fill(0,v[n][0],v[n][1]+1);for(let n=0;n<p.length;++n)w.fill(2,p[n][0],p[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?w[n]:f(n,a)?0:f(n,S)?2:1}charProperties(n,c){let o=this.wcwidth(n),h=o===0&&c!==0;if(h){const m=d.UnicodeService.extractWidth(c);m===0?h=!1:m>o&&(o=m)}return d.UnicodeService.createPropertyValue(0,o,h)}}},345:(H,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let a=0;a<this._listeners.length;a++)v.push(this._listeners[a]);for(let a=0;a<v.length;a++)v[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,d){return u((v=>d.fire(v)))},s.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},490:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const d=u(938),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<v.length;++S)p.fill(0,v[S][0],v[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:(function(w,f){let n,c=0,o=f.length-1;if(w<f[0][0]||w>f[o][1])return!1;for(;o>=c;)if(n=c+o>>1,w>f[n][1])c=n+1;else{if(!(w<f[n][0]))return!0;o=n-1}return!1})(S,a)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let f=this.wcwidth(S),n=f===0&&w!==0;if(n){const c=d.UnicodeService.extractWidth(w);c===0?n=!1:c>f&&(f=c)}return d.UnicodeService.createPropertyValue(0,f,n)}}},938:(H,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=u(345),v=u(490);class a{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,f=!1){return(16777215&S)<<3|(3&w)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new v.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,f=0;const n=S.length;for(let c=0;c<n;++c){let o=S.charCodeAt(c);if(55296<=o&&o<=56319){if(++c>=n)return w+this.wcwidth(o);const x=S.charCodeAt(c);56320<=x&&x<=57343?o=1024*(o-55296)+x-56320+65536:w+=this.wcwidth(x)}const h=this.charProperties(o,f);let m=a.extractWidth(h);a.extractShouldJoin(h)&&(m-=a.extractWidth(f)),w+=m,f=h}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}s.UnicodeService=a}},A={};function z(H){var s=A[H];if(s!==void 0)return s.exports;var u=A[H]={exports:{}};return D[H](u,u.exports,z),u.exports}var P={};return(()=>{var H=P;Object.defineProperty(H,"__esModule",{value:!0}),H.Unicode11Addon=void 0;const s=z(433);H.Unicode11Addon=class{activate(u){u.unicode.register(new s.UnicodeV11)}dispose(){}}})(),P})()))})(Za)),Za.exports}var dm=hm();const fm=16,_m=256*1024,E_=50;function vm(_,C){const D=G.useRef(null),A=G.useRef(null),z=G.useRef(null),P=G.useRef(C);P.current=C;const H=G.useRef([]),s=G.useRef(0),u=G.useRef(null),d=G.useRef(null),v=G.useRef(null),a=G.useRef(0),p=G.useRef(null),S=G.useRef(null),w=G.useRef(null),f=G.useRef(null),n=G.useRef(!0),c=G.useRef(!0),o=G.useRef(0),[h,m]=G.useState(!1);G.useEffect(()=>{if(!_.current)return;const M=()=>{if(!D.current||H.current.length===0)return;const V=H.current.join("");H.current=[],s.current=0,D.current.write(V)};v.current=M;const k=(V,O)=>{const q=w.current;if(q&&q.cols===V&&q.rows===O)return;const j=Date.now()-a.current,Q=()=>{var ue;a.current=Date.now(),((ue=P.current)==null?void 0:ue.call(P,V,O))!==!1&&(w.current={cols:V,rows:O})};if(j>=E_){Q();return}S.current={cols:V,rows:O},p.current||(p.current=setTimeout(()=>{var ue;p.current=null;const J=S.current;S.current=null,J&&(a.current=Date.now(),((ue=P.current)==null?void 0:ue.call(P,J.cols,J.rows))!==!1&&(w.current={cols:J.cols,rows:J.rows}))},E_-j))},U=new nm.Terminal({disableStdin:!0,fontSize:14,fontFamily:"'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},scrollback:1e4}),K=new om.FitAddon;U.loadAddon(K);try{const V=new dm.Unicode11Addon;U.loadAddon(V),U.unicode.activeVersion="11"}catch{}U.open(_.current);try{const V=new cm.WebglAddon;U.loadAddon(V),V.onContextLoss(()=>{V.dispose()})}catch{}K.fit(),requestAnimationFrame(()=>{D.current&&k(D.current.cols,D.current.rows)}),D.current=U,A.current=K;const W=(V,O)=>{K.fit(),k(U.cols,U.rows)};z.current=W;const $=new ResizeObserver(()=>{K.fit(),k(U.cols,U.rows)});return $.observe(_.current),U.onScroll(()=>{if(o.current>0){o.current--;return}const V=U.buffer.active,O=V.viewportY===V.length-U.rows;c.current=O,!O&&n.current&&(n.current=!1),m(!n.current&&!O)}),()=>{$.disconnect(),p.current&&(clearTimeout(p.current),p.current=null),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current&&(clearTimeout(d.current),d.current=null),f.current!==null&&(cancelAnimationFrame(f.current),f.current=null),M(),U.dispose(),D.current=null,A.current=null,z.current=null,v.current=null}},[_]);const x=G.useCallback(()=>{const M=D.current;if(!M)return;if(n.current){f.current=requestAnimationFrame(()=>{f.current=null}),o.current=1,M.scrollToBottom();return}const k=M.buffer.active,U=k.viewportY===k.length-M.rows;U!==c.current&&(c.current=U,m(!U))},[]),y=G.useCallback((M,k)=>{var U;if(!M){k==null||k();return}if(H.current.push(M),s.current+=M.length,s.current>=_m){(U=v.current)==null||U.call(v),x(),k==null||k();return}u.current===null&&(u.current=requestAnimationFrame(()=>{var K;u.current=null,d.current&&(clearTimeout(d.current),d.current=null),(K=v.current)==null||K.call(v),x()})),d.current||(d.current=setTimeout(()=>{var K;d.current=null,(K=v.current)==null||K.call(v),x()},fm)),k==null||k()},[]),E=G.useCallback(()=>{var M;(M=D.current)==null||M.clear()},[]),b=G.useCallback(()=>{var M;(M=D.current)==null||M.reset()},[]),R=G.useCallback(()=>{const M=D.current;M&&(f.current=requestAnimationFrame(()=>{f.current=null}),o.current=1,M.scrollToBottom())},[]),T=G.useCallback(M=>{n.current=M,M&&m(!1)},[]),I=G.useCallback((M,k)=>{var U;(U=z.current)==null||U.call(z,M,k)},[]);return{write:y,clear:E,reset:b,scrollToBottom:R,setAutoFollow:T,showScrollHint:h,adaptToPtyCols:I,terminal:D}}function gm(){const[_,C]=G.useState(0),D=G.useRef(null),A=G.useCallback(()=>{const P=window.visualViewport;if(!P)return;const H=P.height,s=window.innerHeight,u=P.offsetTop;s-H>100?C(u):C(0)},[]),z=G.useCallback(()=>{D.current&&clearTimeout(D.current),D.current=setTimeout(A,16)},[A]);return G.useEffect(()=>{const P=window.visualViewport;if(P)return A(),P.addEventListener("resize",z),P.addEventListener("scroll",z),()=>{P.removeEventListener("resize",z),P.removeEventListener("scroll",z),D.current&&clearTimeout(D.current)}},[z,A]),{keyboardHeight:_}}function pm(_){const C="=".repeat((4-_.length%4)%4),D=(_+C).replace(/-/g,"+").replace(/_/g,"/"),A=atob(D),z=new Uint8Array(A.length);for(let P=0;P<A.length;P++)z[P]=A.charCodeAt(P);return z}function mm(){const _=G.useRef(!1);G.useEffect(()=>{if(!_.current){if(_.current=!0,!("serviceWorker"in navigator)||!("PushManager"in window)){console.log("[Push] Service Worker or PushManager not supported");return}(async()=>{try{console.log("[Push] Registering service worker...");const C=await navigator.serviceWorker.register("/sw.js");console.log("[Push] Service worker registered:",C.scope);const D=await C.pushManager.getSubscription();if(D){console.log("[Push] Already subscribed, endpoint:",D.endpoint);return}console.log("[Push] Fetching VAPID key from server...");let A="";for(let u=0;u<8;u++){const d=await fetch("/api/push/vapid-key",{credentials:"include"});if(d.ok){const v=await d.json();if(v!=null&&v.vapidPublicKey){A=v.vapidPublicKey,console.log("[Push] Got VAPID key:",A.substring(0,20)+"...");break}}else console.log("[Push] VAPID key fetch failed, attempt",u+1,"status:",d.status);await new Promise(v=>setTimeout(v,Math.min(300*(u+1),1500)))}if(!A){console.warn("[Push] Failed to get VAPID key after retries");return}console.log("[Push] Requesting notification permission...");const z=await Notification.requestPermission();if(console.log("[Push] Permission result:",z),z!=="granted"){console.warn("[Push] Notification permission not granted");return}console.log("[Push] Creating push subscription...");const P=await C.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:pm(A)});console.log("[Push] Subscription created:",P.endpoint);const H=P.toJSON();console.log("[Push] Sending subscription to server...");const s=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({endpoint:H.endpoint,keys:H.keys})});s.ok?console.log("[Push] Subscription sent to server successfully"):console.error("[Push] Failed to send subscription, status:",s.status)}catch(C){console.error("[Push] Setup failed:",C)}})()}},[])}function Sm(){const _=G.useRef("default"),C=G.useRef(null);G.useEffect(()=>{"Notification"in window&&(_.current=Notification.permission)},[]);const D=G.useCallback(async()=>{if(!("Notification"in window))return console.log("[useLocalNotification] Notification API not supported"),!1;if(Notification.permission==="granted")return _.current="granted",!0;if(Notification.permission==="denied")return console.log("[useLocalNotification] Notification permission denied"),!1;const z=await Notification.requestPermission();return _.current=z,z==="granted"},[]);return{showNotification:G.useCallback(async z=>{if(z.tag&&z.tag===C.current)return console.log("[useLocalNotification] Skipping duplicate notification with tag:",z.tag),!1;if(_.current!=="granted"&&!await D())return console.log("[useLocalNotification] Permission not granted, cannot show notification"),!1;try{const P=new Notification(z.title,{body:z.body,tag:z.tag,icon:"/favicon.ico"});return P.onclick=()=>{window.focus(),P.close()},z.tag&&(C.current=z.tag),console.log("[useLocalNotification] Notification shown:",z.title),!0}catch(P){return console.error("[useLocalNotification] Failed to show notification:",P),!1}},[D]),requestPermission:D}}const bm=5e3;function ym(){const _=Vt(z=>z.setInstances),C=Vt(z=>z.setActiveInstanceId),D=Vt(z=>z.activeInstanceId),A=G.useRef(!1);return G.useEffect(()=>{let z,P=!1;const H=async()=>{try{const s=await Nc();if(P)return;if(_(s),!A.current&&s.length>0){A.current=!0;const d=s.find(v=>v.isCurrent);d&&C(d.instanceId)}const u=Vt.getState().activeInstanceId;if(u&&!s.find(d=>d.instanceId===u)){const d=s[0];d&&C(d.instanceId)}}catch{}};return H(),z=setInterval(H,bm),()=>{P=!0,z&&clearInterval(z)}},[_,C]),{activeInstanceId:D}}function Cm({wsUrl:_,instanceId:C,showCommandPicker:D,isKeyboardOpen:A,onIpChanged:z}){const P=G.useRef(null),H=G.useRef(null),s=lt(U=>U.setSessionStatus),u=lt(U=>U.setIpChangeInfo),{showNotification:d}=Sm(),v=G.useRef(null),a=G.useRef((U,K)=>{}),p=G.useRef(()=>{}),S=G.useRef(()=>{}),w=G.useRef((U,K)=>{}),f=G.useCallback(U=>{switch(U.type){case"terminal_output":a.current(U.data);break;case"history_sync":p.current(),w.current(0,0),a.current(U.data),s(U.status),S.current();break;case"terminal_resize":U.cols&&U.cols>0&&w.current(U.cols,U.rows);break;case"status_update":s(U.status),U.status==="waiting_input"&&d({title:"Claude Code 需要输入",body:U.detail??"Claude 正在等待你的输入",tag:"claude-waiting-input",renotify:!1});break;case"session_ended":s("idle");break;case"error":a.current(`\r
|
|
140
|
+
\x1B[31m[Error] ${U.message}\x1B[0m\r
|
|
141
|
+
`);break;case"heartbeat":break;case"ip_changed":u({oldIp:U.oldIp,newIp:U.newIp,newUrl:U.newUrl}),z==null||z(U.newIp);break}},[s,u,z,d]),{connect:n,send:c}=rm(f,_,C);v.current=c;const{write:o,reset:h,scrollToBottom:m,setAutoFollow:x,showScrollHint:y,adaptToPtyCols:E}=vm(P,G.useCallback((U,K)=>{var W;return((W=v.current)==null?void 0:W.call(v,{type:"resize",cols:U,rows:K}))??!1},[]));a.current=o,p.current=h,S.current=m,w.current=E;const b=G.useRef(!1);G.useEffect(()=>{b.current||(b.current=!0,n())},[n]);const R=G.useCallback(U=>{U?(c({type:"user_input",data:U}),setTimeout(()=>{c({type:"user_input",data:"\r"})},0)):c({type:"user_input",data:"\r"})},[c]),T=G.useCallback(U=>{c({type:"user_input",data:U})},[c]),I=G.useCallback(U=>{var K;(K=H.current)==null||K.setText(U)},[]),M=G.useCallback(U=>{c({type:"user_input",data:U}),c({type:"user_input",data:"\r"})},[c]),k=G.useCallback(()=>{m(),x(!0)},[m,x]);return ee.jsxs(ee.Fragment,{children:[ee.jsx(W1,{}),ee.jsx(G1,{}),ee.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[ee.jsx(N1,{containerRef:P}),ee.jsx(im,{visible:y,onClick:k})]}),ee.jsx(q1,{onShortcut:T,onCommandSelect:I,onCommandSend:M,visible:D}),ee.jsx(j1,{ref:H,onSend:R,isKeyboardOpen:A})]})}function wm(_,C,D){const A=_.filter(P=>P.instanceId!==C).sort((P,H)=>P.port-H.port);if(A.length===0)return[];if(D===void 0)return A;const z=A.findIndex(P=>P.port>D);return z===-1?A:[...A.slice(z),...A.slice(0,z)]}function xm(){const{keyboardHeight:_}=gm(),C=_===0;mm(),ym();const D=Vt(m=>m.instances),A=Vt(m=>m.activeInstanceId),z=Vt(m=>m.setActiveInstanceId),P=Vt(m=>m.currentHostOverride),H=Vt(m=>m.setCurrentHostOverride),s=lt(m=>m.cachedToken),u=lt(m=>m.instanceConnectionStatus),d=lt(m=>m.toastMessage),v=lt(m=>m.showToast),a=lt(m=>m.hideToast),p=G.useRef(!1),S=G.useRef(null),w=G.useRef(void 0),f=D.find(m=>m.instanceId===A);f==null||f.isCurrent;const n=G.useMemo(()=>{if(f)return f.isCurrent?P??f.host:f.host},[f,P]),c=f&&n?V1(n,f.port):void 0;G.useEffect(()=>{(f==null?void 0:f.port)!==void 0&&(w.current=f.port)},[f]),G.useEffect(()=>{f!=null&&f.isCurrent||H(null)},[f,H]),G.useEffect(()=>{if(!A)return;const m=!f,x=u[A]==="disconnected";if(!(m||x)||p.current||S.current===A)return;const E=(f==null?void 0:f.port)??w.current,b=wm(D,A,E);if(b.length===0)return;p.current=!0,S.current=A,(async()=>{for(const T of b){if(s)try{if(T.isCurrent)await wr(s);else if(!await ro(T.host,T.port,s))continue}catch{continue}z(T.instanceId),v(`已切换到 ${T.port}`);break}p.current=!1})()},[f,A,s,u,D,z,v]),G.useEffect(()=>{if(!d)return;const m=setTimeout(()=>a(),3e3);return()=>clearTimeout(m)},[d,a]);const o=G.useCallback(async m=>{const x=D.find(y=>y.instanceId===m);if(x){if(s)try{x.isCurrent?await wr(s):await ro(x.host,x.port,s)}catch{}H(null),z(m)}},[D,s,z,H]),h=G.useCallback(m=>{H(m)},[H]);return ee.jsxs("div",{"data-testid":"console-page",style:{height:"100%",display:"flex",flexDirection:"column",paddingBottom:_>0?_:void 0},children:[ee.jsx(U1,{}),ee.jsx(em,{onSwitch:o}),ee.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:ee.jsx(Cm,{wsUrl:c,instanceId:A??void 0,showCommandPicker:C,isKeyboardOpen:_>0,onIpChanged:f!=null&&f.isCurrent?h:void 0},`${A??"default"}:${n??"none"}`)}),d&&ee.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:d}),ee.jsx(tm,{})]})}function Em(){const C=new URLSearchParams(window.location.search).get("token");if(C){const D=window.location.pathname+window.location.hash;window.history.replaceState({},"",D)}return C}function Rm(){const _=lt(P=>P.isAuthenticated),C=lt(P=>P.isCheckingAuth),D=lt(P=>P.setAuthenticated),A=lt(P=>P.setCheckingAuth),z=lt(P=>P.setCachedToken);return G.useEffect(()=>{const P=Em();if(P){wr(P).then(H=>{H?(D(!0),z(P)):(sessionStorage.setItem("prefill_token",P),A(!1))}).catch(()=>{sessionStorage.setItem("prefill_token",P),A(!1)});return}U0().then(()=>{D(!0);const H=As();H&&z(H)}).catch(async()=>{const H=As();if(H)try{if(await wr(H)){D(!0),z(H);return}}catch{}A(!1),L_(),z(null)})},[D,A,z]),C?ee.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-primary)",color:"var(--text-secondary)"},children:"Checking session…"}):_?ee.jsx(xm,{}):ee.jsx(F0,{})}k0.createRoot(document.getElementById("root")).render(ee.jsx(G.StrictMode,{children:ee.jsx(Rm,{})}));
|